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