diff mbox

[2/4] regulator: max8660: Silence checkpatch warnings

Message ID 1395138184-25287-2-git-send-email-sachin.kamat@linaro.org
State Accepted
Commit f920ec798180899fff278973d174d78445d7e7ab
Headers show

Commit Message

Sachin Kamat March 18, 2014, 10:23 a.m. UTC
Silences the following type of error/warnings:
ERROR: that open brace { should be on the previous line
WARNING: Missing a blank line after declarations

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/regulator/max8660.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

Comments

Mark Brown March 18, 2014, 12:39 p.m. UTC | #1
On Tue, Mar 18, 2014 at 03:53:02PM +0530, Sachin Kamat wrote:
> Silences the following type of error/warnings:
> ERROR: that open brace { should be on the previous line
> WARNING: Missing a blank line after declarations

Applied, but...

> -	static const u8 max8660_addresses[MAX8660_N_REGS] =
> -	  { 0x10, 0x12, 0x20, 0x23, 0x24, 0x29, 0x2a, 0x32, 0x33, 0x39, 0x80 };
> +	static const u8 max8660_addresses[MAX8660_N_REGS] = {
> +	  0x10, 0x12, 0x20, 0x23, 0x24, 0x29, 0x2a, 0x32, 0x33, 0x39, 0x80 };

Think about what you're doing here - you want the }; on a new line too.
Sachin Kamat March 19, 2014, 8:14 a.m. UTC | #2
On 18 March 2014 18:09, Mark Brown <broonie@kernel.org> wrote:
> On Tue, Mar 18, 2014 at 03:53:02PM +0530, Sachin Kamat wrote:
>> Silences the following type of error/warnings:
>> ERROR: that open brace { should be on the previous line
>> WARNING: Missing a blank line after declarations
>
> Applied, but...
>
>> -     static const u8 max8660_addresses[MAX8660_N_REGS] =
>> -       { 0x10, 0x12, 0x20, 0x23, 0x24, 0x29, 0x2a, 0x32, 0x33, 0x39, 0x80 };
>> +     static const u8 max8660_addresses[MAX8660_N_REGS] = {
>> +       0x10, 0x12, 0x20, 0x23, 0x24, 0x29, 0x2a, 0x32, 0x33, 0x39, 0x80 };
>
> Think about what you're doing here - you want the }; on a new line too.

Sorry about it. I was kind of in two minds about shifting it. I will
send a followup
for completeness.
diff mbox

Patch

diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c
index bbbe53b1b5bf..aabfb3b2407c 100644
--- a/drivers/regulator/max8660.c
+++ b/drivers/regulator/max8660.c
@@ -85,11 +85,12 @@  struct max8660 {
 
 static int max8660_write(struct max8660 *max8660, u8 reg, u8 mask, u8 val)
 {
-	static const u8 max8660_addresses[MAX8660_N_REGS] =
-	  { 0x10, 0x12, 0x20, 0x23, 0x24, 0x29, 0x2a, 0x32, 0x33, 0x39, 0x80 };
+	static const u8 max8660_addresses[MAX8660_N_REGS] = {
+	  0x10, 0x12, 0x20, 0x23, 0x24, 0x29, 0x2a, 0x32, 0x33, 0x39, 0x80 };
 
 	int ret;
 	u8 reg_val = (max8660->shadow_regs[reg] & mask) | val;
+
 	dev_vdbg(&max8660->client->dev, "Writing reg %02x with %02x\n",
 			max8660_addresses[reg], reg_val);
 
@@ -111,6 +112,7 @@  static int max8660_dcdc_is_enabled(struct regulator_dev *rdev)
 	struct max8660 *max8660 = rdev_get_drvdata(rdev);
 	u8 val = max8660->shadow_regs[MAX8660_OVER1];
 	u8 mask = (rdev_get_id(rdev) == MAX8660_V3) ? 1 : 4;
+
 	return !!(val & mask);
 }
 
@@ -118,6 +120,7 @@  static int max8660_dcdc_enable(struct regulator_dev *rdev)
 {
 	struct max8660 *max8660 = rdev_get_drvdata(rdev);
 	u8 bit = (rdev_get_id(rdev) == MAX8660_V3) ? 1 : 4;
+
 	return max8660_write(max8660, MAX8660_OVER1, 0xff, bit);
 }
 
@@ -125,15 +128,16 @@  static int max8660_dcdc_disable(struct regulator_dev *rdev)
 {
 	struct max8660 *max8660 = rdev_get_drvdata(rdev);
 	u8 mask = (rdev_get_id(rdev) == MAX8660_V3) ? ~1 : ~4;
+
 	return max8660_write(max8660, MAX8660_OVER1, mask, 0);
 }
 
 static int max8660_dcdc_get_voltage_sel(struct regulator_dev *rdev)
 {
 	struct max8660 *max8660 = rdev_get_drvdata(rdev);
-
 	u8 reg = (rdev_get_id(rdev) == MAX8660_V3) ? MAX8660_ADTV2 : MAX8660_SDTV2;
 	u8 selector = max8660->shadow_regs[reg];
+
 	return selector;
 }
 
@@ -206,6 +210,7 @@  static int max8660_ldo67_is_enabled(struct regulator_dev *rdev)
 	struct max8660 *max8660 = rdev_get_drvdata(rdev);
 	u8 val = max8660->shadow_regs[MAX8660_OVER2];
 	u8 mask = (rdev_get_id(rdev) == MAX8660_V6) ? 2 : 4;
+
 	return !!(val & mask);
 }
 
@@ -213,6 +218,7 @@  static int max8660_ldo67_enable(struct regulator_dev *rdev)
 {
 	struct max8660 *max8660 = rdev_get_drvdata(rdev);
 	u8 bit = (rdev_get_id(rdev) == MAX8660_V6) ? 2 : 4;
+
 	return max8660_write(max8660, MAX8660_OVER2, 0xff, bit);
 }
 
@@ -220,15 +226,16 @@  static int max8660_ldo67_disable(struct regulator_dev *rdev)
 {
 	struct max8660 *max8660 = rdev_get_drvdata(rdev);
 	u8 mask = (rdev_get_id(rdev) == MAX8660_V6) ? ~2 : ~4;
+
 	return max8660_write(max8660, MAX8660_OVER2, mask, 0);
 }
 
 static int max8660_ldo67_get_voltage_sel(struct regulator_dev *rdev)
 {
 	struct max8660 *max8660 = rdev_get_drvdata(rdev);
-
 	u8 shift = (rdev_get_id(rdev) == MAX8660_V6) ? 0 : 4;
 	u8 selector = (max8660->shadow_regs[MAX8660_L12VCR] >> shift) & 0xf;
+
 	return selector;
 }