* [PATCH 1/2] misc:ad525x_dpot: Fix missing blank after declaration coding style issue in ad525x_dpot.c
@ 2014-12-16 17:35 Mohammad Jamal
2014-12-16 17:36 ` [PATCH 2/2] misc: ad52x_dpot: fix break is not useful after a goto or return " Mohammad Jamal
2014-12-16 18:00 ` [PATCH 1/2] misc:ad525x_dpot: Fix missing blank after declaration " Joe Perches
0 siblings, 2 replies; 3+ messages in thread
From: Mohammad Jamal @ 2014-12-16 17:35 UTC (permalink / raw)
To: arnd; +Cc: gregkh, michael.hennerich, linux-kernel, md.jamalmohiuddin
This is a patch to ad525x_dpot.c file that fixes up a missing blank line after declaration warning found by checkpatch.pl issue
Signed-off-by: Mohammad Jamal<md.jamalmohiuddin@gmail.com>
---
drivers/misc/ad525x_dpot.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
index a43053d..32f9072 100644
--- a/drivers/misc/ad525x_dpot.c
+++ b/drivers/misc/ad525x_dpot.c
@@ -176,6 +176,7 @@ static s32 dpot_read_i2c(struct dpot_data *dpot, u8 reg)
{
int value;
unsigned ctrl = 0;
+
switch (dpot->uid) {
case DPOT_UID(AD5246_ID):
case DPOT_UID(AD5247_ID):
--
1.7.9.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] misc: ad52x_dpot: fix break is not useful after a goto or return coding style issue in ad525x_dpot.c
2014-12-16 17:35 [PATCH 1/2] misc:ad525x_dpot: Fix missing blank after declaration coding style issue in ad525x_dpot.c Mohammad Jamal
@ 2014-12-16 17:36 ` Mohammad Jamal
2014-12-16 18:00 ` [PATCH 1/2] misc:ad525x_dpot: Fix missing blank after declaration " Joe Perches
1 sibling, 0 replies; 3+ messages in thread
From: Mohammad Jamal @ 2014-12-16 17:36 UTC (permalink / raw)
To: arnd; +Cc: gregkh, michael.hennerich, linux-kernel, md.jamalmohiuddin
This is a patch to the ad525x_dpot.c that fixes up the break after return warning coding style issue found by the checkpatch.pl tool
Signed-off-by: Mohammad Jamal<md.jamalmohiuddin@gmail.com>
---
drivers/misc/ad525x_dpot.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
index 32f9072..15e8807 100644
--- a/drivers/misc/ad525x_dpot.c
+++ b/drivers/misc/ad525x_dpot.c
@@ -334,7 +334,6 @@ static s32 dpot_write_i2c(struct dpot_data *dpot, u8 reg, u16 value)
case DPOT_UID(AD5246_ID):
case DPOT_UID(AD5247_ID):
return dpot_write_d8(dpot, value);
- break;
case DPOT_UID(AD5245_ID):
case DPOT_UID(AD5241_ID):
@@ -346,7 +345,6 @@ static s32 dpot_write_i2c(struct dpot_data *dpot, u8 reg, u16 value)
ctrl = ((reg & DPOT_RDAC_MASK) == DPOT_RDAC0) ?
0 : DPOT_AD5282_RDAC_AB;
return dpot_write_r8d8(dpot, ctrl, value);
- break;
case DPOT_UID(AD5171_ID):
case DPOT_UID(AD5273_ID):
if (reg & DPOT_ADDR_OTP) {
@@ -356,7 +354,6 @@ static s32 dpot_write_i2c(struct dpot_data *dpot, u8 reg, u16 value)
ctrl = DPOT_AD5273_FUSE;
}
return dpot_write_r8d8(dpot, ctrl, value);
- break;
case DPOT_UID(AD5172_ID):
case DPOT_UID(AD5173_ID):
ctrl = ((reg & DPOT_RDAC_MASK) == DPOT_RDAC0) ?
@@ -368,7 +365,6 @@ static s32 dpot_write_i2c(struct dpot_data *dpot, u8 reg, u16 value)
ctrl |= DPOT_AD5170_2_3_FUSE;
}
return dpot_write_r8d8(dpot, ctrl, value);
- break;
case DPOT_UID(AD5170_ID):
if (reg & DPOT_ADDR_OTP) {
tmp = dpot_read_r8d16(dpot, tmp);
@@ -377,7 +373,6 @@ static s32 dpot_write_i2c(struct dpot_data *dpot, u8 reg, u16 value)
ctrl = DPOT_AD5170_2_3_FUSE;
}
return dpot_write_r8d8(dpot, ctrl, value);
- break;
case DPOT_UID(AD5272_ID):
case DPOT_UID(AD5274_ID):
dpot_write_r8d8(dpot, DPOT_AD5270_1_2_4_CTRLREG << 2,
@@ -392,7 +387,6 @@ static s32 dpot_write_i2c(struct dpot_data *dpot, u8 reg, u16 value)
return dpot_write_r8d8(dpot, (DPOT_AD5270_1_2_4_RDAC << 2) |
(value >> 8), value & 0xFF);
- break;
default:
if (reg & DPOT_ADDR_CMD)
return dpot_write_d8(dpot, reg);
--
1.7.9.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] misc:ad525x_dpot: Fix missing blank after declaration coding style issue in ad525x_dpot.c
2014-12-16 17:35 [PATCH 1/2] misc:ad525x_dpot: Fix missing blank after declaration coding style issue in ad525x_dpot.c Mohammad Jamal
2014-12-16 17:36 ` [PATCH 2/2] misc: ad52x_dpot: fix break is not useful after a goto or return " Mohammad Jamal
@ 2014-12-16 18:00 ` Joe Perches
1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2014-12-16 18:00 UTC (permalink / raw)
To: Mohammad Jamal; +Cc: arnd, gregkh, michael.hennerich, linux-kernel
On Tue, 2014-12-16 at 23:05 +0530, Mohammad Jamal wrote:
> This is a patch to ad525x_dpot.c file that fixes up a missing blank line after declaration warning found by checkpatch.pl issue
Hello Mohammad.
Thanks for the patch.
Here are some small comments:
Please run your patches through scripts/checkpatch.pl
before sending them.
This submission has an overly long commit message line.
Please limit line lengths to ~70 characters.
The "This is a patch to <foo> that fixes up " is not useful.
The "found by checkpatch.pl issue" is not particularly useful.
A simpler form might have used:
Subject: [PATCH] ad525x_dpot: Add a blank line after declaration
with a commit log of somthing like:
Use a more common kernel style.
Signed-off-by: Mohammad Jamal <md.jamalmohiuddin@gmail.com>
> Signed-off-by: Mohammad Jamal<md.jamalmohiuddin@gmail.com>
Add a space between your name and the open angle bracket
in the email address too please.
Sometimes, it's good to do all the similar types of changes
at the same time instead of multiple patches for trivial
bits.
Using:
$ ./scripts/checkpatch.pl -f --strict --types=line_spacing,braces --fix-inplace drivers/misc/ad525x_dpot.c
produces this:
diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
index a43053d..ddfe38f 100644
--- a/drivers/misc/ad525x_dpot.c
+++ b/drivers/misc/ad525x_dpot.c
@@ -176,6 +176,7 @@ static s32 dpot_read_i2c(struct dpot_data *dpot, u8 reg)
{
int value;
unsigned ctrl = 0;
+
switch (dpot->uid) {
case DPOT_UID(AD5246_ID):
case DPOT_UID(AD5247_ID):
@@ -427,7 +428,6 @@ static ssize_t sysfs_show_reg(struct device *dev,
test_bit(DPOT_RDAC_MASK & reg, data->otp_en_mask) ?
"enabled" : "disabled");
-
mutex_lock(&data->update_lock);
value = dpot_read(data, reg);
mutex_unlock(&data->update_lock);
@@ -763,7 +763,6 @@ int ad_dpot_remove(struct device *dev)
}
EXPORT_SYMBOL(ad_dpot_remove);
-
MODULE_AUTHOR("Chris Verges <chrisv@cyberswitching.com>, "
"Michael Hennerich <hennerich@blackfin.uclinux.org>");
MODULE_DESCRIPTION("Digital potentiometer driver");
This could be submitted with some commit message like:
Subject: [PATCH] ad525x_dpot: Add & remove blank lines
Use a more common kernel style.
Signed-off-by: <you>
cheers, Joe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-12-16 18:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-16 17:35 [PATCH 1/2] misc:ad525x_dpot: Fix missing blank after declaration coding style issue in ad525x_dpot.c Mohammad Jamal
2014-12-16 17:36 ` [PATCH 2/2] misc: ad52x_dpot: fix break is not useful after a goto or return " Mohammad Jamal
2014-12-16 18:00 ` [PATCH 1/2] misc:ad525x_dpot: Fix missing blank after declaration " Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®