Skip to contentSkip to conversation

drivers: memory: bt1-l2-ctl: replace scnprintf() with sysfs_emit()

PATCH Applied Salah Triki 3 participants 3 messages May 5, 2025 – May 7, 2025 Memory controller drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: memory: bt1-l2-ctl: replace scnprintf() with sysfs_emit()

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().

---
 drivers/memory/bt1-l2-ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/bt1-l2-ctl.c +1 -1
index 78bd71b203f2..0fd96abc172a 100644
@@ -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,
Signature · 1 line
2.43.0
#1 lore raw
Quoted 5 lines · 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().

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,

Signature · 1 line
Krzysztof Kozlowski <[email protected]>
#2 lore raw
Quoted 8 lines · Krzysztof Kozlowski
Quoted 5 lines · 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().

Quoted 4 lines

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