public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Prasanth Ksr <prasanth.ksr@dell.com>,
	Hans de Goede <hansg@kernel.org>,
	 Dell.Client.Kernel@dell.com,
	platform-driver-x86@vger.kernel.org,
	 LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] platform/x86: dell-wmi-sysman: Use sysfs_emit{_at} in show functions
Date: Thu, 5 Mar 2026 15:10:30 +0200 (EET)	[thread overview]
Message-ID: <abe982e5-d64d-ac60-babf-91ea81bd748b@linux.intel.com> (raw)
In-Reply-To: <27DCD6B0-3DDC-4FDB-BE29-873465FAD236@linux.dev>

[-- Attachment #1: Type: text/plain, Size: 1237 bytes --]

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@linux.dev>
> >> ---
> >> .../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.

      reply	other threads:[~2026-03-05 13:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05 12:41 [PATCH] platform/x86: dell-wmi-sysman: Use sysfs_emit{_at} in show functions Thorsten Blum
2026-03-05 12:48 ` Ilpo Järvinen
2026-03-05 13:00   ` Thorsten Blum
2026-03-05 13:10     ` Ilpo Järvinen [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=abe982e5-d64d-ac60-babf-91ea81bd748b@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=Dell.Client.Kernel@dell.com \
    --cc=hansg@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=prasanth.ksr@dell.com \
    --cc=thorsten.blum@linux.dev \
    /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