linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Staging: vt6655: Fix camel case of variable
@ 2018-12-29 22:59 Petr Sedlák
  2018-12-29 23:58 ` Joe Perches
  2019-01-02 11:07 ` Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Petr Sedlák @ 2018-12-29 22:59 UTC (permalink / raw)
  To: Forest Bond, Greg Kroah-Hartman, devel, linux-kernel

Replace variable uDelayUnit with u_delay_unit. Issue found by
checkpatch.

Signed-off-by: Petr Sedlák <hugosedlak@gmail.com>
---
 drivers/staging/vt6655/upc.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vt6655/upc.h b/drivers/staging/vt6655/upc.h
index 61b3e568ff9a..384af225336a 100644
--- a/drivers/staging/vt6655/upc.h
+++ b/drivers/staging/vt6655/upc.h
@@ -42,15 +42,15 @@
 #define VNSvOutPortD(dwIOAddress, dwData) \
 	iowrite32((u32)(dwData), dwIOAddress)
 
-#define PCAvDelayByIO(uDelayUnit)				\
+#define PCAvDelayByIO(u_delay_unit)				\
 do {								\
 	unsigned char byData;					\
 	unsigned long ii;					\
 								\
-	if (uDelayUnit <= 50) {					\
-		udelay(uDelayUnit);				\
+	if (u_delay_unit <= 50) {					\
+		udelay(u_delay_unit);				\
 	} else {						\
-		for (ii = 0; ii < (uDelayUnit); ii++)		\
+		for (ii = 0; ii < (u_delay_unit); ii++)		\
 			byData = inb(0x61);			\
 	}							\
 } while (0)
-- 
2.17.1


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

* Re: [PATCH] Staging: vt6655: Fix camel case of variable
  2018-12-29 22:59 [PATCH] Staging: vt6655: Fix camel case of variable Petr Sedlák
@ 2018-12-29 23:58 ` Joe Perches
  2019-01-02 11:07 ` Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2018-12-29 23:58 UTC (permalink / raw)
  To: Petr Sedlák, Forest Bond, Greg Kroah-Hartman, devel, linux-kernel

On Sat, 2018-12-29 at 23:59 +0100, Petr Sedlák wrote:
> Replace variable uDelayUnit with u_delay_unit. Issue found by
> checkpatch.

probably better as a static inline too.

> diff --git a/drivers/staging/vt6655/upc.h b/drivers/staging/vt6655/upc.h
[]
> @@ -42,15 +42,15 @@
>  #define VNSvOutPortD(dwIOAddress, dwData) \
>  	iowrite32((u32)(dwData), dwIOAddress)
>  
> -#define PCAvDelayByIO(uDelayUnit)				\
> +#define PCAvDelayByIO(u_delay_unit)				\
>  do {								\
>  	unsigned char byData;					\
>  	unsigned long ii;					\
>  								\
> -	if (uDelayUnit <= 50) {					\
> -		udelay(uDelayUnit);				\
> +	if (u_delay_unit <= 50) {					\
> +		udelay(u_delay_unit);				\
>  	} else {						\
> -		for (ii = 0; ii < (uDelayUnit); ii++)		\
> +		for (ii = 0; ii < (u_delay_unit); ii++)		\
>  			byData = inb(0x61);			\
>  	}							\
>  } while (0)

And as the thing is used only once with a #define
with a value less than 50, maybe just
	udelay(CB_DELAY_LOOP_WAIT);
in that one place.



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

* Re: [PATCH] Staging: vt6655: Fix camel case of variable
  2018-12-29 22:59 [PATCH] Staging: vt6655: Fix camel case of variable Petr Sedlák
  2018-12-29 23:58 ` Joe Perches
@ 2019-01-02 11:07 ` Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2019-01-02 11:07 UTC (permalink / raw)
  To: Petr Sedlák; +Cc: Forest Bond, Greg Kroah-Hartman, devel, linux-kernel

On Sat, Dec 29, 2018 at 11:59:52PM +0100, Petr Sedlák wrote:
> Replace variable uDelayUnit with u_delay_unit. Issue found by
> checkpatch.
> 
> Signed-off-by: Petr Sedlák <hugosedlak@gmail.com>
> ---
>  drivers/staging/vt6655/upc.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/vt6655/upc.h b/drivers/staging/vt6655/upc.h
> index 61b3e568ff9a..384af225336a 100644
> --- a/drivers/staging/vt6655/upc.h
> +++ b/drivers/staging/vt6655/upc.h
> @@ -42,15 +42,15 @@
>  #define VNSvOutPortD(dwIOAddress, dwData) \
>  	iowrite32((u32)(dwData), dwIOAddress)
>  
> -#define PCAvDelayByIO(uDelayUnit)				\
> +#define PCAvDelayByIO(u_delay_unit)				\
>  do {								\
>  	unsigned char byData;					\
>  	unsigned long ii;					\
>  								\
> -	if (uDelayUnit <= 50) {					\
> -		udelay(uDelayUnit);				\
> +	if (u_delay_unit <= 50) {					\
> +		udelay(u_delay_unit);				\
>  	} else {						\
> -		for (ii = 0; ii < (uDelayUnit); ii++)		\
> +		for (ii = 0; ii < (u_delay_unit); ii++)		\
>  			byData = inb(0x61);			\
>  	}							\
>  } while (0)


This is a hilariously awful macro.  It reads from a register usec number
of times to introduce a delay.  :P

Just delete it and fix the callers to use normal delay functions.

regards,
dan carpenter

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

end of thread, other threads:[~2019-01-02 11:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-29 22:59 [PATCH] Staging: vt6655: Fix camel case of variable Petr Sedlák
2018-12-29 23:58 ` Joe Perches
2019-01-02 11:07 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).