Re: [PATCH] iio: health: max30100: drop unnecessary cast
From: Jonathan Cameron
Date: Sat Mar 21 2026 - 16:57:03 EST
On Mon, 16 Mar 2026 13:25:00 +0200
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> On Sat, Mar 14, 2026 at 05:33:01PM -0500, David Lechner wrote:
> > Drop an unnecessary cast in max30100_led_init().
> >
> > val is defined as unsigned int val[2]; so the cast is not needed, nor
> > is the address-of operator &.
> >
> > Also fix alignment with ( while we are touching this.
>
> > ret = device_property_read_u32_array(dev, "maxim,led-current-microamp",
> > - (unsigned int *) &val, 2);
> > + val, 2);
>
> You want to have ARRAY_SIZE() as well.
>
Should we make val a u32 val[2]?
Obviously we all know the unsigned int is that big, but in theory that might
not always be so...
This is the only place where it's passed as a pointer rather than value from
one of the elements I think.