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] [day] [month] [year] [list]
Message-ID: <CAHp75VcrHMnzi7F5kzFeHOGt47Jbq=fSsSun0s+=01o9HMMf5g@mail.gmail.com>
Date: Wed, 14 Jan 2026 09:51:52 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Tomas Melin <tomas.melin@...sala.com>
Cc: Andy Shevchenko <andriy.shevchenko@...el.com>, 
	Michael Hennerich <Michael.Hennerich@...log.com>, Nuno Sa <nuno.sa@...log.com>, 
	Lars-Peter Clausen <lars@...afoo.de>, Jonathan Cameron <jic23@...nel.org>, 
	David Lechner <dlechner@...libre.com>, Andy Shevchenko <andy@...nel.org>, 
	Olivier Moysan <olivier.moysan@...s.st.com>, linux-iio@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/3] iio: industrialio-backend: support backend capabilities

On Wed, Jan 14, 2026 at 9:39 AM Tomas Melin <tomas.melin@...sala.com> wrote:
> On 13/01/2026 23:06, Andy Shevchenko wrote:
> > On Tue, Jan 13, 2026 at 12:12:48PM +0000, Tomas Melin wrote:

...

> >> struct iio_backend {
> >
> >>      u8 idx;
> >> +    u32 caps;
> >
> > Please, run `pahole` to see if there is a better place for a new member.
> > (I bet there is.)
> Indeed, there seems to be. Thanks for the suggestion, will update.

Basically it should be your, as a developer, tool at hand to check the
data type layouts whenever the new member is added or rearrangement is
made.

> >>  };

...

> >> +enum iio_backend_capabilities {
> >> +    IIO_BACKEND_CAP_TEST_PATTERNS = BIT(0),
> >> +    IIO_BACKEND_CAP_BUFFERING = BIT(1),
> >> +    IIO_BACKEND_CAP_CALIBRATION = BIT(2)
> >
> > Add trailing comma, it will allow to avoid unneeded churn in the future.
> Sounds good, was just following existing style.

I haven't checked the rest, but the rule of thumb is that:
1) potential of the adding new entries after the last one — (almost)
always add a trailing comma;
2) termination entry — never add a trailing comma;
3) exceptions are some arrays which are located on one line, like
  static int foo[] = { 1, 2, 3 };
means no trailing comma.

> >> +};

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ