lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VeTcEiQQA24+wk7Sq0seKcZfJ07J9m-8d9-aKcnNxkFnQ@mail.gmail.com>
Date:   Wed, 13 Jul 2022 13:29:13 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Kent Gibson <warthog618@...il.com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        Linus Walleij <linus.walleij@...aro.org>,
        Dipen Patel <dipenp@...dia.com>
Subject: Re: [PATCH 5/6] gpiolib: cdev: consolidate edge detector
 configuration flags

On Wed, Jul 13, 2022 at 12:25 PM Kent Gibson <warthog618@...il.com> wrote:
> On Wed, Jul 13, 2022 at 12:07:29PM +0200, Andy Shevchenko wrote:
> > On Wed, Jul 13, 2022 at 3:39 AM Kent Gibson <warthog618@...il.com> wrote:

...

> > >         struct linereq *lr;
> > >         struct gpio_v2_line_event le;
> > >         int level;
> > > -       u64 eflags;
> > > +       u64 edflags;
> >
> > I would at the same time move it up before `int level;`.
>
> Ok.  What is the general rule you want applied, cos I'm not seeing it.

Common sense.
But here are two informal recommendations:
1) longer line first;
2) you may still group by struct, POD or other flavours (see below).

...

> > > +       int level = -1, diff_seqno;
> > > +       u64 eflags, edflags = READ_ONCE(line->edflags);
> >
> > Ditto.

Here is obviously the longer line case.

...

> > >         u32 debounce_period_us;
> > >         unsigned long irqflags = 0;
> > >         int irq, ret;
> > > +       u64 eflags;
> >
> > Ditto for similarity.

Here and in other cases above, swapping them won't interleave the
types grouping (like int-u64-int). But in some cases it's allowed when
you put the last definition in the block the definition of the
variable that keeps the returned value.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ