public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Joe Perches <joe@perches.com>
Cc: Karolina Drobnik <karolinadrobnik@gmail.com>,
	outreachy-kernel@googlegroups.com, gregkh@linuxfoundation.org,
	forest@alittletooquiet.net, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [Outreachy kernel] Re: [PATCH] staging: vt6655: Rename `dwAL2230InitTable` array
Date: Wed, 20 Oct 2021 16:16:42 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2110201615590.2930@hadrien> (raw)
In-Reply-To: <157ee66fd0e3304c238e7ad8123277892e0d1132.camel@perches.com>



On Wed, 20 Oct 2021, Joe Perches wrote:

> On Wed, 2021-10-20 at 06:44 -0700, Joe Perches wrote:
> > trivial suggestion:
> >
> > > diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
> > []
> > > @@ -33,7 +33,7 @@
> > >  #define SWITCH_CHANNEL_DELAY_AL7230 200 /* us */
> > >  #define AL7230_PWR_IDX_LEN    64
> > >
> > > -static const unsigned long dwAL2230InitTable[CB_AL2230_INIT_SEQ] = {
> > > +static const unsigned long al2230_init_table[CB_AL2230_INIT_SEQ] = {
> > >  	0x03F79000 + (BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW,
> > >  	0x03333100 + (BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW,
> > >  	0x01A00200 + (BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW,
> >
> > In this file there are more than 100 uses of
> >
> > 	(BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW
> >
> > Maybe add a define for it and substitute the uses for the define.
>
> Look at the code too.
>
> It looks as if every use of IFRFbWriteEmbedded() has this added to
> the 2nd argument and that the 2nd argument isn't used anywhere else.
>
> Maybe remove it altogether and add it to IFRFbWriteEmbedded().
>
> And it looks as if the + uses for these should logically be |
>
> Something like:
>
> diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
> index 0dae593c6944f..26803f6f9a27b 100644
> --- a/drivers/staging/vt6655/rf.c
> +++ b/drivers/staging/vt6655/rf.c
> @@ -498,7 +498,8 @@ bool IFRFbWriteEmbedded(struct vnt_private *priv, unsigned long dwData)
>         unsigned short ww;
>         unsigned long dwValue;
>
> -       VNSvOutPortD(iobase + MAC_REG_IFREGCTL, dwData);
> +       VNSvOutPortD(iobase + MAC_REG_IFREGCTL,
> +                    dwData | (BY_AL2230_REG_LEN << 3) | IFREGCTL_REGW);
>
>         /* W_MAX_TIMEOUT is the timeout period */
>         for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {

Karolina,

If more than a hundred such changes are necessary, you may find Coccinelle
useful:  https://coccinelle.gitlabpages.inria.fr/website/

julia


>
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/157ee66fd0e3304c238e7ad8123277892e0d1132.camel%40perches.com.
>

  reply	other threads:[~2021-10-20 14:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 13:28 [PATCH] staging: vt6655: Rename `dwAL2230InitTable` array Karolina Drobnik
2021-10-20 13:44 ` Joe Perches
2021-10-20 14:09   ` Joe Perches
2021-10-20 14:16     ` Julia Lawall [this message]
2021-10-20 15:56       ` [Outreachy kernel] " Karolina Drobnik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.22.394.2110201615590.2930@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=forest@alittletooquiet.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=karolinadrobnik@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox