lkml.org 
[lkml]   [2022]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH linux-next] platform/x86: use sysfs_emit() and add the '\n'
From
Hi,

On 9/23/22 08:32, cgel.zte@gmail.com wrote:
> From: ye xingchen <ye.xingchen@zte.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@zte.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;
> }
>

\
 
 \ /
  Last update: 2022-09-27 15:05    [W:0.028 / U:1.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site