lkml.org 
[lkml]   [2024]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 12/13] regulator: add pm8008 pmic regulator driver
On Thu, May 09, 2024 at 03:07:02PM +0300, Andy Shevchenko wrote:
> Wed, May 08, 2024 at 10:37:50PM +0000, Stephen Boyd kirjoitti:
> > Quoting Johan Hovold (2024-05-06 08:08:29)
>
> ...
>
> > > + BUILD_BUG_ON((ARRAY_SIZE(pldo_ranges) != 1) ||
> >
> > This should be an && not || right?
>
> > > + (ARRAY_SIZE(nldo_ranges) != 1));
>
> In any case BUILD_BUG_ON() is not encouraged for such cases, it would be much
> better to have a static_assert() near to one of those arrays.

I think the reason it is placed here is that the above line reads:

rdesc->n_linear_ranges = 1;

and that would need to change if anyone expands the arrays.

Johan

\
 
 \ /
  Last update: 2024-05-09 14:20    [W:0.147 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site