]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rtc: ab8500: replace sprintf() with sysfs_emit()
authorMaxwell Doose <m32285159@gmail.com>
Sun, 3 May 2026 20:12:36 +0000 (15:12 -0500)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 4 May 2026 16:04:09 +0000 (18:04 +0200)
commitb72386864481cf7fb6153842d22561ac3032302f
treec549313f74eabd1f299e47019c5f1acd6e70d85c
parent254f49634ee16a731174d2ae34bc50bd5f45e731
rtc: ab8500: replace sprintf() with sysfs_emit()

This patch replaces sprintf() with sysfs_emit() to ensure proper
bounds checking. It also simplifies the return logic by directly
returning the error after logging, instead of logging, calling
sprintf(), then returning.

Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Maxwell Doose <m32285159@gmail.com>
Link: https://patch.msgid.link/20260503201236.29685-1-m32285159@gmail.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-ab8500.c