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: <Y91bc2LWMl+DsjcW@corigine.com>
Date:   Fri, 3 Feb 2023 20:07:31 +0100
From:   Simon Horman <simon.horman@...igine.com>
To:     Bo Liu <liubo03@...pur.com>
Cc:     johannes@...solutions.net, davem@...emloft.net,
        edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
        linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rfkill: Use sysfs_emit() to instead of sprintf()

Hi Bo Liu,

On Wed, Feb 01, 2023 at 03:17:18AM -0500, Bo Liu wrote:
> 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.

Thanks for your patch. As it is not a bug fix it should be targeted at
'net-next' (as opposed to 'net'). This should be specified in the patch
subject something like this:

[PATCH net-next v2] rfkill: Use sysfs_emit() to instead of sprintf()

> Signed-off-by: Bo Liu <liubo03@...pur.com>
> ---
>  net/rfkill/core.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/net/rfkill/core.c b/net/rfkill/core.c
> index b390ff245d5e..a103b2da4ed2 100644
> --- a/net/rfkill/core.c
> +++ b/net/rfkill/core.c

...

> @@ -721,7 +721,7 @@ static ssize_t hard_show(struct device *dev, struct device_attribute *attr,
>  {
>  	struct rfkill *rfkill = to_rfkill(dev);
>  
> -	return sprintf(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_HW) ? 1 : 0 );
> +	return sysfs_emit(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_HW) ? 1 : 0 );
	return sysfs_emit(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_HW) ? 1 : 0);

./scripts/checkpatch.pl complains that there should not be a space before
the last ')'.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ