Re: [PATCH v7 15/24] ACPI: property: Add support for cells property

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

 



On Wed, Jul 2, 2025 at 1:38 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> On Wed, Jul 02, 2025 at 12:20:55PM +0200, Rafael J. Wysocki wrote:
> > On Wed, Jul 2, 2025 at 7:16 AM Anup Patel <apatel@xxxxxxxxxxxxxxxx> wrote:
>
> ...
>
> > >  static int acpi_fwnode_get_reference_args(const struct fwnode_handle *fwnode,
> > >                                           const char *propname, const char *nargs_prop,
> > >                                           unsigned int args_count, unsigned int index,
>
> > >         const struct acpi_device_data *data;
> > >         struct fwnode_handle *ref_fwnode;
> > >         struct acpi_device *device;
> > > +       unsigned int nargs_count;
> > >         int ret, idx = 0;
>
> > > +                       nargs_count = acpi_fwnode_get_args_count(device, nargs_prop);
> >
> > I think it should work the same way as it used to for the callers that
> > pass args_count, so maybe
> >
> > if (!args_count)
> >         args_count = acpi_fwnode_get_args_count(device, nargs_prop);
>
> But this is different variable.

Of course it is different.  It is an acpi_fwnode_get_reference_args() parameter.

> > >                         element++;
> > > -
> > >                         ret = acpi_get_ref_args(idx == index ? args : NULL,
> > >                                                 acpi_fwnode_handle(device),
> > > -                                               &element, end, args_count);
> > > +                                               &element, end,
> > > +                                               nargs_count ? nargs_count : args_count);
> >
> > And this change would not be necessary?
>
> This is not the same check as proposed above.

No, it is not.

It just makes the function work the same way it did before the change
for the callers who passed nozero args_count and so they might be
forgiven expecting that it would be taken into account.





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux