Re: [PATCH] platform/x86: dell-wmi-sysman: Use sysfs_emit{_at} in show functions

From: Ilpo Järvinen

Date: Thu Mar 05 2026 - 08:10:48 EST


On Thu, 5 Mar 2026, Thorsten Blum wrote:
> On 5. Mar 2026, at 13:48, Ilpo Järvinen wrote:
> > On Thu, 5 Mar 2026, Thorsten Blum wrote:
> >> Replace sprintf() with sysfs_emit() and sysfs_emit_at() in sysfs show
> >> functions. sysfs_emit() and sysfs_emit_at() are preferred for formatting
> >> sysfs output because they provide safer bounds checking.
> >>
> >> In reset_bios_show(), use sysfs_emit_at() to avoid manual buffer size
> >> accounting.
> >>
> >> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
> >> ---
> >> .../platform/x86/dell/dell-wmi-sysman/sysman.c | 18 ++++++++----------
> >> 1 file changed, 8 insertions(+), 10 deletions(-)
> >> [...]
> >> + for (i = 0; i < MAX_TYPES; i++)
> >> + len += sysfs_emit_at(buf, len, i == reset_option ? "[%s] " : "%s ",
> >
> > Are all checkers okay with this construct? IIRC something doesn't
> > like having such logic in where only a formatting string is expected.
>
> You mean checkpatch? No warnings, but I can split it again if needed.

Unfortunately, I don't recall what it was anymore (I didn't expect it
to be checkpatch) and couldn't locate the change either but I'm pretty
sure somebody did split a similar elvis operator.

--
i.