Re: [PATCH 14/42] drivers/platform/mellanox: Convert snprintf to sysfs_emit

From: Ilpo Järvinen
Date: Wed Jan 24 2024 - 06:01:22 EST


On Tue, 16 Jan 2024, 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().
>
> > ./drivers/platform/mellanox/mlxbf-bootctl.c:466:8-16: WARNING: please use sysfs_emit
> > ./drivers/platform/mellanox/mlxbf-bootctl.c:584:8-16: WARNING: please use sysfs_emit
> > ./drivers/platform/mellanox/mlxbf-bootctl.c:635:8-16: WARNING: please use sysfs_emit
> > ./drivers/platform/mellanox/mlxbf-bootctl.c:686:8-16: WARNING: please use sysfs_emit
> > ./drivers/platform/mellanox/mlxbf-bootctl.c:737:8-16: WARNING: please use sysfs_emit
> > ./drivers/platform/mellanox/mlxbf-bootctl.c:788:8-16: WARNING: please use sysfs_emit
> > ./drivers/platform/mellanox/mlxbf-bootctl.c:839:8-16: WARNING: please use sysfs_emit
>
> No functional change intended
>
> CC: Hans de Goede <hdegoede@xxxxxxxxxx>
> CC: ilpo.jarvinen@xxxxxxxxxxxxxxx
> CC: Vadim Pasternak <vadimp@xxxxxxxxxx>
> CC: platform-driver-x86@xxxxxxxxxxxxxxx
> Signed-off-by: Li Zhijian <lizhijian@xxxxxxxxxxx>

Applied to pdx86 review-ilpo branch.

--
i.