CC: kbuild-all(a)lists.01.org TO: Denis Efremov CC: Julia Lawall CC: "James E.J. Bottomley" CC: "Martin K. Petersen" CC: linux-scsi(a)vger.kernel.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot drivers/scsi/pcmcia/sym53c500_cs.c:621:8-16: WARNING: use scnprintf or sprintf From Documentation/filesystems/sysfs.txt: show() must not use snprintf() when formatting the value to be returned to user space. If you can guarantee that an overflow will never happen you can use sprintf() otherwise you must use scnprintf(). Generated by: scripts/coccinelle/api/device_attr_show.cocci Fixes: 988676da8375 ("coccinelle: api: add device_attr_show script") CC: Denis Efremov Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.9 head: 5502a4eb3af819792a6c43b418c401f613a39d02 commit: 988676da837516bbfafda5478472fd4265f0de4e [1/3] coccinelle: api: add device_attr_show script :::::: branch date: 12 days ago :::::: commit date: 13 days ago Please take the patch only if it's a positive warning. Thanks! sym53c500_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c @@ -618,7 +618,7 @@ SYM53C500_show_pio(struct device *dev, s struct sym53c500_data *data = (struct sym53c500_data *)SHp->hostdata; - return snprintf(buf, 4, "%d\n", data->fast_pio); + return scnprintf(buf, 4, "%d\n", data->fast_pio); } static ssize_t