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>] [day] [month] [year] [list]
Message-ID: <525218fc-d70e-1de5-2495-13fe3e942a9a@redhat.com>
Date:   Tue, 27 Sep 2022 15:04:39 +0200
From:   Hans de Goede <hdegoede@...hat.com>
To:     cgel.zte@...il.com
Cc:     markgross@...nel.org, platform-driver-x86@...r.kernel.org,
        linux-kernel@...r.kernel.org, ye xingchen <ye.xingchen@....com.cn>
Subject: Re: [PATCH linux-next] platform/x86: use sysfs_emit() and add the
 '\n'

Hi,

On 9/23/22 08:32, cgel.zte@...il.com wrote:
> From: ye xingchen <ye.xingchen@....com.cn>
> 
> Replace the open-code with sysfs_emit() to simplify the code.
> And also add '\n' because it need a new line.
> 
> Signed-off-by: ye xingchen <ye.xingchen@....com.cn>

Thanks, I have merged this minus the addition of the '\n',
this is exposed to userspace and some userspace apps may rely
on the current behavior where the '\n' is omitted.

Thank you for your patch, I've applied this patch to my review-hans 
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.

Regards,

Hans




> ---
>  drivers/platform/x86/dell/dell-smbios-base.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/dell/dell-smbios-base.c b/drivers/platform/x86/dell/dell-smbios-base.c
> index fc086b66f70b..e5b61ecdae8c 100644
> --- a/drivers/platform/x86/dell/dell-smbios-base.c
> +++ b/drivers/platform/x86/dell/dell-smbios-base.c
> @@ -441,7 +441,7 @@ static ssize_t location_show(struct device *dev,
>  
>  	i = match_attribute(dev, attr);
>  	if (i > 0)
> -		return scnprintf(buf, PAGE_SIZE, "%08x", da_tokens[i].location);
> +		return sysfs_emit(buf, "%08x\n", da_tokens[i].location);
>  	return 0;
>  }
>  
> @@ -455,7 +455,7 @@ static ssize_t value_show(struct device *dev,
>  
>  	i = match_attribute(dev, attr);
>  	if (i > 0)
> -		return scnprintf(buf, PAGE_SIZE, "%08x", da_tokens[i].value);
> +		return sysfs_emit(buf, "%08x\n", da_tokens[i].value);
>  	return 0;
>  }
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ