Skip to contentSkip to conversation

leds: leds-ss4200: fix incorrect placement of __initdata marker

PATCH Applied Jingoo Han 4 participants 12 messages Feb 26, 2014 – Feb 27, 2014

Subsystems (2)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/5 leds: leds-ss4200: fix incorrect placement of __initdata marker

The __initdata marker can be virtually anywhere on the line, EXCEPT right after "struct". The preferred location is before the "=" sign if there is one, or before the trailing ";" otherwise. It also fixes the following chechpatch warning.

WARNING: __initdata should be placed after nodetect

---
 drivers/leds/leds-ss4200.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-ss4200.c +1 -1
index 5b8f938..3faf550 100644
@@ -78,7 +78,7 @@ static int __init ss4200_led_dmi_callback(const struct dmi_system_id *id)
 	return 1;
 }
 
-static bool __initdata nodetect;
+static bool nodetect __initdata;
 module_param_named(nodetect, nodetect, bool, 0);
 MODULE_PARM_DESC(nodetect, "Skip DMI-based hardware detection");
 
Signature · 1 line
1.7.10.4
author
#1 lore raw

PATCH 2/5 leds: leds-ss4200: remove DEFINE_PCI_DEVICE_TABLE macro

Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro is deprecated.

---
 drivers/leds/leds-ss4200.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-ss4200.c +1 -1
index 3faf550..7dd033d 100644
@@ -63,7 +63,7 @@ MODULE_LICENSE("GPL");
 /*
  * PCI ID of the Intel ICH7 LPC Device within which the GPIO block lives.
  */
-static DEFINE_PCI_DEVICE_TABLE(ich7_lpc_pci_id) = {
+static const struct pci_device_id ich7_lpc_pci_id[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_30) },
Signature · 1 line
1.7.10.4
Applied
#2 lore raw

Re: [PATCH 2/5] leds: leds-ss4200: remove DEFINE_PCI_DEVICE_TABLE macro

Quoted 3 lines · Jingoo Han

Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro is deprecated.

Applied, thanks,
-Bryan

Quoted 22 lines
---
 drivers/leds/leds-ss4200.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-ss4200.c +1 -2
index 3faf550..7dd033d 100644
@@ -63,7 +63,7 @@ MODULE_LICENSE("GPL");
 /*
  * PCI ID of the Intel ICH7 LPC Device within which the GPIO block lives.
  */
-static DEFINE_PCI_DEVICE_TABLE(ich7_lpc_pci_id) = {
+static const struct pci_device_id ich7_lpc_pci_id[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0) },
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1) },
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_30) },
--

1.7.10.4

author
#3 lore raw

PATCH 3/5 leds: lp5562: remove unnecessary parentheses

In reply to Jingoo Han

Remove unnecessary parentheses in order to fix the following checkpatch error.

ERROR: return is not a function, parentheses are not required

---
 drivers/leds/leds-lp5562.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/leds/leds-lp5562.c +3 -3
index 315d3ca..ca85724 100644
@@ -346,9 +346,9 @@ static void lp5562_write_program_memory(struct lp55xx_chip *chip,
 /* check the size of program count */
 static inline bool _is_pc_overflow(struct lp55xx_predef_pattern *ptn)
 {
-	return (ptn->size_r >= LP5562_PROGRAM_LENGTH ||
-		ptn->size_g >= LP5562_PROGRAM_LENGTH ||
-		ptn->size_b >= LP5562_PROGRAM_LENGTH);
+	return ptn->size_r >= LP5562_PROGRAM_LENGTH ||
+	       ptn->size_g >= LP5562_PROGRAM_LENGTH ||
+	       ptn->size_b >= LP5562_PROGRAM_LENGTH;
 }
 
 static int lp5562_run_predef_led_pattern(struct lp55xx_chip *chip, int mode)
Signature · 1 line
1.7.10.4
Applied
#4 lore raw

Re: [PATCH 3/5] leds: lp5562: remove unnecessary parentheses

Quoted 5 lines · Jingoo Han

Remove unnecessary parentheses in order to fix the following checkpatch error.

ERROR: return is not a function, parentheses are not required

Applied, thanks,
-Bryan

Quoted 26 lines
---
 drivers/leds/leds-lp5562.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/leds/leds-lp5562.c +3 -4
index 315d3ca..ca85724 100644
@@ -346,9 +346,9 @@ static void lp5562_write_program_memory(struct lp55xx_chip *chip,
 /* check the size of program count */
 static inline bool _is_pc_overflow(struct lp55xx_predef_pattern *ptn)
 {
-       return (ptn->size_r >= LP5562_PROGRAM_LENGTH ||
-               ptn->size_g >= LP5562_PROGRAM_LENGTH ||
-               ptn->size_b >= LP5562_PROGRAM_LENGTH);
+       return ptn->size_r >= LP5562_PROGRAM_LENGTH ||
+              ptn->size_g >= LP5562_PROGRAM_LENGTH ||
+              ptn->size_b >= LP5562_PROGRAM_LENGTH;
 }
 
 static int lp5562_run_predef_led_pattern(struct lp55xx_chip *chip, int mode)
--

1.7.10.4

author
#5 lore raw

PATCH 4/5 leds: clevo-mail: fix incorrect placement of __initdata marker

In reply to Jingoo Han

The __initdata marker can be virtually anywhere on the line, EXCEPT right after "struct". The preferred location is before the "=" sign if there is one, or before the trailing ";" otherwise. It also fixes the following chechpatch warning.

WARNING: __initdata should be placed after nodetect

---
 drivers/leds/leds-clevo-mail.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-clevo-mail.c +1 -1
index d93e245..5974810 100644
@@ -19,7 +19,7 @@ MODULE_AUTHOR("Márton Németh <[email protected]>");
 MODULE_DESCRIPTION("Clevo mail LED driver");
 MODULE_LICENSE("GPL");
 
-static bool __initdata nodetect;
+static bool nodetect __initdata;
 module_param_named(nodetect, nodetect, bool, 0);
 MODULE_PARM_DESC(nodetect, "Skip DMI hardware detection");
 
Signature · 1 line
1.7.10.4
#6 lore raw

Re: [PATCH 4/5] leds: clevo-mail: fix incorrect placement of __initdata marker

Hello,

drivers/leds/leds-clevo-mail.c MODULE_AUTHOR("Márton Németh <[email protected]>"); · line 24

Quoted 12 lines · Jingoo Han
drivers/leds/leds-clevo-mail.c +1 -1
index d93e245..5974810 100644
@@ -19,7 +19,7 @@ MODULE_AUTHOR("Márton Németh <[email protected]>");
 MODULE_DESCRIPTION("Clevo mail LED driver");
 MODULE_LICENSE("GPL");
 
-static bool __initdata nodetect;
+static bool nodetect __initdata;
 module_param_named(nodetect, nodetect, bool, 0);
 MODULE_PARM_DESC(nodetect, "Skip DMI hardware detection");

not sure why I'm on Cc, but yes, the change is in line with gcc docs. But I wonder if __initdata is ok for a variable backing a module parameter as it appears in /sys. Does

cat /sys/module/leds-clevo-mail/parameters/nodetect

result in an oops? If yes, better drop the __initdata instead of moving it.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#7 lore raw

Re: [PATCH 4/5] leds: clevo-mail: fix incorrect placement of __initdata marker

Quoted 19 lines · Uwe Kleine-König

Hello,

drivers/leds/leds-clevo-mail.c MODULE_AUTHOR("Márton Németh <[email protected]>"); · line 24

Quoted 12 lines · Jingoo Han
drivers/leds/leds-clevo-mail.c +1 -1
index d93e245..5974810 100644
@@ -19,7 +19,7 @@ MODULE_AUTHOR("Márton Németh <[email protected]>");
 MODULE_DESCRIPTION("Clevo mail LED driver");
 MODULE_LICENSE("GPL");
 
-static bool __initdata nodetect;
+static bool nodetect __initdata;
 module_param_named(nodetect, nodetect, bool, 0);
 MODULE_PARM_DESC(nodetect, "Skip DMI hardware detection");

not sure why I'm on Cc, but yes, the change is in line with gcc docs. But I wonder if __initdata is ok for a variable backing a module parameter as it appears in /sys. Does

Quoted 4 lines

cat /sys/module/leds-clevo-mail/parameters/nodetect

result in an oops? If yes, better drop the __initdata instead of moving it.

Agree with Uwe, I think we'd better drop it. It is not right for a module parameter.

And please update a previous similar patch as well.

Thanks,
-Bryan

author
#8 lore raw

PATCH 5/5 leds: blinkm: remove unnecessary spaces

In reply to Jingoo Han

Remove unnecessary space in order to fix the following checkpatch issues.

WARNING: space prohibited before semicolon

---
 drivers/leds/leds-blinkm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-blinkm.c +1 -1
index 0c50860..d0452b0 100644
@@ -443,7 +443,7 @@ static void led_work(struct work_struct *work)
 {
 	int ret;
 	struct blinkm_led *led;
-	struct blinkm_data *data ;
+	struct blinkm_data *data;
 	struct blinkm_work *blm_work = work_to_blmwork(work);
 
 	led = blm_work->blinkm_led;
Signature · 1 line
1.7.10.4
Acked-by on v1 5/5
#9 lore raw

Re: [PATCH 5/5] leds: blinkm: remove unnecessary spaces

Signature · 5 lines
Dipl.-Ing.
Jan-Simon Möller

[email protected]
Am Mittwoch, 26. Februar 2014, 14:16:11 schrieb Jingoo Han:
Quoted 23 lines

Remove unnecessary space in order to fix the following checkpatch issues.

WARNING: space prohibited before semicolon

---
 drivers/leds/leds-blinkm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-blinkm.c +1 -1
index 0c50860..d0452b0 100644
@@ -443,7 +443,7 @@ static void led_work(struct work_struct *work)
 {
 	int ret;
 	struct blinkm_led *led;
-	struct blinkm_data *data ;
+	struct blinkm_data *data;
 	struct blinkm_work *blm_work = work_to_blmwork(work);
 
 	led = blm_work->blinkm_led;
Applied
#10 lore raw

Re: [PATCH 5/5] leds: blinkm: remove unnecessary spaces

Quoted 2 lines · Jan-Simon Möller

Thanks, applied,
-Bryan

Quoted 31 lines

--

Dipl.-Ing.
Jan-Simon Möller

[email protected]
Am Mittwoch, 26. Februar 2014, 14:16:11 schrieb Jingoo Han:

Quoted 23 lines

Remove unnecessary space in order to fix the following checkpatch issues.

WARNING: space prohibited before semicolon

---
 drivers/leds/leds-blinkm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-blinkm.c +1 -1
index 0c50860..d0452b0 100644
@@ -443,7 +443,7 @@ static void led_work(struct work_struct *work)
 {
      int ret;
      struct blinkm_led *led;
-     struct blinkm_data *data ;
+     struct blinkm_data *data;
      struct blinkm_work *blm_work = work_to_blmwork(work);
 
      led = blm_work->blinkm_led;
#11 lore raw
In reply to Jingoo Han
Quoted 7 lines · Jingoo Han

The __initdata marker can be virtually anywhere on the line, EXCEPT right after "struct". The preferred location is before the "=" sign if there is one, or before the trailing ";" otherwise. It also fixes the following chechpatch warning.

WARNING: __initdata should be placed after nodetect

Good, I merged it.
Thanks, -Bryan

Quoted 22 lines
---
 drivers/leds/leds-ss4200.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-ss4200.c +1 -2
index 5b8f938..3faf550 100644
@@ -78,7 +78,7 @@ static int __init ss4200_led_dmi_callback(const struct dmi_system_id *id)
        return 1;
 }
 
-static bool __initdata nodetect;
+static bool nodetect __initdata;
 module_param_named(nodetect, nodetect, bool, 0);
 MODULE_PARM_DESC(nodetect, "Skip DMI-based hardware detection");
 
--

1.7.10.4