Re: [PATCH] staging: greybus: use sysfs_emit instead of sprintf in light.c
From: Greg Kroah-Hartman
Date: Tue Sep 01 2026 - 06:35:15 EST
On Wed, Aug 19, 2026 at 05:44:55PM +0200, Tomasz Unger wrote:
> Per Documentation/filesystems/sysfs.rst, new implementations of
> show() methods should only use sysfs_emit() or sysfs_emit_at()
> when formatting the value to be returned to user space, since it
> is aware of the sysfs PAGE_SIZE buffer and includes sanity checks
> that sprintf() lacks.
>
> This fixes fade_in_show() and fade_out_show() (both generated by
> the gb_lights_fade_attr() macro) and color_show().
>
> Signed-off-by: Tomasz Unger <tomasz.unger@xxxxxxxx>
> ---
> Verified with checkpatch.pl - no errors or warnings.
> Compiled the gb-light module successfully with CONFIG_GREYBUS_LIGHT=m
> and CONFIG_LEDS_CLASS_FLASH=m (both previously disabled).
> greybus.ko, led-class-flash.ko and gb-light.ko all load without
> errors in a QEMU environment (verified via insmod and lsmod, dmesg
> shows no errors). This confirms the modules load cleanly but does
> not exercise the changed sysfs show() code paths, which would
> require an actual Greybus light device bound to the driver.
> ---
> drivers/staging/greybus/light.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Please see the archives for why this patch has been rejected in the
past.
sorry,
greg k-h