All of lore.kernel.org
 help / color / mirror / Atom feed
* [Outreachy Kernel][PATCH]staging:mt7621-mmc: Prefer using BIT macro
@ 2019-02-19  6:38 Bhanusree Pola
  2019-02-19 15:31 ` Matthias Brugger
  2019-02-19 15:56 ` [Outreachy kernel] " Himanshu Jha
  0 siblings, 2 replies; 5+ messages in thread
From: Bhanusree Pola @ 2019-02-19  6:38 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Greg Kroah-Hartman, Matthias Brugger

Use BIT(x) instead of (1<<x), reported by checkpatch.pl.

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
---
 drivers/staging/mt7621-mmc/mt6575_sd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/mt7621-mmc/mt6575_sd.h b/drivers/staging/mt7621-mmc/mt6575_sd.h
index 4e287c140acb..038a484a9476 100644
--- a/drivers/staging/mt7621-mmc/mt6575_sd.h
+++ b/drivers/staging/mt7621-mmc/mt6575_sd.h
@@ -363,7 +363,7 @@ enum {
 #define MSDC_CKGEN_MSDC_DLY_SEL   (0x1F << 10)
 #define MSDC_INT_DAT_LATCH_CK_SEL  (0x7 << 7)
 #define MSDC_CKGEN_MSDC_CK_SEL     (0x1 << 6)
-#define CARD_READY_FOR_DATA             (1 << 8)
+#define CARD_READY_FOR_DATA		BIT(8)
 #define CARD_CURRENT_STATE(x)           ((x & 0x00001E00) >> 9)
 
 /*--------------------------------------------------------------------------*/
-- 
2.17.1



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

* Re: [Outreachy Kernel][PATCH]staging:mt7621-mmc: Prefer using BIT macro
  2019-02-19  6:38 [Outreachy Kernel][PATCH]staging:mt7621-mmc: Prefer using BIT macro Bhanusree Pola
@ 2019-02-19 15:31 ` Matthias Brugger
  2019-02-19 15:42   ` [Outreachy kernel] " Julia Lawall
  2019-02-19 15:56 ` [Outreachy kernel] " Himanshu Jha
  1 sibling, 1 reply; 5+ messages in thread
From: Matthias Brugger @ 2019-02-19 15:31 UTC (permalink / raw)
  To: Bhanusree Pola, outreachy-kernel; +Cc: Greg Kroah-Hartman



On 19/02/2019 07:38, Bhanusree Pola wrote:
> Use BIT(x) instead of (1<<x), reported by checkpatch.pl.
> 
> Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
> ---
>  drivers/staging/mt7621-mmc/mt6575_sd.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/mt7621-mmc/mt6575_sd.h b/drivers/staging/mt7621-mmc/mt6575_sd.h
> index 4e287c140acb..038a484a9476 100644
> --- a/drivers/staging/mt7621-mmc/mt6575_sd.h
> +++ b/drivers/staging/mt7621-mmc/mt6575_sd.h
> @@ -363,7 +363,7 @@ enum {
>  #define MSDC_CKGEN_MSDC_DLY_SEL   (0x1F << 10)
>  #define MSDC_INT_DAT_LATCH_CK_SEL  (0x7 << 7)
>  #define MSDC_CKGEN_MSDC_CK_SEL     (0x1 << 6)
> -#define CARD_READY_FOR_DATA             (1 << 8)
> +#define CARD_READY_FOR_DATA		BIT(8)

To be honest, I'm not sure if this is the right thing to do here, given that all
other defines use the shift operator.

Apart from that git grep tells me that CARD_READY_FOR_DATA is not used in the
driver. Maybe that would be a better first patch: check if the defines are used
in the driver and delete all these that are not used :)

Regards,
Matthias

>  #define CARD_CURRENT_STATE(x)           ((x & 0x00001E00) >> 9)
>  
>  /*--------------------------------------------------------------------------*/
> 


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

* Re: [Outreachy kernel] Re: [Outreachy Kernel][PATCH]staging:mt7621-mmc: Prefer using BIT macro
  2019-02-19 15:31 ` Matthias Brugger
@ 2019-02-19 15:42   ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2019-02-19 15:42 UTC (permalink / raw)
  To: Matthias Brugger; +Cc: Bhanusree Pola, outreachy-kernel, Greg Kroah-Hartman



On Tue, 19 Feb 2019, Matthias Brugger wrote:

>
>
> On 19/02/2019 07:38, Bhanusree Pola wrote:
> > Use BIT(x) instead of (1<<x), reported by checkpatch.pl.
> >
> > Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
> > ---
> >  drivers/staging/mt7621-mmc/mt6575_sd.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/mt7621-mmc/mt6575_sd.h b/drivers/staging/mt7621-mmc/mt6575_sd.h
> > index 4e287c140acb..038a484a9476 100644
> > --- a/drivers/staging/mt7621-mmc/mt6575_sd.h
> > +++ b/drivers/staging/mt7621-mmc/mt6575_sd.h
> > @@ -363,7 +363,7 @@ enum {
> >  #define MSDC_CKGEN_MSDC_DLY_SEL   (0x1F << 10)
> >  #define MSDC_INT_DAT_LATCH_CK_SEL  (0x7 << 7)
> >  #define MSDC_CKGEN_MSDC_CK_SEL     (0x1 << 6)
> > -#define CARD_READY_FOR_DATA             (1 << 8)
> > +#define CARD_READY_FOR_DATA		BIT(8)
>
> To be honest, I'm not sure if this is the right thing to do here, given that all
> other defines use the shift operator.
>
> Apart from that git grep tells me that CARD_READY_FOR_DATA is not used in the
> driver. Maybe that would be a better first patch: check if the defines are used
> in the driver and delete all these that are not used :)

I think that Greg has expressed the desire to keep them in the past, but
perhaps that was only for names that fit into a series, eg 1 << 0, 1 << 1,
1 << 2, etc.  This one seems different from the ones defined nearby it at
least.

julia

>
> Regards,
> Matthias
>
> >  #define CARD_CURRENT_STATE(x)           ((x & 0x00001E00) >> 9)
> >
> >  /*--------------------------------------------------------------------------*/
> >
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/3d66e3f3-74d3-2da7-57cb-8b04427ae680%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [Outreachy kernel] [Outreachy Kernel][PATCH]staging:mt7621-mmc: Prefer using BIT macro
  2019-02-19  6:38 [Outreachy Kernel][PATCH]staging:mt7621-mmc: Prefer using BIT macro Bhanusree Pola
  2019-02-19 15:31 ` Matthias Brugger
@ 2019-02-19 15:56 ` Himanshu Jha
  2019-02-20 10:24   ` Greg Kroah-Hartman
  1 sibling, 1 reply; 5+ messages in thread
From: Himanshu Jha @ 2019-02-19 15:56 UTC (permalink / raw)
  To: Bhanusree Pola, Greg Kroah-Hartman; +Cc: outreachy-kernel, Matthias Brugger

On Tue, Feb 19, 2019 at 12:08:48PM +0530, Bhanusree Pola wrote:
> Use BIT(x) instead of (1<<x), reported by checkpatch.pl.
> 
> Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
> ---
>  drivers/staging/mt7621-mmc/mt6575_sd.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/mt7621-mmc/mt6575_sd.h b/drivers/staging/mt7621-mmc/mt6575_sd.h
> index 4e287c140acb..038a484a9476 100644
> --- a/drivers/staging/mt7621-mmc/mt6575_sd.h
> +++ b/drivers/staging/mt7621-mmc/mt6575_sd.h
> @@ -363,7 +363,7 @@ enum {
>  #define MSDC_CKGEN_MSDC_DLY_SEL   (0x1F << 10)
>  #define MSDC_INT_DAT_LATCH_CK_SEL  (0x7 << 7)
>  #define MSDC_CKGEN_MSDC_CK_SEL     (0x1 << 6)

This could also be changed as well ?
Likewise others present(if any) in the header file.

FYI, a simple cocci script could also be written to complete
this task.

Now that I see this patch has been already been applied, so
its fine for now and an explicit "Patch applied." from Greg
would have been better IMHO.

Times up for Ack-by and discussions Matthias.

> -#define CARD_READY_FOR_DATA             (1 << 8)
> +#define CARD_READY_FOR_DATA		BIT(8)
>  #define CARD_CURRENT_STATE(x)           ((x & 0x00001E00) >> 9)


-- 
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology


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

* Re: [Outreachy kernel] [Outreachy Kernel][PATCH]staging:mt7621-mmc: Prefer using BIT macro
  2019-02-19 15:56 ` [Outreachy kernel] " Himanshu Jha
@ 2019-02-20 10:24   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2019-02-20 10:24 UTC (permalink / raw)
  To: Himanshu Jha; +Cc: Bhanusree Pola, outreachy-kernel, Matthias Brugger

On Tue, Feb 19, 2019 at 09:26:36PM +0530, Himanshu Jha wrote:
> 
> Now that I see this patch has been already been applied, so
> its fine for now and an explicit "Patch applied." from Greg
> would have been better IMHO.

Patch authors get that type of email from my scripts, I do not send them
to the mailing lists as it would just be too noisy.

thanks,

greg k-h


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

end of thread, other threads:[~2019-02-20 10:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-19  6:38 [Outreachy Kernel][PATCH]staging:mt7621-mmc: Prefer using BIT macro Bhanusree Pola
2019-02-19 15:31 ` Matthias Brugger
2019-02-19 15:42   ` [Outreachy kernel] " Julia Lawall
2019-02-19 15:56 ` [Outreachy kernel] " Himanshu Jha
2019-02-20 10:24   ` Greg Kroah-Hartman

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.