lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aFwqIqfFFrwg1vIm@kernel.org>
Date: Wed, 25 Jun 2025 19:56:02 +0300
From: Jarkko Sakkinen <jarkko@...nel.org>
To: Chelsy Ratnawat <chelsyratnawat2001@...il.com>
Cc: peterhuewe@....de, jgg@...pe.ca, linux-integrity@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] tpm: Replace scnprintf() with sysfs_emit() and
 sysfs_emit_at() in sysfs show functions

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@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ