All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] misc: ad525x_dpot: Different type of warnings are resolved.
@ 2017-12-08  8:13 Dhaval Shah
  2017-12-08  8:13 ` [PATCH 1/3] misc: ad525x_dpot: Prefer 'unsigned int' to bare use of 'unsigned' Dhaval Shah
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dhaval Shah @ 2017-12-08  8:13 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: linux-kernel, Dhaval Shah

Three types of checkpatch warning are resolved.
 * First patch  : Prefer 'unsigned int' to bare use of 'unsigned'
 * Second patch : please, no space before tabs
 * third patch  : macros should not use a trailing semicolon

Issue found by checkpatch.
./scripts/checkpatch.pl -f --strict drivers/misc/ad525x_dpot.c 

Dhaval Shah (3):
  misc: ad525x_dpot: Prefer 'unsigned int' to bare use of 'unsigned'
  misc: ad525x_dpot: please, no space before tabs
  misc: ad525x_dpot: macros should not use a trailing semicolon

 drivers/misc/ad525x_dpot.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] misc: ad525x_dpot: Prefer 'unsigned int' to bare use of 'unsigned'
  2017-12-08  8:13 [PATCH 0/3] misc: ad525x_dpot: Different type of warnings are resolved Dhaval Shah
@ 2017-12-08  8:13 ` Dhaval Shah
  2017-12-08  8:13 ` [PATCH 2/3] misc: ad525x_dpot: please, no space before tabs Dhaval Shah
  2017-12-08  8:13 ` [PATCH 3/3] misc: ad525x_dpot: macros should not use a trailing semicolon Dhaval Shah
  2 siblings, 0 replies; 6+ messages in thread
From: Dhaval Shah @ 2017-12-08  8:13 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: linux-kernel, Dhaval Shah

Resolved all the Prefer 'unsigned int' to bare use of 'unsigned'
checkpatch warnings. Issue found by checkpatch.

Signed-off-by: Dhaval Shah <dhaval.shah@softnautics.com>
---
 drivers/misc/ad525x_dpot.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
index fe1672747bc1..1c6b55655f52 100644
--- a/drivers/misc/ad525x_dpot.c
+++ b/drivers/misc/ad525x_dpot.c
@@ -84,12 +84,12 @@
 struct dpot_data {
 	struct ad_dpot_bus_data	bdata;
 	struct mutex update_lock;
-	unsigned rdac_mask;
-	unsigned max_pos;
+	unsigned int rdac_mask;
+	unsigned int max_pos;
 	unsigned long devid;
-	unsigned uid;
-	unsigned feat;
-	unsigned wipers;
+	unsigned int uid;
+	unsigned int feat;
+	unsigned int wipers;
 	u16 rdac_cache[MAX_RDACS];
 	DECLARE_BITMAP(otp_en_mask, MAX_RDACS);
 };
@@ -126,7 +126,7 @@ static inline int dpot_write_r8d16(struct dpot_data *dpot, u8 reg, u16 val)
 
 static s32 dpot_read_spi(struct dpot_data *dpot, u8 reg)
 {
-	unsigned ctrl = 0;
+	unsigned int ctrl = 0;
 	int value;
 
 	if (!(reg & (DPOT_ADDR_EEPROM | DPOT_ADDR_CMD))) {
@@ -175,7 +175,7 @@ static s32 dpot_read_spi(struct dpot_data *dpot, u8 reg)
 static s32 dpot_read_i2c(struct dpot_data *dpot, u8 reg)
 {
 	int value;
-	unsigned ctrl = 0;
+	unsigned int ctrl = 0;
 
 	switch (dpot->uid) {
 	case DPOT_UID(AD5246_ID):
@@ -238,7 +238,7 @@ static s32 dpot_read(struct dpot_data *dpot, u8 reg)
 
 static s32 dpot_write_spi(struct dpot_data *dpot, u8 reg, u16 value)
 {
-	unsigned val = 0;
+	unsigned int val = 0;
 
 	if (!(reg & (DPOT_ADDR_EEPROM | DPOT_ADDR_CMD | DPOT_ADDR_OTP))) {
 		if (dpot->feat & F_RDACS_WONLY)
@@ -328,7 +328,7 @@ static s32 dpot_write_spi(struct dpot_data *dpot, u8 reg, u16 value)
 static s32 dpot_write_i2c(struct dpot_data *dpot, u8 reg, u16 value)
 {
 	/* Only write the instruction byte for certain commands */
-	unsigned tmp = 0, ctrl = 0;
+	unsigned int tmp = 0, ctrl = 0;
 
 	switch (dpot->uid) {
 	case DPOT_UID(AD5246_ID):
@@ -636,7 +636,7 @@ static const struct attribute_group ad525x_group_commands = {
 };
 
 static int ad_dpot_add_files(struct device *dev,
-		unsigned features, unsigned rdac)
+		unsigned int features, unsigned int rdac)
 {
 	int err = sysfs_create_file(&dev->kobj,
 		dpot_attrib_wipers[rdac]);
@@ -661,7 +661,7 @@ static int ad_dpot_add_files(struct device *dev,
 }
 
 static inline void ad_dpot_remove_files(struct device *dev,
-		unsigned features, unsigned rdac)
+		unsigned int features, unsigned int rdac)
 {
 	sysfs_remove_file(&dev->kobj,
 		dpot_attrib_wipers[rdac]);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] misc: ad525x_dpot: please, no space before tabs
  2017-12-08  8:13 [PATCH 0/3] misc: ad525x_dpot: Different type of warnings are resolved Dhaval Shah
  2017-12-08  8:13 ` [PATCH 1/3] misc: ad525x_dpot: Prefer 'unsigned int' to bare use of 'unsigned' Dhaval Shah
@ 2017-12-08  8:13 ` Dhaval Shah
  2017-12-08  8:13 ` [PATCH 3/3] misc: ad525x_dpot: macros should not use a trailing semicolon Dhaval Shah
  2 siblings, 0 replies; 6+ messages in thread
From: Dhaval Shah @ 2017-12-08  8:13 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: linux-kernel, Dhaval Shah

Resolved the please, no space beofore tabs checkpatch
warning. Issue found by checkpatch.

Signed-off-by: Dhaval Shah <dhaval.shah@softnautics.com>
---
 drivers/misc/ad525x_dpot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
index 1c6b55655f52..577f5e76c8a8 100644
--- a/drivers/misc/ad525x_dpot.c
+++ b/drivers/misc/ad525x_dpot.c
@@ -3,7 +3,7 @@
  * Copyright (c) 2009-2010 Analog Devices, Inc.
  * Author: Michael Hennerich <hennerich@blackfin.uclinux.org>
  *
- * DEVID		#Wipers		#Positions 	Resistor Options (kOhm)
+ * DEVID		#Wipers		#Positions	Resistor Options (kOhm)
  * AD5258		1		64		1, 10, 50, 100
  * AD5259		1		256		5, 10, 50, 100
  * AD5251		2		64		1, 10, 50, 100
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] misc: ad525x_dpot: macros should not use a trailing semicolon
  2017-12-08  8:13 [PATCH 0/3] misc: ad525x_dpot: Different type of warnings are resolved Dhaval Shah
  2017-12-08  8:13 ` [PATCH 1/3] misc: ad525x_dpot: Prefer 'unsigned int' to bare use of 'unsigned' Dhaval Shah
  2017-12-08  8:13 ` [PATCH 2/3] misc: ad525x_dpot: please, no space before tabs Dhaval Shah
@ 2017-12-08  8:13 ` Dhaval Shah
  2017-12-18 15:02   ` Greg KH
  2 siblings, 1 reply; 6+ messages in thread
From: Dhaval Shah @ 2017-12-08  8:13 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: linux-kernel, Dhaval Shah

Resolved all the macros should not use a trailing semicolon
checkpatch warnings. Issue found by checkpatch.

Signed-off-by: Dhaval Shah <dhaval.shah@softnautics.com>
---
 drivers/misc/ad525x_dpot.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
index 577f5e76c8a8..bc591b7168db 100644
--- a/drivers/misc/ad525x_dpot.c
+++ b/drivers/misc/ad525x_dpot.c
@@ -515,11 +515,11 @@ set_##_name(struct device *dev, \
 #define DPOT_DEVICE_SHOW_SET(name, reg) \
 DPOT_DEVICE_SHOW(name, reg) \
 DPOT_DEVICE_SET(name, reg) \
-static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, set_##name);
+static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, set_##name)
 
 #define DPOT_DEVICE_SHOW_ONLY(name, reg) \
 DPOT_DEVICE_SHOW(name, reg) \
-static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, NULL);
+static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, NULL)
 
 DPOT_DEVICE_SHOW_SET(rdac0, DPOT_ADDR_RDAC | DPOT_RDAC0);
 DPOT_DEVICE_SHOW_SET(eeprom0, DPOT_ADDR_EEPROM | DPOT_RDAC0);
@@ -616,7 +616,7 @@ set_##_name(struct device *dev, \
 { \
 	return sysfs_do_cmd(dev, attr, buf, count, _cmd); \
 } \
-static DEVICE_ATTR(_name, S_IWUSR | S_IRUGO, NULL, set_##_name);
+static DEVICE_ATTR(_name, S_IWUSR | S_IRUGO, NULL, set_##_name)
 
 DPOT_DEVICE_DO_CMD(inc_all, DPOT_INC_ALL);
 DPOT_DEVICE_DO_CMD(dec_all, DPOT_DEC_ALL);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] misc: ad525x_dpot: macros should not use a trailing semicolon
  2017-12-08  8:13 ` [PATCH 3/3] misc: ad525x_dpot: macros should not use a trailing semicolon Dhaval Shah
@ 2017-12-18 15:02   ` Greg KH
  2017-12-19  5:18     ` Dhaval Shah
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2017-12-18 15:02 UTC (permalink / raw)
  To: Dhaval Shah; +Cc: arnd, linux-kernel

On Fri, Dec 08, 2017 at 01:43:05PM +0530, Dhaval Shah wrote:
> Resolved all the macros should not use a trailing semicolon
> checkpatch warnings. Issue found by checkpatch.
> 
> Signed-off-by: Dhaval Shah <dhaval.shah@softnautics.com>
> ---
>  drivers/misc/ad525x_dpot.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
> index 577f5e76c8a8..bc591b7168db 100644
> --- a/drivers/misc/ad525x_dpot.c
> +++ b/drivers/misc/ad525x_dpot.c
> @@ -515,11 +515,11 @@ set_##_name(struct device *dev, \
>  #define DPOT_DEVICE_SHOW_SET(name, reg) \
>  DPOT_DEVICE_SHOW(name, reg) \
>  DPOT_DEVICE_SET(name, reg) \
> -static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, set_##name);
> +static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, set_##name)

This should be using DEVICE_ATTR_RW() instead of DEVICE_ATTR(), care to
fix that up in a follow-on patch for this driver?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] misc: ad525x_dpot: macros should not use a trailing semicolon
  2017-12-18 15:02   ` Greg KH
@ 2017-12-19  5:18     ` Dhaval Shah
  0 siblings, 0 replies; 6+ messages in thread
From: Dhaval Shah @ 2017-12-19  5:18 UTC (permalink / raw)
  To: Greg KH; +Cc: arnd@arndb.de, linux-kernel@vger.kernel.org

Hi Greg k-h,

________________________________________
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: Monday, December 18, 2017 8:32 PM
> To: Dhaval Shah
> Cc: arnd@arndb.de; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 3/3] misc: ad525x_dpot: macros should not use a trailing semicolon
> 
> On Fri, Dec 08, 2017 at 01:43:05PM +0530, Dhaval Shah wrote:
> > Resolved all the macros should not use a trailing semicolon
> > checkpatch warnings. Issue found by checkpatch.
> >
> > Signed-off-by: Dhaval Shah <dhaval.shah@softnautics.com>
> > ---
> >  drivers/misc/ad525x_dpot.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
> > index 577f5e76c8a8..bc591b7168db 100644
> > --- a/drivers/misc/ad525x_dpot.c
> > +++ b/drivers/misc/ad525x_dpot.c
> > @@ -515,11 +515,11 @@ set_##_name(struct device *dev, \
> >  #define DPOT_DEVICE_SHOW_SET(name, reg) \
> >  DPOT_DEVICE_SHOW(name, reg) \
> >  DPOT_DEVICE_SET(name, reg) \
> > -static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, set_##name);
> > +static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, set_##name)
> 
> This should be using DEVICE_ATTR_RW() instead of DEVICE_ATTR(), care to
> fix that up in a follow-on patch for this driver?
> 
Sure. I will update this change in follow-on patch for this driver once this patch set merged.

Thanks,
Dhaval
> thanks,
> 
> greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-19  5:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-08  8:13 [PATCH 0/3] misc: ad525x_dpot: Different type of warnings are resolved Dhaval Shah
2017-12-08  8:13 ` [PATCH 1/3] misc: ad525x_dpot: Prefer 'unsigned int' to bare use of 'unsigned' Dhaval Shah
2017-12-08  8:13 ` [PATCH 2/3] misc: ad525x_dpot: please, no space before tabs Dhaval Shah
2017-12-08  8:13 ` [PATCH 3/3] misc: ad525x_dpot: macros should not use a trailing semicolon Dhaval Shah
2017-12-18 15:02   ` Greg KH
2017-12-19  5:18     ` Dhaval Shah

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.