Skip to contentSkip to conversation

usbip: vudc: Make use of the helper macro LIST_HEAD()

PATCH In review Cai Huoqing 2 participants 2 messages Feb 11, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 usbip: vudc: Make use of the helper macro LIST_HEAD()

Replace "struct list_head head = LIST_HEAD_INIT(head)" with "LIST_HEAD(head)" to simplify the code.

LIST_HEAD() helps to clean up the code "struct list_head vudc_devices =", only to care about the variable 'vudc_devices'.

---
v1->v2: update the changelog to explain why this change simplifies the code.

 drivers/usb/usbip/vudc_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/usbip/vudc_main.c +1 -1
index 678faa82598c..d43252b77efd 100644
@@ -26,7 +26,7 @@ static struct platform_driver vudc_driver = {
 	},
 };
 
-static struct list_head vudc_devices = LIST_HEAD_INIT(vudc_devices);
+static LIST_HEAD(vudc_devices);
 
 static int __init init(void)
 {
Signature · 1 line
2.25.1
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 19 lines · Cai Huoqing

Replace "struct list_head head = LIST_HEAD_INIT(head)" with "LIST_HEAD(head)" to simplify the code.

LIST_HEAD() helps to clean up the code "struct list_head vudc_devices =", only to care about the variable 'vudc_devices'.

---
v1->v2: update the changelog to explain why this change simplifies the code.

  drivers/usb/usbip/vudc_main.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/usbip/vudc_main.c +0 -0
index 678faa82598c..d43252b77efd 100644

drivers/usb/usbip/vudc_main.c static struct platform_driver vudc_driver = { · line 32

Quoted 8 lines
drivers/usb/usbip/vudc_main.c +1 -1
@@ -26,7 +26,7 @@ static struct platform_driver vudc_driver = {
  	},
  };
 
-static struct list_head vudc_devices = LIST_HEAD_INIT(vudc_devices);
+static LIST_HEAD(vudc_devices);
 
  static int __init init(void)
  {

Hi Greg,

Please pick this up.

thanks,
-- Shuah