linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: rts5208: Replace the occurrences of (1<<x) by BIT(x)
@ 2023-10-16 20:11 Nandha Kumar Singaram
  2023-10-17  4:02 ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Nandha Kumar Singaram @ 2023-10-16 20:11 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

Adhere to linux coding style. Reported by checkpatch.pl:
CHECK: Prefer using the BIT macro

Signed-off-by: Nandha Kumar Singaram <nandhakumar.singaram@gmail.com>
---
 drivers/staging/rts5208/rtsx_card.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx_card.h b/drivers/staging/rts5208/rtsx_card.h
index 39727371cd7a..9d2504fddb13 100644
--- a/drivers/staging/rts5208/rtsx_card.h
+++ b/drivers/staging/rts5208/rtsx_card.h
@@ -338,7 +338,7 @@
 #define DMA_DIR_FROM_CARD		0x02
 #define DMA_EN				0x01
 #define DMA_128				(0 << 4)
-#define DMA_256				(1 << 4)
+#define DMA_256				BIT(4)
 #define DMA_512				(2 << 4)
 #define DMA_1024			(3 << 4)
 #define DMA_PACK_SIZE_MASK		0x30
@@ -542,7 +542,7 @@
 
 #define BLINK_EN			0x08
 #define LED_GPIO0			(0 << 4)
-#define LED_GPIO1			(1 << 4)
+#define LED_GPIO1			BIT(4)
 #define LED_GPIO2			(2 << 4)
 
 #define SDIO_BUS_CTRL		0x01
-- 
2.25.1


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

* Re: [PATCH] staging: rts5208: Replace the occurrences of (1<<x) by BIT(x)
  2023-10-16 20:11 [PATCH] staging: rts5208: Replace the occurrences of (1<<x) by BIT(x) Nandha Kumar Singaram
@ 2023-10-17  4:02 ` Dan Carpenter
  2023-10-17  4:06   ` Dan Carpenter
  2023-10-17 14:14   ` Nandha Kumar Singaram
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2023-10-17  4:02 UTC (permalink / raw)
  To: Nandha Kumar Singaram; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel

On Mon, Oct 16, 2023 at 01:11:54PM -0700, Nandha Kumar Singaram wrote:
> Adhere to linux coding style. Reported by checkpatch.pl:
> CHECK: Prefer using the BIT macro
> 
> Signed-off-by: Nandha Kumar Singaram <nandhakumar.singaram@gmail.com>
> ---
>  drivers/staging/rts5208/rtsx_card.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rts5208/rtsx_card.h b/drivers/staging/rts5208/rtsx_card.h
> index 39727371cd7a..9d2504fddb13 100644
> --- a/drivers/staging/rts5208/rtsx_card.h
> +++ b/drivers/staging/rts5208/rtsx_card.h
> @@ -338,7 +338,7 @@
>  #define DMA_DIR_FROM_CARD		0x02
>  #define DMA_EN				0x01
>  #define DMA_128				(0 << 4)
> -#define DMA_256				(1 << 4)
> +#define DMA_256				BIT(4)
>  #define DMA_512				(2 << 4)

No.  :P.  Look at the lines around it.  Now it's the odd duckling.

>  #define DMA_1024			(3 << 4)
>  #define DMA_PACK_SIZE_MASK		0x30
> @@ -542,7 +542,7 @@
>  
>  #define BLINK_EN			0x08
>  #define LED_GPIO0			(0 << 4)
> -#define LED_GPIO1			(1 << 4)
> +#define LED_GPIO1			BIT(4)
>  #define LED_GPIO2			(2 << 4)
> 

Same.

regards,
dan carpenter


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

* Re: [PATCH] staging: rts5208: Replace the occurrences of (1<<x) by BIT(x)
  2023-10-17  4:02 ` Dan Carpenter
@ 2023-10-17  4:06   ` Dan Carpenter
  2023-10-17 14:02     ` Nandha Kumar Singaram
  2023-10-17 14:14   ` Nandha Kumar Singaram
  1 sibling, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2023-10-17  4:06 UTC (permalink / raw)
  To: Nandha Kumar Singaram; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel

Btw, eventually if we fix enough checkpatch warnings, then eventually we
get to a point where all the remaining warnings are wrong.  Like we've
fixed everything checkpatch gets correct and only wrong things are left.
So just be aware of that, that sometimes everything checkpatch suggests
is wrong.

regards,
dan carpenter


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

* Re: [PATCH] staging: rts5208: Replace the occurrences of (1<<x) by BIT(x)
  2023-10-17  4:06   ` Dan Carpenter
@ 2023-10-17 14:02     ` Nandha Kumar Singaram
  0 siblings, 0 replies; 5+ messages in thread
From: Nandha Kumar Singaram @ 2023-10-17 14:02 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel

On Tue, Oct 17, 2023 at 07:06:02AM +0300, Dan Carpenter wrote:
> Btw, eventually if we fix enough checkpatch warnings, then eventually we
> get to a point where all the remaining warnings are wrong.  Like we've
> fixed everything checkpatch gets correct and only wrong things are left.
> So just be aware of that, that sometimes everything checkpatch suggests
> is wrong.
> 
> regards,
> dan carpenter
> 

Thanks for the feedback dan.

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

* Re: [PATCH] staging: rts5208: Replace the occurrences of (1<<x) by BIT(x)
  2023-10-17  4:02 ` Dan Carpenter
  2023-10-17  4:06   ` Dan Carpenter
@ 2023-10-17 14:14   ` Nandha Kumar Singaram
  1 sibling, 0 replies; 5+ messages in thread
From: Nandha Kumar Singaram @ 2023-10-17 14:14 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel

On Tue, Oct 17, 2023 at 07:02:33AM +0300, Dan Carpenter wrote:
> On Mon, Oct 16, 2023 at 01:11:54PM -0700, Nandha Kumar Singaram wrote:
> > Adhere to linux coding style. Reported by checkpatch.pl:
> > CHECK: Prefer using the BIT macro
> > 
> > Signed-off-by: Nandha Kumar Singaram <nandhakumar.singaram@gmail.com>
> > ---
> >  drivers/staging/rts5208/rtsx_card.h | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/rts5208/rtsx_card.h b/drivers/staging/rts5208/rtsx_card.h
> > index 39727371cd7a..9d2504fddb13 100644
> > --- a/drivers/staging/rts5208/rtsx_card.h
> > +++ b/drivers/staging/rts5208/rtsx_card.h
> > @@ -338,7 +338,7 @@
> >  #define DMA_DIR_FROM_CARD		0x02
> >  #define DMA_EN				0x01
> >  #define DMA_128				(0 << 4)
> > -#define DMA_256				(1 << 4)
> > +#define DMA_256				BIT(4)
> >  #define DMA_512				(2 << 4)
> 
> No.  :P.  Look at the lines around it.  Now it's the odd duckling.
> 
> >  #define DMA_1024			(3 << 4)
> >  #define DMA_PACK_SIZE_MASK		0x30
> > @@ -542,7 +542,7 @@
> >  
> >  #define BLINK_EN			0x08
> >  #define LED_GPIO0			(0 << 4)
> > -#define LED_GPIO1			(1 << 4)
> > +#define LED_GPIO1			BIT(4)
> >  #define LED_GPIO2			(2 << 4)
> > 
> 
> Same.
> 
> regards,
> dan carpenter
>

Yeah, I understand now. Thanks for the review dan.

Regards,
Nandha Kumar Singaram

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

end of thread, other threads:[~2023-10-17 14:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-16 20:11 [PATCH] staging: rts5208: Replace the occurrences of (1<<x) by BIT(x) Nandha Kumar Singaram
2023-10-17  4:02 ` Dan Carpenter
2023-10-17  4:06   ` Dan Carpenter
2023-10-17 14:02     ` Nandha Kumar Singaram
2023-10-17 14:14   ` Nandha Kumar Singaram

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).