From: Jarkko Sakkinen <jarkko@kernel.org>
To: Chelsy Ratnawat <chelsyratnawat2001@gmail.com>
Cc: peterhuewe@gmx.de, jgg@ziepe.ca, linux-integrity@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] tpm: Replace scnprintf() with sysfs_emit() and sysfs_emit_at() in sysfs show functions
Date: Wed, 25 Jun 2025 19:56:02 +0300 [thread overview]
Message-ID: <aFwqIqfFFrwg1vIm@kernel.org> (raw)
In-Reply-To: <20250625050346.11500-1-chelsyratnawat2001@gmail.com>
On Tue, Jun 24, 2025 at 10:03:46PM -0700, Chelsy Ratnawat wrote:
> Documentation/filesystems/sysfs.rst mentions that show() should only
> use sysfs_emit() or sysfs_emit_at() when formating the value to be
> returned to user space. So replace scnprintf() with sysfs_emit().
>
> Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com>
> ---
> Changes in v4:
> - updated the commit message.
>
> drivers/char/tpm/tpm_ppi.c | 48 ++++++++++++++++++--------------------
> 1 file changed, 23 insertions(+), 25 deletions(-)
$ scripts/checkpatch.pl --strict 0001-tpm-Replace-scnprintf-with-sysfs_emit-and-sysfs_emit.patch
CHECK: Alignment should match open parenthesis
#36: FILE: drivers/char/tpm/tpm_ppi.c:91:
+ size = sysfs_emit(buf, "%llu %llu\n", req,
obj->package.elements[2].integer.value);
CHECK: Alignment should match open parenthesis
#50: FILE: drivers/char/tpm/tpm_ppi.c:102:
+ size = sysfs_emit(buf, "%llu\n",
obj->package.elements[1].integer.value);
CHECK: spaces preferred around that '-' (ctx:VxV)
#63: FILE: drivers/char/tpm/tpm_ppi.c:215:
+ info[ARRAY_SIZE(info)-1]);
^
total: 0 errors, 0 warnings, 3 checks, 100 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
0001-tpm-Replace-scnprintf-with-sysfs_emit-and-sysfs_emit.patch has style problems, please review.
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
Can you fix these checkpatch errors?
BR, Jarkko
prev parent reply other threads:[~2025-06-25 16:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-25 5:03 [PATCH v4] tpm: Replace scnprintf() with sysfs_emit() and sysfs_emit_at() in sysfs show functions Chelsy Ratnawat
2025-06-25 16:56 ` Jarkko Sakkinen [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=aFwqIqfFFrwg1vIm@kernel.org \
--to=jarkko@kernel.org \
--cc=chelsyratnawat2001@gmail.com \
--cc=jgg@ziepe.ca \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.