All of lore.kernel.org
 help / color / mirror / Atom feed
From: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
To: Jerome Pouiller <Jerome.Pouiller@silabs.com>
Cc: Jules Irenge <jbi.octave@gmail.com>,
	"outreachy-kernel@googlegroups.com"
	<outreachy-kernel@googlegroups.com>
Subject: Re: [PATCH 1/3] staging: wfx: replace uint32_t with u32
Date: Thu, 7 Nov 2019 16:05:42 +0100	[thread overview]
Message-ID: <20191107150542.GA154258@kroah.com> (raw)
In-Reply-To: <12394833.1gViOatCiM@pc-42>

On Wed, Nov 06, 2019 at 12:24:03PM +0000, Jerome Pouiller wrote:
> Hello Jules,
> 
> On Wednesday 6 November 2019 02:09:09 CET Jules Irenge wrote:
> > Replace kernel type uint32_t with u32.
> > As per recommendation of checkpatch tool.
> > 
> > Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
> > ---
> >  drivers/staging/wfx/bh.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
> > index 955ed3a1dd73..337af22b0150 100644
> > --- a/drivers/staging/wfx/bh.c
> > +++ b/drivers/staging/wfx/bh.c
> > @@ -239,7 +239,7 @@ static int bh_work_tx(struct wfx_dev *wdev, int max_msg)
> >   */
> >  static void ack_sdio_data(struct wfx_dev *wdev)
> >  {
> > -       uint32_t cfg_reg;
> > +       u32  cfg_reg;
> Why there are two spaces between u32 and cfg_reg?

Yes, that's not ok, I can't take this patch as-is for that reason alone.

> 
> > 
> >         config_reg_read(wdev, &cfg_reg);
> >         if (cfg_reg & 0xFF) {
> > --
> > 2.23.0
> 
> There are plenty of other occurrences of uintXX_t:
> 
>    $ git grep '\buint[0-9]*_t\b' drivers/staging/wfx | wc -l
>    628
> 
> Why do you solve this one particularly?
> 
> 
> In add, the driver use more often uintXX_t than uXX:
> 
>    $ git grep '\bu[0-9]\+\b' drivers/staging/wfx | wc -l  
>    171
> 
> In other parts of kernel, uintXX_t are not rare:
> 
>    $ git grep '\buint[0-9]*_t\b' | grep -v staging | wc -l 
>    94005
> 
> I have a slight preference for uintXX_t, because it is less specific to
> kernel (and because vim highlights uintXX_t but does not highlight uXX).

uintXX_t really doesn't make sense in the kernel, as the "namespace" is
wrong, but we tolerate it.  Ideally you will use the right types.

Also, use the vim-addon-linux-coding-style pluging, makes writing kernel
code using vim much easier.

thanks,

greg k-h


      reply	other threads:[~2019-11-07 15:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06  1:09 [PATCH 1/3] staging: wfx: replace uint32_t with u32 Jules Irenge
2019-11-06  1:09 ` [PATCH 2/3] staging: wfx: replace uint8_t with u8 Jules Irenge
2019-11-06  1:09 ` [PATCH 3/3] staging: wfx: remove space after a cast Jules Irenge
2019-11-06 12:24 ` [PATCH 1/3] staging: wfx: replace uint32_t with u32 Jerome Pouiller
2019-11-07 15:05   ` gregkh [this message]

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=20191107150542.GA154258@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Jerome.Pouiller@silabs.com \
    --cc=jbi.octave@gmail.com \
    --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 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.