[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<PH7PR12MB66683EFE4395B10DC5CAC43EAF1A2@PH7PR12MB6668.namprd12.prod.outlook.com>
Date: Thu, 16 Jan 2025 09:03:37 +0000
From: Vadim Pasternak <vadimp@...dia.com>
To: Ai Chao <aichao@...inos.cn>, "hdegoede@...hat.com" <hdegoede@...hat.com>,
"ilpo.jarvinen@...ux.intel.com" <ilpo.jarvinen@...ux.intel.com>,
"platform-driver-x86@...r.kernel.org" <platform-driver-x86@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] platform/mellanox: mlxreg-hotplug: use sysfs_emit()
instead of sprintf()
> -----Original Message-----
> From: Ai Chao <aichao@...inos.cn>
> Sent: Thursday, 16 January 2025 10:10
> To: hdegoede@...hat.com; ilpo.jarvinen@...ux.intel.com; Vadim Pasternak
> <vadimp@...dia.com>; platform-driver-x86@...r.kernel.org; linux-
> kernel@...r.kernel.org
> Cc: Ai Chao <aichao@...inos.cn>
> Subject: [PATCH] platform/mellanox: mlxreg-hotplug: use sysfs_emit() instead
> of sprintf()
>
> Follow the advice in Documentation/filesystems/sysfs.rst:
> show() should only use sysfs_emit() or sysfs_emit_at() when formatting the
> value to be returned to user space.
>
> Signed-off-by: Ai Chao <aichao@...inos.cn>
Acked-by: Vadim Pasternak <vadimp@...dia.com>
> ---
> drivers/platform/mellanox/mlxreg-hotplug.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c
> b/drivers/platform/mellanox/mlxreg-hotplug.c
> index 6aa2a4650367..b347000e4329 100644
> --- a/drivers/platform/mellanox/mlxreg-hotplug.c
> +++ b/drivers/platform/mellanox/mlxreg-hotplug.c
> @@ -232,7 +232,7 @@ static ssize_t mlxreg_hotplug_attr_show(struct device
> *dev,
> regval = !!(regval & data->mask);
> }
>
> - return sprintf(buf, "%u\n", regval);
> + return sysfs_emit(buf, "%u\n", regval);
> }
>
> #define PRIV_ATTR(i) priv->mlxreg_hotplug_attr[i]
> --
> 2.47.1
Powered by blists - more mailing lists