Re: [PATCH v1 1/1] thermal: sysfs: switch to use scnprintf() to suppress truncation warning

From: Rafael J. Wysocki (Intel)

Date: Fri Sep 04 2026 - 10:55:56 EST


On Fri, Sep 4, 2026 at 10:01 AM Lukasz Luba <lukasz.luba@xxxxxxx> wrote:
>
>
>
> On 8/17/26 11:33, Andy Shevchenko wrote:
> > Switch the sysfs code to use scnprintf() to avoid warnings about potential
> > truncation of the names of the sysfs attributes. We can't increase the buffer
> > size because the size is the part of an ABI for some reason. Note, with
> > the current size of buffer the affected attributes have a room for up to
> > 1000 names, which ought to be enough for all cases. There is no functional
> > change, as the same limitation was implied before.
>
> Right, it doesn't touch the real truncation check problem only avoids
> the complain from the tool. We can think about this later in some
> redesign.
>
> >
> > Fixes: c56f5c0342df ("Thermal: Make Thermal trip points writeable")
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> > ---
> > drivers/thermal/thermal_sysfs.c | 12 ++++++------
> > 1 file changed, 6 insertions(+), 6 deletions(-)
>
>
> Reviewed-by: Lukasz Luba <lukasz.luba@xxxxxxx>

Applied and added to linux-pm.git/fixes, thanks!