mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mark Pearson" <mpearson-lenovo@squebb.ca>
To: "Thorsten Blum" <blum@kernel.org>,
	"Derek J . Clark" <derekjohn.clark@gmail.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: "platform-driver-x86@vger.kernel.org"
	<platform-driver-x86@vger.kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86: think-lmi: Use sysfs_emit() in pending_reboot_show()
Date: Tue, 22 Sep 2026 13:34:01 -0400	[thread overview]
Message-ID: <50a98ed4-9695-415b-885a-e3127fdf7fd4@app.fastmail.com> (raw)
In-Reply-To: <20260920103518.281843-2-blum@kernel.org>

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

      reply	other threads:[~2026-09-22 17:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-20 10:35 Thorsten Blum
2026-09-22 17:34 ` Mark Pearson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50a98ed4-9695-415b-885a-e3127fdf7fd4@app.fastmail.com \
    --to=mpearson-lenovo@squebb.ca \
    --cc=blum@kernel.org \
    --cc=derekjohn.clark@gmail.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®