Skip to contentSkip to conversation

regulator: tps80031: remove unnecessary parentheses

PATCH Applied Jingoo Han 3 participants 9 messages Feb 26, 2014 – Mar 19, 2014 Voltage and current regulator framework

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/3 regulator: tps80031: remove unnecessary parentheses

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

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

---
 drivers/regulator/tps80031-regulator.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/tps80031-regulator.c +1 -1
index ac88c98..26aa6d9 100644
@@ -115,7 +115,7 @@ static int tps80031_reg_is_enabled(struct regulator_dev *rdev)
 			ri->rinfo->state_reg, ret);
 		return ret;
 	}
-	return ((reg_val & TPS80031_STATE_MASK) == TPS80031_STATE_ON);
+	return (reg_val & TPS80031_STATE_MASK) == TPS80031_STATE_ON;
 }
 
 static int tps80031_reg_enable(struct regulator_dev *rdev)
Signature · 1 line
1.7.10.4
author
#1 lore raw

PATCH 2/3 regulator: dbx500: use seq_puts() instead of seq_printf()

For a constant format without additional arguments, use seq_puts() instead of seq_printf(). Also, it fixes the following checkpatch warning.

WARNING: Prefer seq_puts to seq_printf

---
 drivers/regulator/dbx500-prcmu.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/regulator/dbx500-prcmu.c +5 -5
index f111dfb..3dd1096 100644
@@ -97,10 +97,10 @@ static int ux500_regulator_power_state_cnt_print(struct seq_file *s, void *p)
 	int err;
 
 	/* print power state count */
-	err = seq_printf(s, "ux500-regulator power state count: %i\n",
-		power_state_active_get());
+	err = seq_puts(s, "ux500-regulator power state count: %i\n",
+			power_state_active_get());
 	if (err < 0)
-		dev_err(dev, "seq_printf overflow\n");
+		dev_err(dev, "seq_puts overflow\n");
 
 	return 0;
 }
@@ -127,9 +127,9 @@ static int ux500_regulator_status_print(struct seq_file *s, void *p)
 	int i;
 
 	/* print dump header */
-	err = seq_printf(s, "ux500-regulator status:\n");
+	err = seq_puts(s, "ux500-regulator status:\n");
 	if (err < 0)
-		dev_err(dev, "seq_printf overflow\n");
+		dev_err(dev, "seq_puts overflow\n");
 
 	err = seq_printf(s, "%31s : %8s : %8s\n", "current",
 		"before", "after");
Signature · 1 line
1.7.10.4
author
#2 lore raw

Re: [PATCH 2/3] regulator: dbx500: use seq_puts() instead of seq_printf()

Quoted 17 lines · Jingoo Han

For a constant format without additional arguments, use seq_puts() instead of seq_printf(). Also, it fixes the following checkpatch warning.

WARNING: Prefer seq_puts to seq_printf

---
 drivers/regulator/dbx500-prcmu.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/regulator/dbx500-prcmu.c +0 -0
index f111dfb..3dd1096 100644

drivers/regulator/dbx500-prcmu.c static int ux500_regulator_power_state_cnt_print(struct seq_file *s, void *p) · line 101

Quoted 7 lines
drivers/regulator/dbx500-prcmu.c +2 -2
@@ -97,10 +97,10 @@ static int ux500_regulator_power_state_cnt_print(struct seq_file *s, void *p)
 	int err;
 
 	/* print power state count */
-	err = seq_printf(s, "ux500-regulator power state count: %i\n",
-		power_state_active_get());
+	err = seq_puts(s, "ux500-regulator power state count: %i\n",
+			power_state_active_get());

It makes build error with 'make ARCH=arm allmodconfig', as Fengguang Wu reported.

drivers/regulator/dbx500-prcmu.c: In function 'ux500_regulator_power_state_cnt_print':
drivers/regulator/dbx500-prcmu.c:103:4: error: too many arguments to function 'seq_puts'

So, I will send v2 patch. Sorry for annoying you.
Thank you.

Best regards,
Jingoo Han

Quoted 20 lines
drivers/regulator/dbx500-prcmu.c +3 -4
 	if (err < 0)
-		dev_err(dev, "seq_printf overflow\n");
+		dev_err(dev, "seq_puts overflow\n");
 
 	return 0;
 }
@@ -127,9 +127,9 @@ static int ux500_regulator_status_print(struct seq_file *s, void *p)
 	int i;
 
 	/* print dump header */
-	err = seq_printf(s, "ux500-regulator status:\n");
+	err = seq_puts(s, "ux500-regulator status:\n");
 	if (err < 0)
-		dev_err(dev, "seq_printf overflow\n");
+		dev_err(dev, "seq_puts overflow\n");
 
 	err = seq_printf(s, "%31s : %8s : %8s\n", "current",
 		"before", "after");
--

1.7.10.4

author
#3 lore raw

PATCH v2 1/1 regulator: dbx500: use seq_puts() instead of seq_printf()

In reply to Jingoo Han

For a constant format without additional arguments, use seq_puts() instead of seq_printf(). Also, it fixes the following checkpatch warning.

WARNING: Prefer seq_puts to seq_printf

---
Changes since v1:
- Removed unnecessary seq_puts() in ux500_regulator_power_state_cnt_print() in order to prevent build error, per Fengguang Wu.

 drivers/regulator/dbx500-prcmu.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/dbx500-prcmu.c +2 -2
index ce89f78..ac2c1d6 100644
@@ -127,9 +127,9 @@ static int ux500_regulator_status_print(struct seq_file *s, void *p)
 	int i;
 
 	/* print dump header */
-	err = seq_printf(s, "ux500-regulator status:\n");
+	err = seq_puts(s, "ux500-regulator status:\n");
 	if (err < 0)
-		dev_err(dev, "seq_printf overflow\n");
+		dev_err(dev, "seq_puts overflow\n");
 
 	err = seq_printf(s, "%31s : %8s : %8s\n", "current",
 		"before", "after");
Signature · 1 line
1.7.10.4
maintainer Applied
#4 lore raw

Re: [PATCH V2] regulator: dbx500: use seq_puts() instead of seq_printf()

Quoted 3 lines · Jingoo Han

For a constant format without additional arguments, use seq_puts() instead of seq_printf(). Also, it fixes the following checkpatch warning.

Applied, thanks, but please in future send incremental fixes for already applied patches.

author
#5 lore raw

PATCH 3/3 regulator: 88pm8607: fix indent code style

In reply to Jingoo Han

Fix indent code style in order to fix the following checkpatch issues.

ERROR: code indent should use tabs where possible
WARNING: please, no space before tabs
WARNING: please, no spaces at the start of a line

---
 drivers/regulator/88pm8607.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/regulator/88pm8607.c +3 -3
index fa99bfc..337634a 100644
@@ -2,7 +2,7 @@
  * Regulators driver for Marvell 88PM8607
  *
  * Copyright (C) 2009 Marvell International Ltd.
- * 	Haojian Zhuang <[email protected]>
+ *	Haojian Zhuang <[email protected]>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -78,7 +78,7 @@ static const unsigned int BUCK2_suspend_table[] = {
 };
 
 static const unsigned int BUCK3_table[] = {
-              0,   25000,   50000,   75000,  100000,  125000,  150000,  175000,
+	      0,   25000,   50000,   75000,  100000,  125000,  150000,  175000,
 	 200000,  225000,  250000,  275000,  300000,  325000,  350000,  375000,
 	 400000,  425000,  450000,  475000,  500000,  525000,  550000,  575000,
 	 600000,  625000,  650000,  675000,  700000,  725000,  750000,  775000,
@@ -89,7 +89,7 @@ static const unsigned int BUCK3_table[] = {
 };
 
 static const unsigned int BUCK3_suspend_table[] = {
-              0,   25000,   50000,   75000,  100000,  125000,  150000,  175000,
+	      0,   25000,   50000,   75000,  100000,  125000,  150000,  175000,
 	 200000,  225000,  250000,  275000,  300000,  325000,  350000,  375000,
 	 400000,  425000,  450000,  475000,  500000,  525000,  550000,  575000,
 	 600000,  625000,  650000,  675000,  700000,  725000,  750000,  775000,
Signature · 1 line
1.7.10.4
Acked-by on v1 3/3
#6 lore raw

Re: [PATCH 3/3] regulator: 88pm8607: fix indent code style

Quoted 44 lines · Jingoo Han

Fix indent code style in order to fix the following checkpatch issues.

ERROR: code indent should use tabs where possible
WARNING: please, no space before tabs
WARNING: please, no spaces at the start of a line

---
 drivers/regulator/88pm8607.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/regulator/88pm8607.c +3 -4
index fa99bfc..337634a 100644
@@ -2,7 +2,7 @@
  * Regulators driver for Marvell 88PM8607
  *
  * Copyright (C) 2009 Marvell International Ltd.
- *     Haojian Zhuang <[email protected]>
+ *     Haojian Zhuang <[email protected]>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -78,7 +78,7 @@ static const unsigned int BUCK2_suspend_table[] = {
 };
 
 static const unsigned int BUCK3_table[] = {
-              0,   25000,   50000,   75000,  100000,  125000,  150000,  175000,
+             0,   25000,   50000,   75000,  100000,  125000,  150000,  175000,
         200000,  225000,  250000,  275000,  300000,  325000,  350000,  375000,
         400000,  425000,  450000,  475000,  500000,  525000,  550000,  575000,
         600000,  625000,  650000,  675000,  700000,  725000,  750000,  775000,
@@ -89,7 +89,7 @@ static const unsigned int BUCK3_table[] = {
 };
 
 static const unsigned int BUCK3_suspend_table[] = {
-              0,   25000,   50000,   75000,  100000,  125000,  150000,  175000,
+             0,   25000,   50000,   75000,  100000,  125000,  150000,  175000,
         200000,  225000,  250000,  275000,  300000,  325000,  350000,  375000,
         400000,  425000,  450000,  475000,  500000,  525000,  550000,  575000,
         600000,  625000,  650000,  675000,  700000,  725000,  750000,  775000,
--
Quoted 3 lines

1.7.10.4

Regards
Haojian

maintainer Applied
#7 lore raw

Re: [PATCH 3/3] regulator: 88pm8607: fix indent code style

In reply to Jingoo Han
Quoted 2 lines · Jingoo Han

Fix indent code style in order to fix the following checkpatch issues.

Applied, thanks.

maintainer Applied
#8 lore raw
In reply to Jingoo Han
Quoted 4 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.