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] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y48DkToW/Yvvid+0@gmail.com>
Date:   Tue, 6 Dec 2022 08:55:45 +0000
From:   Martin Habets <habetsm.xilinx@...il.com>
To:     ye.xingchen@....com.cn
Cc:     leon@...nel.org, davem@...emloft.net, ecree.xilinx@...il.com,
        edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
        petrm@...dia.com, khalasa@...p.pl, shayagr@...zon.com,
        wsa+renesas@...g-engineering.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v2] sfc: use sysfs_emit() to instead of
 scnprintf()

On Mon, Dec 05, 2022 at 10:21:45AM +0800, ye.xingchen@....com.cn wrote:
> From: ye xingchen <ye.xingchen@....com.cn>
> 
> Follow the advice of the Documentation/filesystems/sysfs.rst and show()
> should only use sysfs_emit() or sysfs_emit_at() when formatting the
> value to be returned to user space.
> 
> Signed-off-by: ye xingchen <ye.xingchen@....com.cn>

Acked-by: Martin Habets <habetsm.xilinx@...il.com>

> ---
> v1 -> v2
> Fix the Subject.
>  drivers/net/ethernet/sfc/efx_common.c       | 2 +-
>  drivers/net/ethernet/sfc/siena/efx_common.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c
> index c2224e41a694..cc30524c2fe4 100644
> --- a/drivers/net/ethernet/sfc/efx_common.c
> +++ b/drivers/net/ethernet/sfc/efx_common.c
> @@ -1164,7 +1164,7 @@ static ssize_t mcdi_logging_show(struct device *dev,
>  	struct efx_nic *efx = dev_get_drvdata(dev);
>  	struct efx_mcdi_iface *mcdi = efx_mcdi(efx);
> 
> -	return scnprintf(buf, PAGE_SIZE, "%d\n", mcdi->logging_enabled);
> +	return sysfs_emit(buf, "%d\n", mcdi->logging_enabled);
>  }
> 
>  static ssize_t mcdi_logging_store(struct device *dev,
> diff --git a/drivers/net/ethernet/sfc/siena/efx_common.c b/drivers/net/ethernet/sfc/siena/efx_common.c
> index 1fd396b00bfb..e4b294b8e9ac 100644
> --- a/drivers/net/ethernet/sfc/siena/efx_common.c
> +++ b/drivers/net/ethernet/sfc/siena/efx_common.c
> @@ -1178,7 +1178,7 @@ static ssize_t mcdi_logging_show(struct device *dev,
>  	struct efx_nic *efx = dev_get_drvdata(dev);
>  	struct efx_mcdi_iface *mcdi = efx_mcdi(efx);
> 
> -	return scnprintf(buf, PAGE_SIZE, "%d\n", mcdi->logging_enabled);
> +	return sysfs_emit(buf, "%d\n", mcdi->logging_enabled);
>  }
> 
>  static ssize_t mcdi_logging_store(struct device *dev,
> -- 
> 2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ