Skip to contentSkip to conversation

Remove dead code and driver version

PATCH In review Leon Romanovsky 3 participants 11 messages Feb 20, 2020 – Mar 30, 2020 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

cover Remove dead code and driver version

From: Leon Romanovsky <[email protected]>

Hi,

This short series is an outcome of the change in ethtool [1] to provide proper driver version that will work reliably. The second patch is removal of useless timer setup.

Code is compile tested only.

[1] https://lore.kernel.org/linux-rdma/[email protected]/

Leon Romanovsky (2):
um: Don't overwrite ethtool driver version
um: Delete never executed timer

 arch/um/drivers/net_kern.c    | 13 -------------
 arch/um/drivers/vector_kern.c |  2 --
 2 files changed, 15 deletions(-)

--
2.24.1

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um

#1 lore raw

PATCH 1/2 um: Don't overwrite ethtool driver version

From: Leon Romanovsky <[email protected]>

In-tree drivers don't need to manage internal version because they are aligned to the global Linux kernel version, which is reported by default with "ethtool -i".

---
 arch/um/drivers/net_kern.c    | 1 -
 arch/um/drivers/vector_kern.c | 2 --
 2 files changed, 3 deletions(-)
arch/um/drivers/net_kern.c +0 -1
index 35ebeebfc1a8..af07733c2dc8 100644
@@ -266,7 +266,6 @@ static void uml_net_get_drvinfo(struct net_device *dev,
 				struct ethtool_drvinfo *info)
 {
 	strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
-	strlcpy(info->version, "42", sizeof(info->version));
 }
 
 static const struct ethtool_ops uml_net_ethtool_ops = {
arch/um/drivers/vector_kern.c +0 -2
index 0ff86391f77d..9693dfca7651 100644
@@ -46,7 +46,6 @@
 
 
 #define DRIVER_NAME "uml-vector"
-#define DRIVER_VERSION "01"
 struct vector_cmd_line_arg {
 	struct list_head list;
 	int unit;
@@ -1378,7 +1377,6 @@ static void vector_net_get_drvinfo(struct net_device *dev,
 				struct ethtool_drvinfo *info)
 {
 	strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
-	strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
 }
 
 static int vector_net_load_bpf_flash(struct net_device *dev,

--
2.24.1

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um

#5 lore raw

PATCH 2/2 um: Delete never executed timer

In reply to Leon Romanovsky

From: Leon Romanovsky <[email protected]>

The "#ifdef undef" construction effectively disabled the timer. It causes to the fact that this timer did nothing, so delete it.

---
 arch/um/drivers/net_kern.c | 12 ------------
 1 file changed, 12 deletions(-)
arch/um/drivers/net_kern.c +0 -12
index af07733c2dc8..1802cf4ef5a5 100644
@@ -274,17 +274,6 @@ static const struct ethtool_ops uml_net_ethtool_ops = {
 	.get_ts_info	= ethtool_op_get_ts_info,
 };
 
-static void uml_net_user_timer_expire(struct timer_list *t)
-{
-#ifdef undef
-	struct uml_net_private *lp = from_timer(lp, t, tl);
-	struct connection *conn = &lp->user;
-
-	dprintk(KERN_INFO "uml_net_user_timer_expire [%p]\n", conn);
-	do_connect(conn);
-#endif
-}
-
 void uml_net_setup_etheraddr(struct net_device *dev, char *str)
 {
 	unsigned char *addr = dev->dev_addr;
@@ -455,7 +444,6 @@ static void eth_configure(int n, void *init, char *mac,
 		  .add_address 		= transport->user->add_address,
 		  .delete_address  	= transport->user->delete_address });
 
-	timer_setup(&lp->tl, uml_net_user_timer_expire, 0);
 	spin_lock_init(&lp->lock);
 	memcpy(lp->mac, dev->dev_addr, sizeof(lp->mac));
 

--
2.24.1

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um

maintainer Acked-by on the v1 series
#7 lore raw
In reply to Leon Romanovsky
Quoted 16 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

Hi,

This short series is an outcome of the change in ethtool [1] to provide proper driver version that will work reliably. The second patch is removal of useless timer setup.

Code is compile tested only.

[1] https://lore.kernel.org/linux-rdma/[email protected]/

Leon Romanovsky (2):
um: Don't overwrite ethtool driver version
um: Delete never executed timer

Quoted 8 lines
  arch/um/drivers/net_kern.c    | 13 -------------
  arch/um/drivers/vector_kern.c |  2 --
  2 files changed, 15 deletions(-)

--
2.24.1

Signature · 9 lines
Anton R. Ivanov

Cambridge Greys Limited, England and Wales company No 10273661
http://www.cambridgegreys.com/

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
maintainer Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] um: Don't overwrite ethtool driver version

In reply to Leon Romanovsky
Quoted 46 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

In-tree drivers don't need to manage internal version because they are aligned to the global Linux kernel version, which is reported by default with "ethtool -i".

---
  arch/um/drivers/net_kern.c    | 1 -
  arch/um/drivers/vector_kern.c | 2 --
  2 files changed, 3 deletions(-)
arch/um/drivers/net_kern.c +0 -1
index 35ebeebfc1a8..af07733c2dc8 100644
@@ -266,7 +266,6 @@ static void uml_net_get_drvinfo(struct net_device *dev,
  				struct ethtool_drvinfo *info)
  {
  	strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
-	strlcpy(info->version, "42", sizeof(info->version));
  }
 
  static const struct ethtool_ops uml_net_ethtool_ops = {
arch/um/drivers/vector_kern.c +0 -3
index 0ff86391f77d..9693dfca7651 100644
@@ -46,7 +46,6 @@
 
 
  #define DRIVER_NAME "uml-vector"
-#define DRIVER_VERSION "01"
  struct vector_cmd_line_arg {
  	struct list_head list;
  	int unit;
@@ -1378,7 +1377,6 @@ static void vector_net_get_drvinfo(struct net_device *dev,
  				struct ethtool_drvinfo *info)
  {
  	strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
-	strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
  }
 
  static int vector_net_load_bpf_flash(struct net_device *dev,
--
Quoted 3 lines

2.24.1

Signature · 9 lines
Anton R. Ivanov

Cambridge Greys Limited, England and Wales company No 10273661
http://www.cambridgegreys.com/

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
maintainer Acked-by on v1 2/2
#6 lore raw

Re: [PATCH 2/2] um: Delete never executed timer

In reply to Leon Romanovsky
Quoted 42 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

The "#ifdef undef" construction effectively disabled the timer. It causes to the fact that this timer did nothing, so delete it.

---
  arch/um/drivers/net_kern.c | 12 ------------
  1 file changed, 12 deletions(-)
arch/um/drivers/net_kern.c +0 -13
index af07733c2dc8..1802cf4ef5a5 100644
@@ -274,17 +274,6 @@ static const struct ethtool_ops uml_net_ethtool_ops = {
  	.get_ts_info	= ethtool_op_get_ts_info,
  };
 
-static void uml_net_user_timer_expire(struct timer_list *t)
-{
-#ifdef undef
-	struct uml_net_private *lp = from_timer(lp, t, tl);
-	struct connection *conn = &lp->user;
-
-	dprintk(KERN_INFO "uml_net_user_timer_expire [%p]\n", conn);
-	do_connect(conn);
-#endif
-}
-
  void uml_net_setup_etheraddr(struct net_device *dev, char *str)
  {
  	unsigned char *addr = dev->dev_addr;
@@ -455,7 +444,6 @@ static void eth_configure(int n, void *init, char *mac,
  		  .add_address 		= transport->user->add_address,
  		  .delete_address  	= transport->user->delete_address });
 
-	timer_setup(&lp->tl, uml_net_user_timer_expire, 0);
  	spin_lock_init(&lp->lock);
  	memcpy(lp->mac, dev->dev_addr, sizeof(lp->mac));
 
--
Quoted 3 lines

2.24.1

Signature · 9 lines
Anton R. Ivanov

Cambridge Greys Limited, England and Wales company No 10273661
http://www.cambridgegreys.com/

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
#8 lore raw
In reply to Anton Ivanov
Quoted 23 lines · Anton Ivanov
Quoted 20 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

Hi,

This short series is an outcome of the change in ethtool [1] to provide proper driver version that will work reliably. The second patch is removal of useless timer setup.

Code is compile tested only.

[1] https://lore.kernel.org/linux-rdma/[email protected]/

Leon Romanovsky (2):
um: Don't overwrite ethtool driver version
um: Delete never executed timer

  arch/um/drivers/net_kern.c    | 13 -------------
  arch/um/drivers/vector_kern.c |  2 --
  2 files changed, 15 deletions(-)
Quoted 6 lines
Quoted 4 lines

--
2.24.1

Thanks Anton, I'm wondering if I expected to do some extra steps to be sure that those patches will be sent in next merge window to Linus?

Thanks

Quoted 6 lines

--
Anton R. Ivanov

Cambridge Greys Limited, England and Wales company No 10273661
http://www.cambridgegreys.com/

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um

maintainer
#9 lore raw
Quoted 29 lines · Leon Romanovsky
Quoted 28 lines · Anton Ivanov
Quoted 24 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

Hi,

This short series is an outcome of the change in ethtool [1] to provide proper driver version that will work reliably. The second patch is removal of useless timer setup.

Code is compile tested only.

[1] https://lore.kernel.org/linux-rdma/[email protected]/

Leon Romanovsky (2):
um: Don't overwrite ethtool driver version
um: Delete never executed timer

   arch/um/drivers/net_kern.c    | 13 -------------
   arch/um/drivers/vector_kern.c |  2 --
   2 files changed, 15 deletions(-)

--
2.24.1

Quoted 5 lines
Quoted 1 line

Thanks Anton, I'm wondering if I expected to do some extra steps to be sure that those patches will be sent in next merge window to Linus?

"When" is Richard's decision. I just check and clear patches for the time being.

Brgds,

Quoted 15 lines

Thanks

Quoted 6 lines

--
Anton R. Ivanov

Cambridge Greys Limited, England and Wales company No 10273661
http://www.cambridgegreys.com/

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um

Signature · 8 lines
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
#10 lore raw
Quoted 30 lines · Anton Ivanov
Quoted 29 lines · Leon Romanovsky
Quoted 28 lines · Anton Ivanov
Quoted 24 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

Hi,

This short series is an outcome of the change in ethtool [1] to provide proper driver version that will work reliably. The second patch is removal of useless timer setup.

Code is compile tested only.

[1] https://lore.kernel.org/linux-rdma/[email protected]/

Leon Romanovsky (2):
um: Don't overwrite ethtool driver version
um: Delete never executed timer

   arch/um/drivers/net_kern.c    | 13 -------------
   arch/um/drivers/vector_kern.c |  2 --
   2 files changed, 15 deletions(-)

--
2.24.1

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Thanks Anton, I'm wondering if I expected to do some extra steps to be sure that those patches will be sent in next merge window to Linus?

"When" is Richard's decision. I just check and clear patches for the time being.

Richard, any feedback?

Thanks

Quoted 20 lines

Brgds,

Quoted 7 lines

Thanks

Quoted 4 lines

--
Anton R. Ivanov

Quoted 8 lines
Quoted 2 lines

Cambridge Greys Limited, England and Wales company No 10273661
http://www.cambridgegreys.com/

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um

Quoted 4 lines

--
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um

#3 lore raw

Re: [PATCH 1/2] um: Don't overwrite ethtool driver version

In reply to Anton Ivanov
Quoted 48 lines · Anton Ivanov
Quoted 44 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

In-tree drivers don't need to manage internal version because they are aligned to the global Linux kernel version, which is reported by default with "ethtool -i".

---
  arch/um/drivers/net_kern.c    | 1 -
  arch/um/drivers/vector_kern.c | 2 --
  2 files changed, 3 deletions(-)
arch/um/drivers/net_kern.c +0 -1
index 35ebeebfc1a8..af07733c2dc8 100644
@@ -266,7 +266,6 @@ static void uml_net_get_drvinfo(struct net_device *dev,
                              struct ethtool_drvinfo *info)
  {
      strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
-     strlcpy(info->version, "42", sizeof(info->version));
  }
 
  static const struct ethtool_ops uml_net_ethtool_ops = {
arch/um/drivers/vector_kern.c +0 -2
index 0ff86391f77d..9693dfca7651 100644
@@ -46,7 +46,6 @@
 
 
  #define DRIVER_NAME "uml-vector"
-#define DRIVER_VERSION "01"
  struct vector_cmd_line_arg {
      struct list_head list;
      int unit;
@@ -1378,7 +1377,6 @@ static void vector_net_get_drvinfo(struct net_device *dev,
                              struct ethtool_drvinfo *info)
  {
      strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
-     strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
  }
 
Quoted 7 lines
Quoted 5 lines
arch/um/drivers/vector_kern.c +0 -1
  static int vector_net_load_bpf_flash(struct net_device *dev,
--

2.24.1

Both patches applied, thanks!

Signature · 7 lines
Thanks,
//richard

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
#4 lore raw

Re: [PATCH 1/2] um: Don't overwrite ethtool driver version

Quoted 58 lines · Richard Weinberger
Quoted 48 lines · Anton Ivanov
Quoted 44 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

In-tree drivers don't need to manage internal version because they are aligned to the global Linux kernel version, which is reported by default with "ethtool -i".

---
  arch/um/drivers/net_kern.c    | 1 -
  arch/um/drivers/vector_kern.c | 2 --
  2 files changed, 3 deletions(-)
arch/um/drivers/net_kern.c +0 -1
index 35ebeebfc1a8..af07733c2dc8 100644
@@ -266,7 +266,6 @@ static void uml_net_get_drvinfo(struct net_device *dev,
                              struct ethtool_drvinfo *info)
  {
      strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
-     strlcpy(info->version, "42", sizeof(info->version));
  }
 
  static const struct ethtool_ops uml_net_ethtool_ops = {
arch/um/drivers/vector_kern.c +0 -2
index 0ff86391f77d..9693dfca7651 100644
@@ -46,7 +46,6 @@
 
 
  #define DRIVER_NAME "uml-vector"
-#define DRIVER_VERSION "01"
  struct vector_cmd_line_arg {
      struct list_head list;
      int unit;
@@ -1378,7 +1377,6 @@ static void vector_net_get_drvinfo(struct net_device *dev,
                              struct ethtool_drvinfo *info)
  {
      strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
-     strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
  }
 
Quoted 7 lines
Quoted 5 lines
arch/um/drivers/vector_kern.c +0 -1
  static int vector_net_load_bpf_flash(struct net_device *dev,
--

2.24.1

Quoted 1 line

Both patches applied, thanks!

Thanks for taking care.

Quoted 4 lines

--
Thanks,
//richard

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um