linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] platform/chrome: use sysfs_emit() instead of sprintf()
@ 2024-03-14  5:28 Ai Chao
  2024-03-14  8:35 ` Tzung-Bi Shih
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ai Chao @ 2024-03-14  5:28 UTC (permalink / raw)
  To: bleung, tzungbi, chrome-platform, linux-kernel; +Cc: Ai Chao

Follow the advice in Documentation/filesystems/sysfs.rst:
show() should only use sysfs_emit() or sysfs_emit_at() when formatting
the value to be returned to user space.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/platform/chrome/wilco_ec/sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/chrome/wilco_ec/sysfs.c b/drivers/platform/chrome/wilco_ec/sysfs.c
index 893c59dde32a..d44c43559621 100644
--- a/drivers/platform/chrome/wilco_ec/sysfs.c
+++ b/drivers/platform/chrome/wilco_ec/sysfs.c
@@ -192,7 +192,7 @@ static ssize_t usb_charge_show(struct device *dev,
 	if (ret < 0)
 		return ret;
 
-	return sprintf(buf, "%d\n", rs.val);
+	return sysfs_emit(buf, "%d\n", rs.val);
 }
 
 static ssize_t usb_charge_store(struct device *dev,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] platform/chrome: use sysfs_emit() instead of sprintf()
  2024-03-14  5:28 [PATCH v1] platform/chrome: use sysfs_emit() instead of sprintf() Ai Chao
@ 2024-03-14  8:35 ` Tzung-Bi Shih
  2024-03-25  2:40 ` patchwork-bot+chrome-platform
  2024-03-25  2:40 ` patchwork-bot+chrome-platform
  2 siblings, 0 replies; 4+ messages in thread
From: Tzung-Bi Shih @ 2024-03-14  8:35 UTC (permalink / raw)
  To: Ai Chao; +Cc: bleung, chrome-platform, linux-kernel

On Thu, Mar 14, 2024 at 01:28:28PM +0800, Ai Chao wrote:
> Follow the advice in Documentation/filesystems/sysfs.rst:
> show() should only use sysfs_emit() or sysfs_emit_at() when formatting
> the value to be returned to user space.

It seems we overlooked the case when handling [1].  Will queue the patch
after for-next rebased to next -rc1.

[1] https://patchwork.kernel.org/project/chrome-platform/patch/202212021656040995199@zte.com.cn/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] platform/chrome: use sysfs_emit() instead of sprintf()
  2024-03-14  5:28 [PATCH v1] platform/chrome: use sysfs_emit() instead of sprintf() Ai Chao
  2024-03-14  8:35 ` Tzung-Bi Shih
@ 2024-03-25  2:40 ` patchwork-bot+chrome-platform
  2024-03-25  2:40 ` patchwork-bot+chrome-platform
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+chrome-platform @ 2024-03-25  2:40 UTC (permalink / raw)
  To: Ai Chao; +Cc: bleung, tzungbi, chrome-platform, linux-kernel

Hello:

This patch was applied to chrome-platform/linux.git (for-kernelci)
by Tzung-Bi Shih <tzungbi@kernel.org>:

On Thu, 14 Mar 2024 13:28:28 +0800 you wrote:
> Follow the advice in Documentation/filesystems/sysfs.rst:
> show() should only use sysfs_emit() or sysfs_emit_at() when formatting
> the value to be returned to user space.
> 
> Signed-off-by: Ai Chao <aichao@kylinos.cn>
> ---
>  drivers/platform/chrome/wilco_ec/sysfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [v1] platform/chrome: use sysfs_emit() instead of sprintf()
    https://git.kernel.org/chrome-platform/c/f7496450528b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] platform/chrome: use sysfs_emit() instead of sprintf()
  2024-03-14  5:28 [PATCH v1] platform/chrome: use sysfs_emit() instead of sprintf() Ai Chao
  2024-03-14  8:35 ` Tzung-Bi Shih
  2024-03-25  2:40 ` patchwork-bot+chrome-platform
@ 2024-03-25  2:40 ` patchwork-bot+chrome-platform
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+chrome-platform @ 2024-03-25  2:40 UTC (permalink / raw)
  To: Ai Chao; +Cc: bleung, tzungbi, chrome-platform, linux-kernel

Hello:

This patch was applied to chrome-platform/linux.git (for-next)
by Tzung-Bi Shih <tzungbi@kernel.org>:

On Thu, 14 Mar 2024 13:28:28 +0800 you wrote:
> Follow the advice in Documentation/filesystems/sysfs.rst:
> show() should only use sysfs_emit() or sysfs_emit_at() when formatting
> the value to be returned to user space.
> 
> Signed-off-by: Ai Chao <aichao@kylinos.cn>
> ---
>  drivers/platform/chrome/wilco_ec/sysfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [v1] platform/chrome: use sysfs_emit() instead of sprintf()
    https://git.kernel.org/chrome-platform/c/f7496450528b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-25  2:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-14  5:28 [PATCH v1] platform/chrome: use sysfs_emit() instead of sprintf() Ai Chao
2024-03-14  8:35 ` Tzung-Bi Shih
2024-03-25  2:40 ` patchwork-bot+chrome-platform
2024-03-25  2:40 ` patchwork-bot+chrome-platform

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).