]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
memory: bt1-l2-ctl: replace scnprintf() with sysfs_emit()
authorSalah Triki <salah.triki@gmail.com>
Mon, 5 May 2025 21:43:26 +0000 (22:43 +0100)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Wed, 7 May 2025 05:44:13 +0000 (07:44 +0200)
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>
Link: https://lore.kernel.org/r/aBkw_p9GkH2fm2UJ@pc
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
drivers/memory/bt1-l2-ctl.c

index 78bd71b203f2daa511749772f9c4b026faadc51b..0fd96abc172a19137bb2a4aeae69e846f4c902fb 100644 (file)
@@ -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,