[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Thu, 4 Apr 2024 18:36:12 +0200
From: Borislav Petkov <bp@...en8.de>
To: Li Zhijian <lizhijian@...itsu.com>
Cc: linux-kernel@...r.kernel.org, Tony Luck <tony.luck@...el.com>,
James Morse <james.morse@....com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Robert Richter <rric@...nel.org>, linux-edac@...r.kernel.org
Subject: Re: [PATCH] EDAC/mc_sysfs: Convert sprintf/snprintf to sysfs_emit
On Thu, Mar 14, 2024 at 04:46:28PM +0800, Li Zhijian wrote:
> Per filesystems/sysfs.rst, show() should only use sysfs_emit()
> or sysfs_emit_at() when formatting the value to be returned to user space.
>
> coccinelle complains that there are still a couple of functions that use
> snprintf(). Convert them to sysfs_emit().
>
> sprintf() will be converted as weel if they have.
>
> Generally, this patch is generated by
> make coccicheck M=<path/to/file> MODE=patch \
> COCCI=scripts/coccinelle/api/device_attr_show.cocci
>
> No functional change intended
>
> CC: Borislav Petkov <bp@...en8.de>
> CC: Tony Luck <tony.luck@...el.com>
> CC: James Morse <james.morse@....com>
> CC: Mauro Carvalho Chehab <mchehab@...nel.org>
> CC: Robert Richter <rric@...nel.org>
> CC: linux-edac@...r.kernel.org
> Signed-off-by: Li Zhijian <lizhijian@...itsu.com>
> ---
> This is a part of the work "Fix coccicheck device_attr_show warnings"[1]
> Split them per subsystem so that the maintainer can review it easily
> [1] https://lore.kernel.org/lkml/20240116041129.3937800-1-lizhijian@fujitsu.com/
> ---
> drivers/edac/edac_mc_sysfs.c | 48 ++++++++++++++++++------------------
> 1 file changed, 24 insertions(+), 24 deletions(-)
Applied, thanks.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists