* [PATCH] platform/x86: think-lmi: Use sysfs_emit() in pending_reboot_show()
@ 2026-09-20 10:35 Thorsten Blum
2026-09-22 17:34 ` Mark Pearson
2026-10-05 18:24 ` Ilpo Järvinen
0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2026-09-20 10:35 UTC (permalink / raw)
To: Mark Pearson, Derek J. Clark, Hans de Goede, Ilpo Järvinen
Cc: Thorsten Blum, platform-driver-x86, linux-kernel
Replace sprintf() with sysfs_emit() in pending_reboot_show().
sysfs_emit() is preferred for formatting sysfs output because it
provides safer bounds checking.
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
drivers/platform/x86/lenovo/think-lmi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/lenovo/think-lmi.c b/drivers/platform/x86/lenovo/think-lmi.c
index 3ddc1f5cec19..7b319601662a 100644
--- a/drivers/platform/x86/lenovo/think-lmi.c
+++ b/drivers/platform/x86/lenovo/think-lmi.c
@@ -1281,7 +1281,7 @@ static const struct kobj_type tlmi_pwd_setting_ktype = {
static ssize_t pending_reboot_show(struct kobject *kobj, struct kobj_attribute *attr,
char *buf)
{
- return sprintf(buf, "%d\n", tlmi_priv.pending_changes);
+ return sysfs_emit(buf, "%d\n", tlmi_priv.pending_changes);
}
static struct kobj_attribute pending_reboot = __ATTR_RO(pending_reboot);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] platform/x86: think-lmi: Use sysfs_emit() in pending_reboot_show()
2026-09-20 10:35 [PATCH] platform/x86: think-lmi: Use sysfs_emit() in pending_reboot_show() Thorsten Blum
@ 2026-09-22 17:34 ` Mark Pearson
2026-10-05 18:24 ` Ilpo Järvinen
1 sibling, 0 replies; 3+ messages in thread
From: Mark Pearson @ 2026-09-22 17:34 UTC (permalink / raw)
To: Thorsten Blum, Derek J . Clark, Hans de Goede, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel
On Sun, Sep 20, 2026, at 6:35 AM, Thorsten Blum wrote:
> Replace sprintf() with sysfs_emit() in pending_reboot_show().
> sysfs_emit() is preferred for formatting sysfs output because it
> provides safer bounds checking.
>
> Signed-off-by: Thorsten Blum <blum@kernel.org>
> ---
> drivers/platform/x86/lenovo/think-lmi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/lenovo/think-lmi.c
> b/drivers/platform/x86/lenovo/think-lmi.c
> index 3ddc1f5cec19..7b319601662a 100644
> --- a/drivers/platform/x86/lenovo/think-lmi.c
> +++ b/drivers/platform/x86/lenovo/think-lmi.c
> @@ -1281,7 +1281,7 @@ static const struct kobj_type
> tlmi_pwd_setting_ktype = {
> static ssize_t pending_reboot_show(struct kobject *kobj, struct
> kobj_attribute *attr,
> char *buf)
> {
> - return sprintf(buf, "%d\n", tlmi_priv.pending_changes);
> + return sysfs_emit(buf, "%d\n", tlmi_priv.pending_changes);
> }
>
> static struct kobj_attribute pending_reboot = __ATTR_RO(pending_reboot);
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] platform/x86: think-lmi: Use sysfs_emit() in pending_reboot_show()
2026-09-20 10:35 [PATCH] platform/x86: think-lmi: Use sysfs_emit() in pending_reboot_show() Thorsten Blum
2026-09-22 17:34 ` Mark Pearson
@ 2026-10-05 18:24 ` Ilpo Järvinen
1 sibling, 0 replies; 3+ messages in thread
From: Ilpo Järvinen @ 2026-10-05 18:24 UTC (permalink / raw)
To: Mark Pearson, Derek J. Clark, Hans de Goede, Thorsten Blum
Cc: platform-driver-x86, linux-kernel
On Sun, 20 Sep 2026 12:35:18 +0200, Thorsten Blum wrote:
> Replace sprintf() with sysfs_emit() in pending_reboot_show().
> sysfs_emit() is preferred for formatting sysfs output because it
> provides safer bounds checking.
Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.
FYI [if applicable to your patch], as per Linus' policy change, also
fixes are mostly routed through for-next unless the fix is for a
commit introduced in the most recent cycle or is clearly a regression
fix.
The list of commits applied:
[1/1] platform/x86: think-lmi: Use sysfs_emit() in pending_reboot_show()
commit: 6cbf338f2e442f2843c208da92f049e7e23b5e5f
--
i.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-05 18:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-20 10:35 [PATCH] platform/x86: think-lmi: Use sysfs_emit() in pending_reboot_show() Thorsten Blum
2026-09-22 17:34 ` Mark Pearson
2026-10-05 18:24 ` Ilpo Järvinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®