Re: [PATCH v3 3/3] hwmon: tmp513: Simplify tmp51x_read_properties()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 28, 2023 at 09:45:17AM +0200, Geert Uytterhoeven wrote:
> On Fri, Aug 25, 2023 at 10:54 PM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> > Simplify tmp51x_read_properties() by replacing 'nfactor' ->'data->nfactor'
> > in device_property_read_u32_array() and drop the local variable as it is
> > unused.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

...

> > -       ret = device_property_read_u32_array(dev, "ti,nfactor", nfactor,
> > -                                           data->max_channels - 1);
> > -       if (ret >= 0)
> > -               memcpy(data->nfactor, nfactor, data->max_channels - 1);
> > +       device_property_read_u32_array(dev, "ti,nfactor", data->nfactor,
> > +                                      data->max_channels - 1);
> 
> My first thought was that this could cause a small change in behavior.
> However, the comments for of_property_read_u32_array() and
> of_property_read_variable_u32_array() state:

I don't know how the latter is relevant here (or even anything from of_*()
specific APIs). The device property APIs should give behaviour described
in their own docs (although it must be compatible with the existing OF one).

>  * The out_values is modified only if a valid u32 value can be decoded.
> 
> and the implementation behaves that way.
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux