* [PATCH] staging: mt7621-dma: Prefer Using BIT Macro instead of left shifting on 1.
@ 2020-11-02 19:34 siddhant gupta(siddhant1223)
2020-11-02 19:40 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: siddhant gupta(siddhant1223) @ 2020-11-02 19:34 UTC (permalink / raw)
To: matthias.bgg
Cc: gregkh, devel, linux-arm-kernel, linux-mediatek, linux-kernel,
siddhantgupta416, mamatashukla555, himadrispandya
Replace left shifting on 1 by a BIT macro to fix checkpatch warning.
Signed-off-by: Siddhant Gupta <siddhantgupta416@gmail.com>
---
drivers/staging/mt7621-dma/mtk-hsdma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/mt7621-dma/mtk-hsdma.c b/drivers/staging/mt7621-dma/mtk-hsdma.c
index 354536783e1c..a9e1a1b14035 100644
--- a/drivers/staging/mt7621-dma/mtk-hsdma.c
+++ b/drivers/staging/mt7621-dma/mtk-hsdma.c
@@ -72,7 +72,7 @@
#define HSDMA_GLO_TX_DMA BIT(0)
#define HSDMA_BT_SIZE_16BYTES (0 << HSDMA_GLO_BT_SHIFT)
-#define HSDMA_BT_SIZE_32BYTES (1 << HSDMA_GLO_BT_SHIFT)
+#define HSDMA_BT_SIZE_32BYTES BIT(HSDMA_GLO_BT_SHIFT)
#define HSDMA_BT_SIZE_64BYTES (2 << HSDMA_GLO_BT_SHIFT)
#define HSDMA_BT_SIZE_128BYTES (3 << HSDMA_GLO_BT_SHIFT)
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: mt7621-dma: Prefer Using BIT Macro instead of left shifting on 1.
2020-11-02 19:34 [PATCH] staging: mt7621-dma: Prefer Using BIT Macro instead of left shifting on 1 siddhant gupta(siddhant1223)
@ 2020-11-02 19:40 ` Greg KH
2020-11-03 4:40 ` siddhant gupta
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2020-11-02 19:40 UTC (permalink / raw)
To: siddhant gupta(siddhant1223)
Cc: matthias.bgg, devel, linux-kernel, linux-mediatek,
mamatashukla555, linux-arm-kernel, himadrispandya
On Tue, Nov 03, 2020 at 01:04:02AM +0530, siddhant gupta(siddhant1223) wrote:
>
> Replace left shifting on 1 by a BIT macro to fix checkpatch warning.
>
> Signed-off-by: Siddhant Gupta <siddhantgupta416@gmail.com>
>
> ---
> drivers/staging/mt7621-dma/mtk-hsdma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/mt7621-dma/mtk-hsdma.c b/drivers/staging/mt7621-dma/mtk-hsdma.c
> index 354536783e1c..a9e1a1b14035 100644
> --- a/drivers/staging/mt7621-dma/mtk-hsdma.c
> +++ b/drivers/staging/mt7621-dma/mtk-hsdma.c
> @@ -72,7 +72,7 @@
> #define HSDMA_GLO_TX_DMA BIT(0)
>
> #define HSDMA_BT_SIZE_16BYTES (0 << HSDMA_GLO_BT_SHIFT)
> -#define HSDMA_BT_SIZE_32BYTES (1 << HSDMA_GLO_BT_SHIFT)
> +#define HSDMA_BT_SIZE_32BYTES BIT(HSDMA_GLO_BT_SHIFT)
> #define HSDMA_BT_SIZE_64BYTES (2 << HSDMA_GLO_BT_SHIFT)
> #define HSDMA_BT_SIZE_128BYTES (3 << HSDMA_GLO_BT_SHIFT)
In looking at the code, does this change really make sense?
(hint, I don't think so...)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: mt7621-dma: Prefer Using BIT Macro instead of left shifting on 1.
2020-11-02 19:40 ` Greg KH
@ 2020-11-03 4:40 ` siddhant gupta
0 siblings, 0 replies; 3+ messages in thread
From: siddhant gupta @ 2020-11-03 4:40 UTC (permalink / raw)
To: Greg KH
Cc: matthias.bgg, devel, linux-kernel, linux-mediatek,
linux-arm-kernel, Himadri Pandya, Mamta Shukla
On Tue, 3 Nov 2020 at 01:10, Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Tue, Nov 03, 2020 at 01:04:02AM +0530, siddhant gupta(siddhant1223) wrote:
> >
> > Replace left shifting on 1 by a BIT macro to fix checkpatch warning.
> >
> > Signed-off-by: Siddhant Gupta <siddhantgupta416@gmail.com>
> >
> > ---
> > drivers/staging/mt7621-dma/mtk-hsdma.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/mt7621-dma/mtk-hsdma.c b/drivers/staging/mt7621-dma/mtk-hsdma.c
> > index 354536783e1c..a9e1a1b14035 100644
> > --- a/drivers/staging/mt7621-dma/mtk-hsdma.c
> > +++ b/drivers/staging/mt7621-dma/mtk-hsdma.c
> > @@ -72,7 +72,7 @@
> > #define HSDMA_GLO_TX_DMA BIT(0)
> >
> > #define HSDMA_BT_SIZE_16BYTES (0 << HSDMA_GLO_BT_SHIFT)
> > -#define HSDMA_BT_SIZE_32BYTES (1 << HSDMA_GLO_BT_SHIFT)
> > +#define HSDMA_BT_SIZE_32BYTES BIT(HSDMA_GLO_BT_SHIFT)
> > #define HSDMA_BT_SIZE_64BYTES (2 << HSDMA_GLO_BT_SHIFT)
> > #define HSDMA_BT_SIZE_128BYTES (3 << HSDMA_GLO_BT_SHIFT)
>
> In looking at the code, does this change really make sense?
>
> (hint, I don't think so...)
Following Checkpatch, I thought it might be good to do as checkpatch said,
but the code looks better and more readable without the change. This
is my first patch and also a
lesson that i should not fix every checkpatch warnings. I'll pick
something better next time
Thanks for your comment
.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-03 4:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 19:34 [PATCH] staging: mt7621-dma: Prefer Using BIT Macro instead of left shifting on 1 siddhant gupta(siddhant1223)
2020-11-02 19:40 ` Greg KH
2020-11-03 4:40 ` siddhant gupta
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).