linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Manikishan Ghantasala' <manikishanghantasala@gmail.com>,
	Alex Elder <elder@ieee.org>
Cc: Rui Miguel Silva <rmfrfs@gmail.com>,
	Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"greybus-dev@lists.linaro.org" <greybus-dev@lists.linaro.org>,
	"linux-staging@lists.linux.dev" <linux-staging@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] staging: greybus: fixed the coding style, labels should not be indented.
Date: Thu, 3 Jun 2021 21:22:44 +0000	[thread overview]
Message-ID: <792dd57c0ef8454497e5ae4c4534dea2@AcuMS.aculab.com> (raw)
In-Reply-To: <CAKzJ-FNW8EPX2oQd1qr5NagnvjtWwvSeuAh8DNLetj11+BJ6RA@mail.gmail.com>

From: Manikishan Ghantasala
> Sent: 02 June 2021 15:28
> 
> I agree those are called bit-field member names rather than labels.
> But the reason I mentioned is because the ./scripts/checkpatch.pl
> gave out a warning saying "labels should not be indented".
> 
> Sorry for the confusion in the name I referred to. So, I think this
> change is needed as I feel this is not following the coding-style by
> having indent before the width for bit field member. I went through
> other places in source code to make sure this is correct, and sent the
> patch after confirmation.
> 
> Regards,
> Manikishan Ghantasala
> 
> On Wed, 2 Jun 2021 at 19:13, Alex Elder <elder@ieee.org> wrote:
> >
> > On 6/2/21 8:36 AM, sh4nnu wrote:
> > > From: Manikishan Ghantasala <manikishanghantasala@gmail.com>
> > >
> > > staging: greybus: gpio.c: Clear coding-style problem
> > > "labels should not be indented" by removing indentation.
> >
> > These are not labels.
> >
> > I don't really understand what you're doing here.
> >
> > Can you please explain why you think this needs changing?
> >
> >                                         -Alex
> >
> > > Signed-off-by: Manikishan Ghantasala <manikishanghantasala@gmail.com>
> > > ---
> > >   drivers/staging/greybus/gpio.c | 6 +++---
> > >   1 file changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c
> > > index 7e6347fe93f9..4661f4a251bd 100644
> > > --- a/drivers/staging/greybus/gpio.c
> > > +++ b/drivers/staging/greybus/gpio.c
> > > @@ -20,9 +20,9 @@
> > >   struct gb_gpio_line {
> > >       /* The following has to be an array of line_max entries */
> > >       /* --> make them just a flags field */
> > > -     u8                      active:    1,
> > > -                             direction: 1,   /* 0 = output, 1 = input */
> > > -                             value:     1;   /* 0 = low, 1 = high */
> > > +     u8                      active:1,
> > > +                             direction:1,    /* 0 = output, 1 = input */
> > > +                             value:1;        /* 0 = low, 1 = high */

Why are you even using bitfields at all?
If you cared about the structure size you'd not have a byte-size pad here.

Since I doubt many copies of this structure get allocated the
(typical) increase in code size for the bitfields will also
exceed any size saving.

Isn't the kernel style also to repeat the type for every field?

	David


> > >       u16                     debounce_usec;
> > >
> > >       u8                      irq_type;
> > >
> >

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

  parent reply	other threads:[~2021-06-03 21:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02 13:36 [PATCH] staging: greybus: fixed the coding style, labels should not be indented sh4nnu
2021-06-02 13:43 ` Alex Elder
2021-06-02 14:27   ` Manikishan Ghantasala
2021-06-02 14:37     ` Greg Kroah-Hartman
2021-06-02 14:39       ` Manikishan Ghantasala
2021-06-02 17:26       ` [PATCH] checkpatch: Improve the indented label test Joe Perches
2021-06-02 14:38     ` [PATCH] staging: greybus: fixed the coding style, labels should not be indented Alex Elder
2021-06-03 21:22     ` David Laight [this message]
2021-06-03 21:45       ` [greybus-dev] " Alex Elder
2021-06-03 21:48         ` David Laight
2021-06-03 21:55           ` Alex Elder
2021-06-04  8:13             ` David Laight
2021-06-04  8:26               ` Joe Perches
2021-06-04  8:33                 ` David Laight
2021-06-04 12:34               ` Alex Elder

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=792dd57c0ef8454497e5ae4c4534dea2@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=elder@ieee.org \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=manikishanghantasala@gmail.com \
    --cc=rmfrfs@gmail.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;
as well as URLs for NNTP newsgroup(s).