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

Reply via email to