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: <bf5e2905-d37e-7f54-ea2c-b75f2b921679@linux.ibm.com>
Date:   Mon, 5 Dec 2022 12:38:59 +0100
From:   Alexandra Winter <wintera@...ux.ibm.com>
To:     ye.xingchen@....com.cn
Cc:     wenjia@...ux.ibm.com, hca@...ux.ibm.com, gor@...ux.ibm.com,
        agordeev@...ux.ibm.com, borntraeger@...ux.ibm.com,
        svens@...ux.ibm.com, linux-s390@...r.kernel.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] s390/qeth: use sysfs_emit() to instead of
 scnprintf()



On 05.12.22 04:52, 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>
> ---
>  drivers/s390/net/qeth_l3_sys.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c
> index 1082380b21f8..65eea667e469 100644
> --- a/drivers/s390/net/qeth_l3_sys.c
> +++ b/drivers/s390/net/qeth_l3_sys.c
> @@ -395,7 +395,7 @@ static ssize_t qeth_l3_dev_ipato_add_show(char *buf, struct qeth_card *card,
>  	}
>  	mutex_unlock(&card->ip_lock);
> 
> -	return str_len ? str_len : scnprintf(buf, PAGE_SIZE, "\n");
> +	return str_len ? str_len : sysfs_emit(buf, "\n");
>  }
> 
>  static ssize_t qeth_l3_dev_ipato_add4_show(struct device *dev,
> @@ -614,7 +614,7 @@ static ssize_t qeth_l3_dev_ip_add_show(struct device *dev, char *buf,
>  	}
>  	mutex_unlock(&card->ip_lock);
> 
> -	return str_len ? str_len : scnprintf(buf, PAGE_SIZE, "\n");
> +	return str_len ? str_len : sysfs_emit(buf, "\n");
>  }
> 
>  static ssize_t qeth_l3_dev_vipa_add4_show(struct device *dev,
There are more instances of scnprintf in s390/net that can be replaced by sysfs_emit. 
We are already working on that. 

But thanks for improving those two.
Reviewed-by: Alexandra Winter <wintera@...ux.ibm.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ