Skip to contentSkip to conversation

regulator: pfuze100-regulator: Fix some checkpatch complaints

PATCH Applied Fabio Estevam 3 participants 4 messages Jan 15, 2014 – Jan 16, 2014 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: pfuze100-regulator: Fix some checkpatch complaints

From: Fabio Estevam <[email protected]>

Fix the following checkpatch error and warning:

ERROR: switch and case should be at the same indent #311: FILE: drivers/regulator/pfuze100-regulator.c:311:
+ switch (value & 0x0f) {
[...]
+ case 0x8:
[...]
+ case 0x0:
[...]
+ default:

WARNING: line over 80 characters
#312: FILE: drivers/regulator/pfuze100-regulator.c:312:
+ /* Freescale misprogrammed 1-3% of parts prior to week 8 of 2013 as ID=8 */

---
 drivers/regulator/pfuze100-regulator.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/regulator/pfuze100-regulator.c +11 -8
index 0c511ae..ac01ad2 100644
@@ -309,14 +309,17 @@ static int pfuze_identify(struct pfuze_chip *pfuze_chip)
 		return ret;
 
 	switch (value & 0x0f) {
-		/* Freescale misprogrammed 1-3% of parts prior to week 8 of 2013 as ID=8 */
-		case 0x8:
-			dev_info(pfuze_chip->dev, "Assuming misprogrammed ID=0x8");
-		case 0x0:
-			break;
-		default:
-			dev_warn(pfuze_chip->dev, "Illegal ID: %x\n", value);
-			return -ENODEV;
+	/*
+	 * Freescale misprogrammed 1-3% of parts prior to week 8 of 2013
+	 * as ID=8
+	 */
+	case 0x8:
+		dev_info(pfuze_chip->dev, "Assuming misprogrammed ID=0x8");
+	case 0x0:
+		break;
+	default:
+		dev_warn(pfuze_chip->dev, "Illegal ID: %x\n", value);
+		return -ENODEV;
 	}
 
 	ret = regmap_read(pfuze_chip->regmap, PFUZE100_REVID, &value);
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 1 line · Fabio Estevam

Fix the following checkpatch error and warning:

While you're at it:

drivers/regulator/pfuze100-regulator.c

Quoted 1 line
drivers/regulator/pfuze100-regulator.c +0 -0

[]

drivers/regulator/pfuze100-regulator.c static int pfuze_identify(struct pfuze_chip *pfuze_chip)

Quoted 1 line
drivers/regulator/pfuze100-regulator.c +0 -0
@@ -309,14 +309,17 @@ static int pfuze_identify(struct pfuze_chip *pfuze_chip)

[]

drivers/regulator/pfuze100-regulator.c static int pfuze_identify(struct pfuze_chip *pfuze_chip) · line 317

Quoted 2 lines
drivers/regulator/pfuze100-regulator.c +2 -0
+	case 0x8:
+		dev_info(pfuze_chip->dev, "Assuming misprogrammed ID=0x8");

missing "\n" terminating newline and
missing break (or fallthrough comment)

drivers/regulator/pfuze100-regulator.c static int pfuze_identify(struct pfuze_chip *pfuze_chip) · line 321

Quoted 4 lines
drivers/regulator/pfuze100-regulator.c +4 -0
+	case 0x0:
+		break;
+	default:
+		dev_warn(pfuze_chip->dev, "Illegal ID: %x\n", value);

invalid vs illegal

#2 lore raw
Quoted 15 lines · Joe Perches
Quoted 1 line · Fabio Estevam

Fix the following checkpatch error and warning:

While you're at it:

drivers/regulator/pfuze100-regulator.c

Quoted 1 line
drivers/regulator/pfuze100-regulator.c +0 -0

[]

drivers/regulator/pfuze100-regulator.c static int pfuze_identify(struct pfuze_chip *pfuze_chip)

Quoted 1 line
drivers/regulator/pfuze100-regulator.c +0 -0
@@ -309,14 +309,17 @@ static int pfuze_identify(struct pfuze_chip *pfuze_chip)

[]

drivers/regulator/pfuze100-regulator.c static int pfuze_identify(struct pfuze_chip *pfuze_chip) · line 317

Quoted 2 lines
drivers/regulator/pfuze100-regulator.c +2 -0
+     case 0x8:
+             dev_info(pfuze_chip->dev, "Assuming misprogrammed ID=0x8");

missing "\n" terminating newline and
missing break (or fallthrough comment)

Quoted 6 lines

drivers/regulator/pfuze100-regulator.c static int pfuze_identify(struct pfuze_chip *pfuze_chip) · line 321

Quoted 4 lines
drivers/regulator/pfuze100-regulator.c +4 -0
+     case 0x0:
+             break;
+     default:
+             dev_warn(pfuze_chip->dev, "Illegal ID: %x\n", value);

invalid vs illegal

Thanks, Joe.

Will address your suggestions through a different patch.

Regards,

Fabio Estevam