Re: [PATCH] iio: health: max30100: drop unnecessary cast
From: Jonathan Cameron
Date: Sun Apr 12 2026 - 10:32:42 EST
On Sat, 21 Mar 2026 20:56:46 +0000
Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
> 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.
>
David, this question is outstanding so I've marked it 'changes requested'
in patchwork.
Thanks,
Jonathan
>
>