* [PATCH] drivers: memory: bt1-l2-ctl: replace scnprintf() with sysfs_emit()
@ 2025-05-05 21:43 Salah Triki
2025-05-07 5:44 ` Krzysztof Kozlowski
0 siblings, 1 reply; 3+ messages in thread
From: Salah Triki @ 2025-05-05 21:43 UTC (permalink / raw)
To: Krzysztof Kozlowski, linux-kernel; +Cc: salah.triki
Documentation/filesystems/sysfs.rst mentions that show() should only
use sysfs_emit() or sysfs_emit_at() when formating the value to be
returned to user space. So replace scnprintf() with sysfs_emit().
Signed-off-by: Salah Triki <salah.triki@gmail.com>
---
drivers/memory/bt1-l2-ctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/memory/bt1-l2-ctl.c b/drivers/memory/bt1-l2-ctl.c
index 78bd71b203f2..0fd96abc172a 100644
--- a/drivers/memory/bt1-l2-ctl.c
+++ b/drivers/memory/bt1-l2-ctl.c
@@ -222,7 +222,7 @@ static ssize_t l2_ctl_latency_show(struct device *dev,
if (ret)
return ret;
- return scnprintf(buf, PAGE_SIZE, "%u\n", data);
+ return sysfs_emit(buf, "%u\n", data);
}
static ssize_t l2_ctl_latency_store(struct device *dev,
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers: memory: bt1-l2-ctl: replace scnprintf() with sysfs_emit()
2025-05-05 21:43 [PATCH] drivers: memory: bt1-l2-ctl: replace scnprintf() with sysfs_emit() Salah Triki
@ 2025-05-07 5:44 ` Krzysztof Kozlowski
2025-05-07 5:45 ` Krzysztof Kozlowski
0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-07 5:44 UTC (permalink / raw)
To: Krzysztof Kozlowski, linux-kernel, Salah Triki
On Mon, 05 May 2025 22:43:26 +0100, Salah Triki wrote:
> Documentation/filesystems/sysfs.rst mentions that show() should only
> use sysfs_emit() or sysfs_emit_at() when formating the value to be
> returned to user space. So replace scnprintf() with sysfs_emit().
>
>
Applied, thanks!
[1/1] drivers: memory: bt1-l2-ctl: replace scnprintf() with sysfs_emit()
https://git.kernel.org/krzk/linux-mem-ctrl/c/03d0d7f0ef05ddd791eb37d35dcc5ca2a53d8b93
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers: memory: bt1-l2-ctl: replace scnprintf() with sysfs_emit()
2025-05-07 5:44 ` Krzysztof Kozlowski
@ 2025-05-07 5:45 ` Krzysztof Kozlowski
0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-07 5:45 UTC (permalink / raw)
To: Krzysztof Kozlowski, linux-kernel, Salah Triki
On 07/05/2025 07:44, Krzysztof Kozlowski wrote:
>
> On Mon, 05 May 2025 22:43:26 +0100, Salah Triki wrote:
>> Documentation/filesystems/sysfs.rst mentions that show() should only
>> use sysfs_emit() or sysfs_emit_at() when formating the value to be
>> returned to user space. So replace scnprintf() with sysfs_emit().
>>
>>
>
> Applied, thanks!
>
> [1/1] drivers: memory: bt1-l2-ctl: replace scnprintf() with sysfs_emit()
> https://git.kernel.org/krzk/linux-mem-ctrl/c/03d0d7f0ef05ddd791eb37d35dcc5ca2a53d8b93
In the future:
Please use subject prefixes matching the subsystem. You can get them for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching. For bindings, the preferred subjects are
explained here:
https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-07 5:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-05 21:43 [PATCH] drivers: memory: bt1-l2-ctl: replace scnprintf() with sysfs_emit() Salah Triki
2025-05-07 5:44 ` Krzysztof Kozlowski
2025-05-07 5:45 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox