[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z2nA46H_sRrC74n8@smile.fi.intel.com>
Date: Mon, 23 Dec 2024 21:58:27 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: "Rob Herring (Arm)" <robh@...nel.org>
Cc: Petr Mladek <pmladek@...e.com>, Steven Rostedt <rostedt@...dmis.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Jonathan Corbet <corbet@....net>,
Saravana Kannan <saravanak@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Zijun Hu <quic_zijuhu@...cinc.com>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH] of: Add printf '%pOFm' for generating modalias
On Tue, Dec 17, 2024 at 12:37:09PM -0600, Rob Herring (Arm) wrote:
> The callers for of_modalias() generally need the module alias as part of
> some larger string. That results in some error prone manipulation of the
> buffer prepend/append the module alias string. In fact,
> of_device_uevent_modalias() has several issues. First, it's off by one
> too few characters in utilization of the full buffer. Second, the error
> paths leave OF_MODALIAS with a truncated value when in the end nothing
> should be added to the buffer. It is also fragile because it needs
> internal details of struct kobj_uevent_env. add_uevent_var() really
> wants to write the env variable and value in one shot which would need
> either a temporary buffer for value or a format specifier.
>
> Fix these issues by adding a new printf format specifier, "%pOFm". With
> the format specifier in place, simplify all the callers of
> of_modalias(). of_modalias() can also be simplified with vsprintf()
> being the only caller as it avoids the error conditions.
Shouldn't ACPI case also be considered? Otherwise we might see a deviation and
then completely asynced variants of modalias based on different type of fwnode.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists