* Re: [PATCH linux-next] platform/x86: use sysfs_emit() and add the '\n'
[not found] <20220923063233.239091-1-ye.xingchen@zte.com.cn>
@ 2022-09-27 13:04 ` Hans de Goede
0 siblings, 0 replies; only message in thread
From: Hans de Goede @ 2022-09-27 13:04 UTC (permalink / raw)
To: cgel.zte; +Cc: markgross, platform-driver-x86, linux-kernel, ye xingchen
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;
> }
>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-27 13:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20220923063233.239091-1-ye.xingchen@zte.com.cn>
2022-09-27 13:04 ` [PATCH linux-next] platform/x86: use sysfs_emit() and add the '\n' Hans de Goede
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.