[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aFka3y1494LIzyUA@smile.fi.intel.com>
Date: Mon, 23 Jun 2025 12:14:07 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Anup Patel <apatel@...tanamicro.com>
Cc: Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Jassi Brar <jassisinghbrar@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Uwe Kleine-König <ukleinek@...nel.org>,
Palmer Dabbelt <palmer@...belt.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Len Brown <lenb@...nel.org>, Sunil V L <sunilvl@...tanamicro.com>,
Rahul Pathak <rpathak@...tanamicro.com>,
Leyfoon Tan <leyfoon.tan@...rfivetech.com>,
Atish Patra <atish.patra@...ux.dev>,
Andrew Jones <ajones@...tanamicro.com>,
Samuel Holland <samuel.holland@...ive.com>,
Anup Patel <anup@...infault.org>, linux-clk@...r.kernel.org,
devicetree@...r.kernel.org, linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 14/23] ACPI: property: Add support for cells property
On Wed, Jun 18, 2025 at 05:43:49PM +0530, Anup Patel wrote:
> From: Sunil V L <sunilvl@...tanamicro.com>
>
> Currently, ACPI doesn't support cells property when
> fwnode_property_get_reference_args() is called. ACPI always expects
> the number of arguments to be passed. However, the above mentioned
> call being a common interface for OF and ACPI, it is better to have
> single calling convention which works for both. Hence, add support
> for cells property on the reference device to get the number of
> arguments dynamically.
...
> +static unsigned int acpi_fwnode_get_args_count(const struct acpi_device *device,
> + const char *nargs_prop)
> +{
> + const union acpi_object *obj;
> + if (!nargs_prop)
> + return 0;
This check is implied by the call. No need to duplicate.
> + if (acpi_dev_get_property(device, nargs_prop, ACPI_TYPE_INTEGER, &obj))
> + return 0;
> +
> + return obj->integer.value;
> +}
...
> + if (nargs_prop)
Again, if you don't won't to reassign the existing value, it's better to have
this data be collected in the temporary variable of the same semantics. Then
you will choose one when it's needed, no need to have this dup check (again!).
> + args_count = acpi_fwnode_get_args_count(device, nargs_prop);
> +
> element++;
>
> ret = acpi_get_ref_args(idx == index ? args : NULL,
...
> + if (nargs_prop) {
Ditto.
> + device = to_acpi_device_node(ref_fwnode);
> + args_count = acpi_fwnode_get_args_count(device, nargs_prop);
> + }
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists