All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/acpi/bgrt.c:28:8-16: WARNING: use scnprintf or sprintf
@ 2020-12-29  4:59 kernel test robot
  2020-12-29  4:59 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
  0 siblings, 1 reply; 99+ messages in thread
From: kernel test robot @ 2020-12-29  4:59 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1297 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dea8dcf2a9fa8cc540136a6cd885c3beece16ec3
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
date:   5 months ago
:::::: branch date: 7 hours ago
:::::: commit date: 5 months ago
config: x86_64-randconfig-c002-20201228 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


"coccinelle warnings: (new ones prefixed by >>)"
>> drivers/acpi/bgrt.c:28:8-16: WARNING: use scnprintf or sprintf
   drivers/acpi/bgrt.c:35:8-16: WARNING: use scnprintf or sprintf
   drivers/acpi/bgrt.c:21:8-16: WARNING: use scnprintf or sprintf
   drivers/acpi/bgrt.c:42:8-16: WARNING: use scnprintf or sprintf
   drivers/acpi/bgrt.c:49:8-16: WARNING: use scnprintf or sprintf

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34644 bytes --]

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-29  4:59 drivers/acpi/bgrt.c:28:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-12-29  4:59 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-29  4:59 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3250 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "Rafael J. Wysocki" <rjw@rjwysocki.net>
CC: Len Brown <lenb@kernel.org>
CC: linux-acpi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/acpi/bgrt.c:28:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/bgrt.c:35:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/bgrt.c:21:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/bgrt.c:42:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/bgrt.c:49: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dea8dcf2a9fa8cc540136a6cd885c3beece16ec3
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 7 hours ago
:::::: commit date: 5 months ago

Please take the patch only if it's a positive warning. Thanks!

 bgrt.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/acpi/bgrt.c
+++ b/drivers/acpi/bgrt.c
@@ -18,35 +18,35 @@ static struct kobject *bgrt_kobj;
 static ssize_t show_version(struct device *dev,
 			    struct device_attribute *attr, char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.version);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.version);
 }
 static DEVICE_ATTR(version, S_IRUGO, show_version, NULL);
 
 static ssize_t show_status(struct device *dev,
 			   struct device_attribute *attr, char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.status);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.status);
 }
 static DEVICE_ATTR(status, S_IRUGO, show_status, NULL);
 
 static ssize_t show_type(struct device *dev,
 			 struct device_attribute *attr, char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.image_type);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.image_type);
 }
 static DEVICE_ATTR(type, S_IRUGO, show_type, NULL);
 
 static ssize_t show_xoffset(struct device *dev,
 			    struct device_attribute *attr, char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.image_offset_x);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.image_offset_x);
 }
 static DEVICE_ATTR(xoffset, S_IRUGO, show_xoffset, NULL);
 
 static ssize_t show_yoffset(struct device *dev,
 			    struct device_attribute *attr, char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.image_offset_y);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.image_offset_y);
 }
 static DEVICE_ATTR(yoffset, S_IRUGO, show_yoffset, NULL);
 

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

* Re: [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
       [not found] <86ae66c7-927b-d41b-f097-b46f28943f58@linux.com>
@ 2020-12-30  1:19 ` Rong Chen
  0 siblings, 0 replies; 99+ messages in thread
From: Rong Chen @ 2020-12-30  1:19 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 4081 bytes --]

Hi Denis,

Thanks for your reminding, we have ignored this warning.

Best Regards,
Rong Chen

On 12/29/20 2:41 PM, Denis Efremov wrote:
> Hi,
>
> Could you please disable automatic emails based on this rule?
> The rule requires an update after sysfs_emit patchset by Joe Perches
> was merged.
> https://lore.kernel.org/linux-pm/5d606519698ce4c8f1203a2b35797d8254c6050a.1600285923.git.joe(a)perches.com/T/
>
> I'll prepare an update for the rule.
>
> Thanks,
> Denis
>
>
> On 12/29/20 7:59 AM, kernel test robot wrote:
>> CC: kbuild-all(a)lists.01.org
>> CC: linux-kernel(a)vger.kernel.org
>> TO: Denis Efremov <efremov@linux.com>
>> CC: Julia Lawall <Julia.Lawall@lip6.fr>
>> CC: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>> CC: Len Brown <lenb@kernel.org>
>> CC: linux-acpi(a)vger.kernel.org
>> CC: linux-kernel(a)vger.kernel.org
>>
>> From: kernel test robot <lkp@intel.com>
>>
>> drivers/acpi/bgrt.c:28:8-16: WARNING: use scnprintf or sprintf
>> drivers/acpi/bgrt.c:35:8-16: WARNING: use scnprintf or sprintf
>> drivers/acpi/bgrt.c:21:8-16: WARNING: use scnprintf or sprintf
>> drivers/acpi/bgrt.c:42:8-16: WARNING: use scnprintf or sprintf
>> drivers/acpi/bgrt.c:49: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
>> CC: Denis Efremov <efremov@linux.com>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Signed-off-by: kernel test robot <lkp@intel.com>
>> ---
>>
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> head:   dea8dcf2a9fa8cc540136a6cd885c3beece16ec3
>> commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
>> :::::: branch date: 7 hours ago
>> :::::: commit date: 5 months ago
>>
>> Please take the patch only if it's a positive warning. Thanks!
>>
>>   bgrt.c |   10 +++++-----
>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> --- a/drivers/acpi/bgrt.c
>> +++ b/drivers/acpi/bgrt.c
>> @@ -18,35 +18,35 @@ static struct kobject *bgrt_kobj;
>>   static ssize_t show_version(struct device *dev,
>>   			    struct device_attribute *attr, char *buf)
>>   {
>> -	return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.version);
>> +	return scnprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.version);
>>   }
>>   static DEVICE_ATTR(version, S_IRUGO, show_version, NULL);
>>   
>>   static ssize_t show_status(struct device *dev,
>>   			   struct device_attribute *attr, char *buf)
>>   {
>> -	return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.status);
>> +	return scnprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.status);
>>   }
>>   static DEVICE_ATTR(status, S_IRUGO, show_status, NULL);
>>   
>>   static ssize_t show_type(struct device *dev,
>>   			 struct device_attribute *attr, char *buf)
>>   {
>> -	return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.image_type);
>> +	return scnprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.image_type);
>>   }
>>   static DEVICE_ATTR(type, S_IRUGO, show_type, NULL);
>>   
>>   static ssize_t show_xoffset(struct device *dev,
>>   			    struct device_attribute *attr, char *buf)
>>   {
>> -	return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.image_offset_x);
>> +	return scnprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.image_offset_x);
>>   }
>>   static DEVICE_ATTR(xoffset, S_IRUGO, show_xoffset, NULL);
>>   
>>   static ssize_t show_yoffset(struct device *dev,
>>   			    struct device_attribute *attr, char *buf)
>>   {
>> -	return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.image_offset_y);
>> +	return scnprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.image_offset_y);
>>   }
>>   static DEVICE_ATTR(yoffset, S_IRUGO, show_yoffset, NULL);
>>   
>>

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-29  7:35 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:1950:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-12-29  7:35 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-29  7:35 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2043 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: "Christian König" <christian.koenig@amd.com>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: amd-gfx(a)lists.freedesktop.org
CC: dri-devel(a)lists.freedesktop.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:1950: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dea8dcf2a9fa8cc540136a6cd885c3beece16ec3
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 10 hours ago
:::::: commit date: 5 months ago

Please take the patch only if it's a positive warning. Thanks!

 amdgpu_atombios.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
@@ -1947,7 +1947,7 @@ static ssize_t amdgpu_atombios_get_vbios
 	struct amdgpu_device *adev = drm_to_adev(ddev);
 	struct atom_context *ctx = adev->mode_info.atom_context;
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", ctx->vbios_version);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", ctx->vbios_version);
 }
 
 static DEVICE_ATTR(vbios_version, 0444, amdgpu_atombios_get_vbios_version,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-27 20:04 drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (7 preceding siblings ...)
  2020-12-27 20:05 ` kernel test robot
@ 2020-12-27 20:05 ` kernel test robot
  8 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-27 20:05 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2042 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Pablo Neira Ayuso <pablo@netfilter.org>
CC: Jozsef Kadlecsik <kadlec@netfilter.org>
CC: Florian Westphal <fw@strlen.de>
CC: Jakub Kicinski <kuba@kernel.org>
CC: netfilter-devel(a)vger.kernel.org
CC: coreteam(a)netfilter.org
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

net/netfilter/xt_IDLETIMER.c:88:9-17: 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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   52cd5f9c22eeef26d05f9d9338ba4eb38f14dd3a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 3 hours ago
:::::: commit date: 5 months ago

Please take the patch only if it's a positive warning. Thanks!

 xt_IDLETIMER.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/net/netfilter/xt_IDLETIMER.c
+++ b/net/netfilter/xt_IDLETIMER.c
@@ -85,9 +85,9 @@ static ssize_t idletimer_tg_show(struct
 	mutex_unlock(&list_mutex);
 
 	if (time_after(expires, jiffies) || ktimespec.tv_sec > 0)
-		return snprintf(buf, PAGE_SIZE, "%ld\n", time_diff);
+		return scnprintf(buf, PAGE_SIZE, "%ld\n", time_diff);
 
-	return snprintf(buf, PAGE_SIZE, "0\n");
+	return scnprintf(buf, PAGE_SIZE, "0\n");
 }
 
 static void idletimer_tg_work(struct work_struct *work)

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-27 20:04 drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (6 preceding siblings ...)
  2020-12-27 20:05 ` kernel test robot
@ 2020-12-27 20:05 ` kernel test robot
  2020-12-27 20:05 ` kernel test robot
  8 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-27 20:05 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3940 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Michal Januszewski <spock@gentoo.org>
CC: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
CC: linux-fbdev(a)vger.kernel.org
CC: dri-devel(a)lists.freedesktop.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/video/fbdev/uvesafb.c:1640:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/uvesafb.c:1626:9-17: WARNING: use scnprintf or sprintf
drivers/video/fbdev/uvesafb.c:1596:9-17: WARNING: use scnprintf or sprintf
drivers/video/fbdev/uvesafb.c:1611:9-17: WARNING: use scnprintf or sprintf
drivers/video/fbdev/uvesafb.c:1550:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/uvesafb.c:1581:9-17: 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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   52cd5f9c22eeef26d05f9d9338ba4eb38f14dd3a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 3 hours ago
:::::: commit date: 5 months ago

Please take the patch only if it's a positive warning. Thanks!

 uvesafb.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -1547,7 +1547,7 @@ static ssize_t uvesafb_show_vbe_ver(stru
 	struct fb_info *info = dev_get_drvdata(dev);
 	struct uvesafb_par *par = info->par;
 
-	return snprintf(buf, PAGE_SIZE, "%.4x\n", par->vbe_ib.vbe_version);
+	return scnprintf(buf, PAGE_SIZE, "%.4x\n", par->vbe_ib.vbe_version);
 }
 
 static DEVICE_ATTR(vbe_version, S_IRUGO, uvesafb_show_vbe_ver, NULL);
@@ -1578,7 +1578,7 @@ static ssize_t uvesafb_show_vendor(struc
 	struct uvesafb_par *par = info->par;
 
 	if (par->vbe_ib.oem_vendor_name_ptr)
-		return snprintf(buf, PAGE_SIZE, "%s\n", (char *)
+		return scnprintf(buf, PAGE_SIZE, "%s\n", (char *)
 			(&par->vbe_ib) + par->vbe_ib.oem_vendor_name_ptr);
 	else
 		return 0;
@@ -1593,7 +1593,7 @@ static ssize_t uvesafb_show_product_name
 	struct uvesafb_par *par = info->par;
 
 	if (par->vbe_ib.oem_product_name_ptr)
-		return snprintf(buf, PAGE_SIZE, "%s\n", (char *)
+		return scnprintf(buf, PAGE_SIZE, "%s\n", (char *)
 			(&par->vbe_ib) + par->vbe_ib.oem_product_name_ptr);
 	else
 		return 0;
@@ -1608,7 +1608,7 @@ static ssize_t uvesafb_show_product_rev(
 	struct uvesafb_par *par = info->par;
 
 	if (par->vbe_ib.oem_product_rev_ptr)
-		return snprintf(buf, PAGE_SIZE, "%s\n", (char *)
+		return scnprintf(buf, PAGE_SIZE, "%s\n", (char *)
 			(&par->vbe_ib) + par->vbe_ib.oem_product_rev_ptr);
 	else
 		return 0;
@@ -1623,7 +1623,7 @@ static ssize_t uvesafb_show_oem_string(s
 	struct uvesafb_par *par = info->par;
 
 	if (par->vbe_ib.oem_string_ptr)
-		return snprintf(buf, PAGE_SIZE, "%s\n",
+		return scnprintf(buf, PAGE_SIZE, "%s\n",
 			(char *)(&par->vbe_ib) + par->vbe_ib.oem_string_ptr);
 	else
 		return 0;
@@ -1637,7 +1637,7 @@ static ssize_t uvesafb_show_nocrtc(struc
 	struct fb_info *info = dev_get_drvdata(dev);
 	struct uvesafb_par *par = info->par;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", par->nocrtc);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", par->nocrtc);
 }
 
 static ssize_t uvesafb_store_nocrtc(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-27 20:04 drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (5 preceding siblings ...)
  2020-12-27 20:05 ` kernel test robot
@ 2020-12-27 20:05 ` kernel test robot
  2020-12-27 20:05 ` kernel test robot
  2020-12-27 20:05 ` kernel test robot
  8 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-27 20:05 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1815 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
CC: dri-devel(a)lists.freedesktop.org
CC: linux-fbdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/video/fbdev/sm501fb.c:1169: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   52cd5f9c22eeef26d05f9d9338ba4eb38f14dd3a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 3 hours ago
:::::: commit date: 5 months ago

Please take the patch only if it's a positive warning. Thanks!

 sm501fb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -1166,7 +1166,7 @@ static ssize_t sm501fb_crtsrc_show(struc
 	ctrl = smc501_readl(info->regs + SM501_DC_CRT_CONTROL);
 	ctrl &= SM501_DC_CRT_CONTROL_SEL;
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", ctrl ? "crt" : "panel");
+	return scnprintf(buf, PAGE_SIZE, "%s\n", ctrl ? "crt" : "panel");
 }
 
 /* sm501fb_crtsrc_show

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-27 20:04 drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (4 preceding siblings ...)
  2020-12-27 20:05 ` kernel test robot
@ 2020-12-27 20:05 ` kernel test robot
  2020-12-27 20:05 ` kernel test robot
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-27 20:05 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 4773 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Jean Delvare <jdelvare@suse.com>
CC: Guenter Roeck <linux@roeck-us.net>
CC: linux-hwmon(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/hwmon/sch5636.c:275:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:261:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:247:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:187:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:179:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:163:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:230:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:216:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:202: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   52cd5f9c22eeef26d05f9d9338ba4eb38f14dd3a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 3 hours ago
:::::: commit date: 5 months ago

Please take the patch only if it's a positive warning. Thanks!

 sch5636.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

--- a/drivers/hwmon/sch5636.c
+++ b/drivers/hwmon/sch5636.c
@@ -160,7 +160,7 @@ static int reg_to_rpm(u16 reg)
 static ssize_t name_show(struct device *dev, struct device_attribute *devattr,
 			 char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "%s\n", DEVNAME);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", DEVNAME);
 }
 
 static ssize_t in_value_show(struct device *dev,
@@ -176,7 +176,7 @@ static ssize_t in_value_show(struct devi
 	val = DIV_ROUND_CLOSEST(
 		data->in[attr->index] * SCH5636_REG_IN_FACTORS[attr->index],
 		255);
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t in_label_show(struct device *dev,
@@ -184,7 +184,7 @@ static ssize_t in_label_show(struct devi
 {
 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 
-	return snprintf(buf, PAGE_SIZE, "%s\n",
+	return scnprintf(buf, PAGE_SIZE, "%s\n",
 			SCH5636_IN_LABELS[attr->index]);
 }
 
@@ -199,7 +199,7 @@ static ssize_t temp_value_show(struct de
 		return PTR_ERR(data);
 
 	val = (data->temp_val[attr->index] - 64) * 1000;
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t temp_fault_show(struct device *dev,
@@ -213,7 +213,7 @@ static ssize_t temp_fault_show(struct de
 		return PTR_ERR(data);
 
 	val = (data->temp_ctrl[attr->index] & SCH5636_TEMP_WORKING) ? 0 : 1;
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t temp_alarm_show(struct device *dev,
@@ -227,7 +227,7 @@ static ssize_t temp_alarm_show(struct de
 		return PTR_ERR(data);
 
 	val = (data->temp_ctrl[attr->index] & SCH5636_TEMP_ALARM) ? 1 : 0;
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t fan_value_show(struct device *dev,
@@ -244,7 +244,7 @@ static ssize_t fan_value_show(struct dev
 	if (val < 0)
 		return val;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t fan_fault_show(struct device *dev,
@@ -258,7 +258,7 @@ static ssize_t fan_fault_show(struct dev
 		return PTR_ERR(data);
 
 	val = (data->fan_ctrl[attr->index] & SCH5636_FAN_NOT_PRESENT) ? 1 : 0;
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t fan_alarm_show(struct device *dev,
@@ -272,7 +272,7 @@ static ssize_t fan_alarm_show(struct dev
 		return PTR_ERR(data);
 
 	val = (data->fan_ctrl[attr->index] & SCH5636_FAN_ALARM) ? 1 : 0;
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static struct sensor_device_attribute sch5636_attr[] = {

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-27 20:04 drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (3 preceding siblings ...)
  2020-12-27 20:04 ` kernel test robot
@ 2020-12-27 20:05 ` kernel test robot
  2020-12-27 20:05 ` kernel test robot
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-27 20:05 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2138 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Richard Cochran <richardcochran@gmail.com>
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/ptp/ptp_sysfs.c:16:8-16: WARNING: use scnprintf or sprintf
drivers/ptp/ptp_sysfs.c:230: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   52cd5f9c22eeef26d05f9d9338ba4eb38f14dd3a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 3 hours ago
:::::: commit date: 5 months ago

Please take the patch only if it's a positive warning. Thanks!

 ptp_sysfs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/ptp/ptp_sysfs.c
+++ b/drivers/ptp/ptp_sysfs.c
@@ -13,7 +13,7 @@ static ssize_t clock_name_show(struct de
 			       struct device_attribute *attr, char *page)
 {
 	struct ptp_clock *ptp = dev_get_drvdata(dev);
-	return snprintf(page, PAGE_SIZE-1, "%s\n", ptp->info->name);
+	return scnprintf(page, PAGE_SIZE-1, "%s\n", ptp->info->name);
 }
 static DEVICE_ATTR_RO(clock_name);
 
@@ -227,7 +227,7 @@ static ssize_t ptp_pin_show(struct devic
 
 	mutex_unlock(&ptp->pincfg_mux);
 
-	return snprintf(page, PAGE_SIZE, "%u %u\n", func, chan);
+	return scnprintf(page, PAGE_SIZE, "%u %u\n", func, chan);
 }
 
 static ssize_t ptp_pin_store(struct device *dev, struct device_attribute *attr,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-27 20:04 drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (2 preceding siblings ...)
  2020-12-27 20:04 ` kernel test robot
@ 2020-12-27 20:04 ` kernel test robot
  2020-12-27 20:05 ` kernel test robot
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-27 20:04 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2146 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Guenter Roeck <linux@roeck-us.net>
CC: Jean Delvare <jdelvare@suse.com>
CC: linux-hwmon(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/hwmon/ltc4261.c:150:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/ltc4261.c:133: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   52cd5f9c22eeef26d05f9d9338ba4eb38f14dd3a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 3 hours ago
:::::: commit date: 5 months ago

Please take the patch only if it's a positive warning. Thanks!

 ltc4261.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/hwmon/ltc4261.c
+++ b/drivers/hwmon/ltc4261.c
@@ -130,7 +130,7 @@ static ssize_t ltc4261_value_show(struct
 		return PTR_ERR(data);
 
 	value = ltc4261_get_value(data, attr->index);
-	return snprintf(buf, PAGE_SIZE, "%d\n", value);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", value);
 }
 
 static ssize_t ltc4261_bool_show(struct device *dev,
@@ -147,7 +147,7 @@ static ssize_t ltc4261_bool_show(struct
 	if (fault)		/* Clear reported faults in chip register */
 		i2c_smbus_write_byte_data(data->client, LTC4261_FAULT, ~fault);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", fault ? 1 : 0);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", fault ? 1 : 0);
 }
 
 /*

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-27 20:04 drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-12-27 20:04 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
  2020-12-27 20:04 ` kernel test robot
@ 2020-12-27 20:04 ` kernel test robot
  2020-12-27 20:04 ` kernel test robot
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-27 20:04 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Jean Delvare <jdelvare@suse.com>
CC: Guenter Roeck <linux@roeck-us.net>
CC: linux-hwmon(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/hwmon/ltc4151.c:131: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   52cd5f9c22eeef26d05f9d9338ba4eb38f14dd3a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 3 hours ago
:::::: commit date: 5 months ago

Please take the patch only if it's a positive warning. Thanks!

 ltc4151.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/hwmon/ltc4151.c
+++ b/drivers/hwmon/ltc4151.c
@@ -128,7 +128,7 @@ static ssize_t ltc4151_value_show(struct
 		return PTR_ERR(data);
 
 	value = ltc4151_get_value(data, attr->index);
-	return snprintf(buf, PAGE_SIZE, "%d\n", value);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", value);
 }
 
 /*

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-27 20:04 drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-12-27 20:04 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
@ 2020-12-27 20:04 ` kernel test robot
  2020-12-27 20:04 ` kernel test robot
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-27 20:04 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2432 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "Bruno Prémont" <bonbons@linux-vserver.org>
CC: Jiri Kosina <jikos@kernel.org>
CC: Benjamin Tissoires <benjamin.tissoires@redhat.com>
CC: linux-input(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-picolcd_core.c:304:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-picolcd_core.c:259:9-17: 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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   52cd5f9c22eeef26d05f9d9338ba4eb38f14dd3a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 3 hours ago
:::::: commit date: 5 months ago

Please take the patch only if it's a positive warning. Thanks!

 hid-picolcd_core.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/hid/hid-picolcd_core.c
+++ b/drivers/hid/hid-picolcd_core.c
@@ -256,9 +256,9 @@ static ssize_t picolcd_operation_mode_sh
 	struct picolcd_data *data = dev_get_drvdata(dev);
 
 	if (data->status & PICOLCD_BOOTLOADER)
-		return snprintf(buf, PAGE_SIZE, "[bootloader] lcd\n");
+		return scnprintf(buf, PAGE_SIZE, "[bootloader] lcd\n");
 	else
-		return snprintf(buf, PAGE_SIZE, "bootloader [lcd]\n");
+		return scnprintf(buf, PAGE_SIZE, "bootloader [lcd]\n");
 }
 
 static ssize_t picolcd_operation_mode_store(struct device *dev,
@@ -301,7 +301,7 @@ static ssize_t picolcd_operation_mode_de
 {
 	struct picolcd_data *data = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%hu\n", data->opmode_delay);
+	return scnprintf(buf, PAGE_SIZE, "%hu\n", data->opmode_delay);
 }
 
 static ssize_t picolcd_operation_mode_delay_store(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-27 20:04 drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-12-27 20:04 ` kernel test robot
  2020-12-27 20:04 ` kernel test robot
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-27 20:04 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2285 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Borislav Petkov <bp@alien8.de>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Tony Luck <tony.luck@intel.com>
CC: James Morse <james.morse@arm.com>
CC: Robert Richter <rrichter@marvell.com>
CC: linux-edac(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf
drivers/edac/edac_mc_sysfs.c:494: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   52cd5f9c22eeef26d05f9d9338ba4eb38f14dd3a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 3 hours ago
:::::: commit date: 5 months ago

Please take the patch only if it's a positive warning. Thanks!

 edac_mc_sysfs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -207,7 +207,7 @@ static ssize_t channel_dimm_label_show(s
 	if (!rank->dimm->label[0])
 		return 0;
 
-	return snprintf(data, sizeof(rank->dimm->label) + 1, "%s\n",
+	return scnprintf(data, sizeof(rank->dimm->label) + 1, "%s\n",
 			rank->dimm->label);
 }
 
@@ -491,7 +491,7 @@ static ssize_t dimmdev_label_show(struct
 	if (!dimm->label[0])
 		return 0;
 
-	return snprintf(data, sizeof(dimm->label) + 1, "%s\n", dimm->label);
+	return scnprintf(data, sizeof(dimm->label) + 1, "%s\n", dimm->label);
 }
 
 static ssize_t dimmdev_label_store(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-14 17:27 drivers/hid/hid-sensor-custom.c:371:10-18: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-12-14 17:27 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-14 17:27 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1959 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Jiri Kosina <jikos@kernel.org>
CC: Jonathan Cameron <jic23@kernel.org>
CC: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
CC: Benjamin Tissoires <benjamin.tissoires@redhat.com>
CC: linux-input(a)vger.kernel.org
CC: linux-iio(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-sensor-custom.c:371:10-18: 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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2c85ebc57b3e1817b6ce1a6b703928e113a90442
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 19 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 hid-sensor-custom.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/hid/hid-sensor-custom.c
+++ b/drivers/hid/hid-sensor-custom.c
@@ -368,7 +368,7 @@ static ssize_t show_value(struct device
 				     sizeof(struct hid_custom_usage_desc),
 				     usage_id_cmp);
 		if (usage_desc)
-			return snprintf(buf, PAGE_SIZE, "%s\n",
+			return scnprintf(buf, PAGE_SIZE, "%s\n",
 					usage_desc->desc);
 		else
 			return sprintf(buf, "not-specified\n");

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-14 15:10 mm/backing-dev.c:209:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (4 preceding siblings ...)
  2020-12-14 15:10 ` kernel test robot
@ 2020-12-14 15:10 ` kernel test robot
  5 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-14 15:10 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1820 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Miquel Raynal <miquel.raynal@bootlin.com>
CC: Richard Weinberger <richard@nod.at>
CC: Vignesh Raghavendra <vigneshr@ti.com>
CC: linux-mtd(a)lists.infradead.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/mtd/mtdpart.c:220: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2c85ebc57b3e1817b6ce1a6b703928e113a90442
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 16 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 mtdpart.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -217,7 +217,7 @@ static ssize_t mtd_partition_offset_show
 {
 	struct mtd_info *mtd = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%lld\n", mtd->part.offset);
+	return scnprintf(buf, PAGE_SIZE, "%lld\n", mtd->part.offset);
 }
 
 static DEVICE_ATTR(offset, S_IRUGO, mtd_partition_offset_show, NULL);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-14 15:10 mm/backing-dev.c:209:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (3 preceding siblings ...)
  2020-12-14 15:10 ` kernel test robot
@ 2020-12-14 15:10 ` kernel test robot
  2020-12-14 15:10 ` kernel test robot
  5 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-14 15:10 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2211 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Jens Axboe <axboe@kernel.dk>
CC: linux-ide(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/ata/libata-sata.c:954:8-16: WARNING: use scnprintf or sprintf
drivers/ata/libata-sata.c:830: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2c85ebc57b3e1817b6ce1a6b703928e113a90442
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 16 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 libata-sata.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/ata/libata-sata.c
+++ b/drivers/ata/libata-sata.c
@@ -827,7 +827,7 @@ static ssize_t ata_scsi_lpm_show(struct
 	if (ap->target_lpm_policy >= ARRAY_SIZE(ata_lpm_policy_names))
 		return -EINVAL;
 
-	return snprintf(buf, PAGE_SIZE, "%s\n",
+	return scnprintf(buf, PAGE_SIZE, "%s\n",
 			ata_lpm_policy_names[ap->target_lpm_policy]);
 }
 DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR,
@@ -951,7 +951,7 @@ ata_scsi_em_message_type_show(struct dev
 	struct Scsi_Host *shost = class_to_shost(dev);
 	struct ata_port *ap = ata_shost_to_port(shost);
 
-	return snprintf(buf, 23, "%d\n", ap->em_message_type);
+	return scnprintf(buf, 23, "%d\n", ap->em_message_type);
 }
 DEVICE_ATTR(em_message_type, S_IRUGO,
 		  ata_scsi_em_message_type_show, NULL);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-14 15:10 mm/backing-dev.c:209:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (2 preceding siblings ...)
  2020-12-14 15:10 ` kernel test robot
@ 2020-12-14 15:10 ` kernel test robot
  2020-12-14 15:10 ` kernel test robot
  2020-12-14 15:10 ` kernel test robot
  5 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-14 15:10 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 4361 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
CC: dri-devel(a)lists.freedesktop.org
CC: linux-fbdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/video/fbdev/core/fbsysfs.c:233:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/core/fbsysfs.c:421:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/core/fbsysfs.c:393:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/core/fbsysfs.c:384:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/core/fbsysfs.c:260:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/core/fbsysfs.c:296:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/core/fbsysfs.c:288: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2c85ebc57b3e1817b6ce1a6b703928e113a90442
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 16 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 fbsysfs.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

--- a/drivers/video/fbdev/core/fbsysfs.c
+++ b/drivers/video/fbdev/core/fbsysfs.c
@@ -230,7 +230,7 @@ static ssize_t show_bpp(struct device *d
 			char *buf)
 {
 	struct fb_info *fb_info = dev_get_drvdata(device);
-	return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->var.bits_per_pixel);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", fb_info->var.bits_per_pixel);
 }
 
 static ssize_t store_rotate(struct device *device,
@@ -257,7 +257,7 @@ static ssize_t show_rotate(struct device
 {
 	struct fb_info *fb_info = dev_get_drvdata(device);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->var.rotate);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", fb_info->var.rotate);
 }
 
 static ssize_t store_virtual(struct device *device,
@@ -285,7 +285,7 @@ static ssize_t show_virtual(struct devic
 			    struct device_attribute *attr, char *buf)
 {
 	struct fb_info *fb_info = dev_get_drvdata(device);
-	return snprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xres_virtual,
+	return scnprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xres_virtual,
 			fb_info->var.yres_virtual);
 }
 
@@ -293,7 +293,7 @@ static ssize_t show_stride(struct device
 			   struct device_attribute *attr, char *buf)
 {
 	struct fb_info *fb_info = dev_get_drvdata(device);
-	return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->fix.line_length);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", fb_info->fix.line_length);
 }
 
 static ssize_t store_blank(struct device *device,
@@ -381,7 +381,7 @@ static ssize_t show_pan(struct device *d
 			struct device_attribute *attr, char *buf)
 {
 	struct fb_info *fb_info = dev_get_drvdata(device);
-	return snprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xoffset,
+	return scnprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xoffset,
 			fb_info->var.yoffset);
 }
 
@@ -390,7 +390,7 @@ static ssize_t show_name(struct device *
 {
 	struct fb_info *fb_info = dev_get_drvdata(device);
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", fb_info->fix.id);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", fb_info->fix.id);
 }
 
 static ssize_t store_fbstate(struct device *device,
@@ -418,7 +418,7 @@ static ssize_t show_fbstate(struct devic
 			    struct device_attribute *attr, char *buf)
 {
 	struct fb_info *fb_info = dev_get_drvdata(device);
-	return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->state);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", fb_info->state);
 }
 
 #if IS_ENABLED(CONFIG_FB_BACKLIGHT)

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-14 15:10 mm/backing-dev.c:209:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-12-14 15:10 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
  2020-12-14 15:10 ` kernel test robot
@ 2020-12-14 15:10 ` kernel test robot
  2020-12-14 15:10 ` kernel test robot
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-14 15:10 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2572 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
CC: Maxime Ripard <mripard@kernel.org>
CC: Thomas Zimmermann <tzimmermann@suse.de>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: dri-devel(a)lists.freedesktop.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/gpu/drm/drm_sysfs.c:172:8-16: WARNING: use scnprintf or sprintf
drivers/gpu/drm/drm_sysfs.c:185:8-16: WARNING: use scnprintf or sprintf
drivers/gpu/drm/drm_sysfs.c:159: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2c85ebc57b3e1817b6ce1a6b703928e113a90442
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 16 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 drm_sysfs.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -156,7 +156,7 @@ static ssize_t status_show(struct device
 
 	status = READ_ONCE(connector->status);
 
-	return snprintf(buf, PAGE_SIZE, "%s\n",
+	return scnprintf(buf, PAGE_SIZE, "%s\n",
 			drm_get_connector_status_name(status));
 }
 
@@ -169,7 +169,7 @@ static ssize_t dpms_show(struct device *
 
 	dpms = READ_ONCE(connector->dpms);
 
-	return snprintf(buf, PAGE_SIZE, "%s\n",
+	return scnprintf(buf, PAGE_SIZE, "%s\n",
 			drm_get_dpms_name(dpms));
 }
 
@@ -182,7 +182,7 @@ static ssize_t enabled_show(struct devic
 
 	enabled = READ_ONCE(connector->encoder);
 
-	return snprintf(buf, PAGE_SIZE, enabled ? "enabled\n" : "disabled\n");
+	return scnprintf(buf, PAGE_SIZE, enabled ? "enabled\n" : "disabled\n");
 }
 
 static ssize_t edid_show(struct file *filp, struct kobject *kobj,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-14 15:10 mm/backing-dev.c:209:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-12-14 15:10 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
@ 2020-12-14 15:10 ` kernel test robot
  2020-12-14 15:10 ` kernel test robot
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-14 15:10 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1916 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Matt Mackall <mpm@selenic.com>
CC: Herbert Xu <herbert@gondor.apana.org.au>
CC: Arnd Bergmann <arnd@arndb.de>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: Colin Ian King <colin.king@canonical.com>
CC: linux-crypto(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/char/hw_random/core.c:399: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2c85ebc57b3e1817b6ce1a6b703928e113a90442
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 16 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -396,7 +396,7 @@ static ssize_t hwrng_attr_selected_show(
 					struct device_attribute *attr,
 					char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "%d\n", cur_rng_set_by_user);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", cur_rng_set_by_user);
 }
 
 static DEVICE_ATTR(rng_current, S_IRUGO | S_IWUSR,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-14 15:10 mm/backing-dev.c:209:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-12-14 15:10 ` kernel test robot
  2020-12-14 15:10 ` kernel test robot
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-14 15:10 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 8097 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: Christian Gromm <christian.gromm@microchip.com>
CC: Masahiro Yamada <masahiroy@kernel.org>
CC: Takashi Iwai <tiwai@suse.de>
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/most/core.c:254:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:398:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:409:9-17: WARNING: use scnprintf or sprintf
drivers/most/core.c:211:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:222:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:272:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:297:10-18: WARNING: use scnprintf or sprintf
drivers/most/core.c:326:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:282:9-17: WARNING: use scnprintf or sprintf
drivers/most/core.c:263:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:318:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:309:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:233:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:244: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2c85ebc57b3e1817b6ce1a6b703928e113a90442
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 16 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 core.c |   52 ++++++++++++++++++++++++++--------------------------
 1 file changed, 26 insertions(+), 26 deletions(-)

--- a/drivers/most/core.c
+++ b/drivers/most/core.c
@@ -208,7 +208,7 @@ static ssize_t number_of_packet_buffers_
 	struct most_channel *c = to_channel(dev);
 	unsigned int i = c->channel_id;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n",
+	return scnprintf(buf, PAGE_SIZE, "%d\n",
 			c->iface->channel_vector[i].num_buffers_packet);
 }
 
@@ -219,7 +219,7 @@ static ssize_t number_of_stream_buffers_
 	struct most_channel *c = to_channel(dev);
 	unsigned int i = c->channel_id;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n",
+	return scnprintf(buf, PAGE_SIZE, "%d\n",
 			c->iface->channel_vector[i].num_buffers_streaming);
 }
 
@@ -230,7 +230,7 @@ static ssize_t size_of_packet_buffer_sho
 	struct most_channel *c = to_channel(dev);
 	unsigned int i = c->channel_id;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n",
+	return scnprintf(buf, PAGE_SIZE, "%d\n",
 			c->iface->channel_vector[i].buffer_size_packet);
 }
 
@@ -241,7 +241,7 @@ static ssize_t size_of_stream_buffer_sho
 	struct most_channel *c = to_channel(dev);
 	unsigned int i = c->channel_id;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n",
+	return scnprintf(buf, PAGE_SIZE, "%d\n",
 			c->iface->channel_vector[i].buffer_size_streaming);
 }
 
@@ -251,7 +251,7 @@ static ssize_t channel_starving_show(str
 {
 	struct most_channel *c = to_channel(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", c->is_starving);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", c->is_starving);
 }
 
 static ssize_t set_number_of_buffers_show(struct device *dev,
@@ -260,7 +260,7 @@ static ssize_t set_number_of_buffers_sho
 {
 	struct most_channel *c = to_channel(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", c->cfg.num_buffers);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", c->cfg.num_buffers);
 }
 
 static ssize_t set_buffer_size_show(struct device *dev,
@@ -269,7 +269,7 @@ static ssize_t set_buffer_size_show(stru
 {
 	struct most_channel *c = to_channel(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", c->cfg.buffer_size);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", c->cfg.buffer_size);
 }
 
 static ssize_t set_direction_show(struct device *dev,
@@ -279,10 +279,10 @@ static ssize_t set_direction_show(struct
 	struct most_channel *c = to_channel(dev);
 
 	if (c->cfg.direction & MOST_CH_TX)
-		return snprintf(buf, PAGE_SIZE, "tx\n");
+		return scnprintf(buf, PAGE_SIZE, "tx\n");
 	else if (c->cfg.direction & MOST_CH_RX)
-		return snprintf(buf, PAGE_SIZE, "rx\n");
-	return snprintf(buf, PAGE_SIZE, "unconfigured\n");
+		return scnprintf(buf, PAGE_SIZE, "rx\n");
+	return scnprintf(buf, PAGE_SIZE, "unconfigured\n");
 }
 
 static ssize_t set_datatype_show(struct device *dev,
@@ -294,10 +294,10 @@ static ssize_t set_datatype_show(struct
 
 	for (i = 0; i < ARRAY_SIZE(ch_data_type); i++) {
 		if (c->cfg.data_type & ch_data_type[i].most_ch_data_type)
-			return snprintf(buf, PAGE_SIZE, "%s",
+			return scnprintf(buf, PAGE_SIZE, "%s",
 					ch_data_type[i].name);
 	}
-	return snprintf(buf, PAGE_SIZE, "unconfigured\n");
+	return scnprintf(buf, PAGE_SIZE, "unconfigured\n");
 }
 
 static ssize_t set_subbuffer_size_show(struct device *dev,
@@ -306,7 +306,7 @@ static ssize_t set_subbuffer_size_show(s
 {
 	struct most_channel *c = to_channel(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", c->cfg.subbuffer_size);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", c->cfg.subbuffer_size);
 }
 
 static ssize_t set_packets_per_xact_show(struct device *dev,
@@ -315,7 +315,7 @@ static ssize_t set_packets_per_xact_show
 {
 	struct most_channel *c = to_channel(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", c->cfg.packets_per_xact);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", c->cfg.packets_per_xact);
 }
 
 static ssize_t set_dbr_size_show(struct device *dev,
@@ -323,7 +323,7 @@ static ssize_t set_dbr_size_show(struct
 {
 	struct most_channel *c = to_channel(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", c->cfg.dbr_size);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", c->cfg.dbr_size);
 }
 
 #define to_dev_attr(a) container_of(a, struct device_attribute, attr)
@@ -395,7 +395,7 @@ static ssize_t description_show(struct d
 {
 	struct most_interface *iface = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", iface->description);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", iface->description);
 }
 
 static ssize_t interface_show(struct device *dev,
@@ -406,25 +406,25 @@ static ssize_t interface_show(struct dev
 
 	switch (iface->interface) {
 	case ITYPE_LOOPBACK:
-		return snprintf(buf, PAGE_SIZE, "loopback\n");
+		return scnprintf(buf, PAGE_SIZE, "loopback\n");
 	case ITYPE_I2C:
-		return snprintf(buf, PAGE_SIZE, "i2c\n");
+		return scnprintf(buf, PAGE_SIZE, "i2c\n");
 	case ITYPE_I2S:
-		return snprintf(buf, PAGE_SIZE, "i2s\n");
+		return scnprintf(buf, PAGE_SIZE, "i2s\n");
 	case ITYPE_TSI:
-		return snprintf(buf, PAGE_SIZE, "tsi\n");
+		return scnprintf(buf, PAGE_SIZE, "tsi\n");
 	case ITYPE_HBI:
-		return snprintf(buf, PAGE_SIZE, "hbi\n");
+		return scnprintf(buf, PAGE_SIZE, "hbi\n");
 	case ITYPE_MEDIALB_DIM:
-		return snprintf(buf, PAGE_SIZE, "mlb_dim\n");
+		return scnprintf(buf, PAGE_SIZE, "mlb_dim\n");
 	case ITYPE_MEDIALB_DIM2:
-		return snprintf(buf, PAGE_SIZE, "mlb_dim2\n");
+		return scnprintf(buf, PAGE_SIZE, "mlb_dim2\n");
 	case ITYPE_USB:
-		return snprintf(buf, PAGE_SIZE, "usb\n");
+		return scnprintf(buf, PAGE_SIZE, "usb\n");
 	case ITYPE_PCIE:
-		return snprintf(buf, PAGE_SIZE, "pcie\n");
+		return scnprintf(buf, PAGE_SIZE, "pcie\n");
 	}
-	return snprintf(buf, PAGE_SIZE, "unknown\n");
+	return scnprintf(buf, PAGE_SIZE, "unknown\n");
 }
 
 static DEVICE_ATTR_RO(description);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-10 21:20 drivers/hid/wacom_sys.c:1796:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-12-10 21:20 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-10 21:20 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1841 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Jiri Kosina <jikos@kernel.org>
CC: Benjamin Tissoires <benjamin.tissoires@redhat.com>
CC: linux-input(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/hid/wacom_sys.c:1796: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9fca90cf28920c6d0723d7efd1eae0b0fb90309c
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 2 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 wacom_sys.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -1793,7 +1793,7 @@ static ssize_t wacom_show_speed(struct d
 	struct hid_device *hdev = to_hid_device(dev);
 	struct wacom *wacom = hid_get_drvdata(hdev);
 
-	return snprintf(buf, PAGE_SIZE, "%i\n", wacom->wacom_wac.bt_high_speed);
+	return scnprintf(buf, PAGE_SIZE, "%i\n", wacom->wacom_wac.bt_high_speed);
 }
 
 static ssize_t wacom_store_speed(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-07  6:03 drivers/net/can/janz-ican3.c:1834:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-12-07  6:03 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-07  6:03 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1844 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Wolfgang Grandegger <wg@grandegger.com>
CC: "Marc Kleine-Budde" <mkl@pengutronix.de>
CC: Jakub Kicinski <kuba@kernel.org>
CC: linux-can(a)vger.kernel.org
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/net/can/janz-ican3.c:1834: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0477e92881850d44910a7e94fc2c46f96faa131f
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 8 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 janz-ican3.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -1831,7 +1831,7 @@ static ssize_t ican3_sysfs_show_term(str
 		return -ETIMEDOUT;
 	}
 
-	return snprintf(buf, PAGE_SIZE, "%u\n", mod->termination_enabled);
+	return scnprintf(buf, PAGE_SIZE, "%u\n", mod->termination_enabled);
 }
 
 static ssize_t ican3_sysfs_set_term(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-02 13:02 drivers/iio/trigger/iio-trig-hrtimer.c:41:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-12-02 13:02 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-02 13:02 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2037 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Jonathan Cameron <jic23@kernel.org>
CC: Hartmut Knaack <knaack.h@gmx.de>
CC: "Lars-Peter Clausen" <lars@metafoo.de>
CC: "Peter Meerwald-Stadler" <pmeerw@pmeerw.net>
CC: Alexandru Ardelean <alexandru.ardelean@analog.com>
CC: Geert Uytterhoeven <geert+renesas@glider.be>
CC: linux-iio(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/iio/trigger/iio-trig-hrtimer.c:41: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   509a15421674b9e1a3e1916939d0d0efd3e578da
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 13 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 iio-trig-hrtimer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/iio/trigger/iio-trig-hrtimer.c
+++ b/drivers/iio/trigger/iio-trig-hrtimer.c
@@ -38,7 +38,7 @@ ssize_t iio_hrtimer_show_sampling_freque
 	struct iio_trigger *trig = to_iio_trigger(dev);
 	struct iio_hrtimer_info *info = iio_trigger_get_drvdata(trig);
 
-	return snprintf(buf, PAGE_SIZE, "%lu\n", info->sampling_frequency);
+	return scnprintf(buf, PAGE_SIZE, "%lu\n", info->sampling_frequency);
 }
 
 static

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-12-01  1:10 drivers/scsi/fcoe/fcoe_sysfs.c:376:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-12-01  1:10 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-12-01  1:10 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2602 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Hannes Reinecke <hare@suse.de>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/scsi/fcoe/fcoe_sysfs.c:376:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/fcoe/fcoe_sysfs.c:268:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/fcoe/fcoe_sysfs.c:253: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b65054597872ce3aefbc6a666385eabdf9e288da
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 25 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 fcoe_sysfs.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/scsi/fcoe/fcoe_sysfs.c
+++ b/drivers/scsi/fcoe/fcoe_sysfs.c
@@ -250,7 +250,7 @@ static ssize_t show_fcf_state(struct dev
 	name = get_fcoe_fcf_state_name(fcf->state);
 	if (!name)
 		return -EINVAL;
-	return snprintf(buf, FCOE_FCF_STATE_MAX_NAMELEN, "%s\n", name);
+	return scnprintf(buf, FCOE_FCF_STATE_MAX_NAMELEN, "%s\n", name);
 }
 static FCOE_DEVICE_ATTR(fcf, state, S_IRUGO, show_fcf_state, NULL);
 
@@ -265,7 +265,7 @@ static ssize_t show_ctlr_mode(struct dev
 	name = get_fcoe_ctlr_mode_name(ctlr->mode);
 	if (!name)
 		return -EINVAL;
-	return snprintf(buf, FCOE_MAX_MODENAME_LEN,
+	return scnprintf(buf, FCOE_MAX_MODENAME_LEN,
 			"%s\n", name);
 }
 
@@ -373,7 +373,7 @@ static ssize_t show_ctlr_enabled_state(s
 	name = get_fcoe_ctlr_enabled_state_name(ctlr->enabled);
 	if (!name)
 		return -EINVAL;
-	return snprintf(buf, FCOE_CTLR_ENABLED_MAX_NAMELEN,
+	return scnprintf(buf, FCOE_CTLR_ENABLED_MAX_NAMELEN,
 			"%s\n", name);
 }
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-11-30 21:50 drivers/perf/fsl_imx8_ddr_perf.c:119:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-11-30 21:50 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-11-30 21:50 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1940 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Frank Li <Frank.li@nxp.com>
CC: Will Deacon <will@kernel.org>
CC: Mark Rutland <mark.rutland@arm.com>
CC: Shawn Guo <shawnguo@kernel.org>
CC: Sascha Hauer <s.hauer@pengutronix.de>
CC: Pengutronix Kernel Team <kernel@pengutronix.de>
CC: Fabio Estevam <festevam@gmail.com>
CC: NXP Linux Team <linux-imx@nxp.com>

From: kernel test robot <lkp@intel.com>

drivers/perf/fsl_imx8_ddr_perf.c:119: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b65054597872ce3aefbc6a666385eabdf9e288da
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 22 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 fsl_imx8_ddr_perf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/perf/fsl_imx8_ddr_perf.c
+++ b/drivers/perf/fsl_imx8_ddr_perf.c
@@ -116,7 +116,7 @@ static ssize_t ddr_perf_filter_cap_show(
 		container_of(attr, struct dev_ext_attribute, attr);
 	int cap = (long)ea->var;
 
-	return snprintf(buf, PAGE_SIZE, "%u\n",
+	return scnprintf(buf, PAGE_SIZE, "%u\n",
 			ddr_perf_filter_cap_get(pmu, cap));
 }
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-11-24 20:47 drivers/iio/trigger/stm32-timer-trigger.c:299:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-11-24 20:47 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-11-24 20:47 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2045 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Jonathan Cameron <jic23@kernel.org>
CC: Hartmut Knaack <knaack.h@gmx.de>
CC: "Lars-Peter Clausen" <lars@metafoo.de>
CC: "Peter Meerwald-Stadler" <pmeerw@pmeerw.net>
CC: Maxime Coquelin <mcoquelin.stm32@gmail.com>
CC: Alexandre Torgue <alexandre.torgue@st.com>
CC: Fabrice Gasnier <fabrice.gasnier@st.com>
CC: linux-iio(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/iio/trigger/stm32-timer-trigger.c:299: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d5beb3140f91b1c8a3d41b14d729aefa4dcc58bc
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 21 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 stm32-timer-trigger.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/iio/trigger/stm32-timer-trigger.c
+++ b/drivers/iio/trigger/stm32-timer-trigger.c
@@ -296,7 +296,7 @@ static ssize_t stm32_tt_show_master_mode
 	else
 		cr2 = (cr2 & TIM_CR2_MMS) >> TIM_CR2_MMS_SHIFT;
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", master_mode_table[cr2]);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", master_mode_table[cr2]);
 }
 
 static ssize_t stm32_tt_store_master_mode(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-11-22 19:07 drivers/hwmon/pmbus/inspur-ipsps.c:94:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-11-22 19:07 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-11-22 19:07 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3068 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Guenter Roeck <linux@roeck-us.net>
CC: Jean Delvare <jdelvare@suse.com>
CC: linux-hwmon(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/hwmon/pmbus/inspur-ipsps.c:94:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/pmbus/inspur-ipsps.c:114:9-17: WARNING: use scnprintf or sprintf
drivers/hwmon/pmbus/inspur-ipsps.c:73: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a349e4c659609fd20e4beea89e5c4a4038e33a95
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 25 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 inspur-ipsps.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/hwmon/pmbus/inspur-ipsps.c
+++ b/drivers/hwmon/pmbus/inspur-ipsps.c
@@ -70,7 +70,7 @@ static ssize_t ipsps_string_show(struct
 	p = memscan(data, '#', rc);
 	*p = '\0';
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", data);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", data);
 }
 
 static ssize_t ipsps_fw_version_show(struct device *dev,
@@ -91,7 +91,7 @@ static ssize_t ipsps_fw_version_show(str
 	if (rc != 6)
 		return -EPROTO;
 
-	return snprintf(buf, PAGE_SIZE, "%u.%02u%u-%u.%02u\n",
+	return scnprintf(buf, PAGE_SIZE, "%u.%02u%u-%u.%02u\n",
 			data[1], data[2]/* < 100 */, data[3]/*< 10*/,
 			data[4], data[5]/* < 100 */);
 }
@@ -111,19 +111,19 @@ static ssize_t ipsps_mode_show(struct de
 
 	switch (rc) {
 	case MODE_ACTIVE:
-		return snprintf(buf, PAGE_SIZE, "[%s] %s %s\n",
+		return scnprintf(buf, PAGE_SIZE, "[%s] %s %s\n",
 				MODE_ACTIVE_STRING,
 				MODE_STANDBY_STRING, MODE_REDUNDANCY_STRING);
 	case MODE_STANDBY:
-		return snprintf(buf, PAGE_SIZE, "%s [%s] %s\n",
+		return scnprintf(buf, PAGE_SIZE, "%s [%s] %s\n",
 				MODE_ACTIVE_STRING,
 				MODE_STANDBY_STRING, MODE_REDUNDANCY_STRING);
 	case MODE_REDUNDANCY:
-		return snprintf(buf, PAGE_SIZE, "%s %s [%s]\n",
+		return scnprintf(buf, PAGE_SIZE, "%s %s [%s]\n",
 				MODE_ACTIVE_STRING,
 				MODE_STANDBY_STRING, MODE_REDUNDANCY_STRING);
 	default:
-		return snprintf(buf, PAGE_SIZE, "unspecified\n");
+		return scnprintf(buf, PAGE_SIZE, "unspecified\n");
 	}
 }
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-11-22 10:27 drivers/char/ipmi/ipmi_msghandler.c:2694:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-11-22 10:27 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-11-22 10:27 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2072 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Jean Delvare <jdelvare@suse.com>
CC: Guenter Roeck <linux@roeck-us.net>
CC: linux-hwmon(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/hwmon/occ/sysfs.c:80:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/occ/sysfs.c:70: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a349e4c659609fd20e4beea89e5c4a4038e33a95
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 16 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 sysfs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/hwmon/occ/sysfs.c
+++ b/drivers/hwmon/occ/sysfs.c
@@ -67,7 +67,7 @@ static ssize_t occ_sysfs_show(struct dev
 		return -EINVAL;
 	}
 
-	return snprintf(buf, PAGE_SIZE - 1, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE - 1, "%d\n", val);
 }
 
 static ssize_t occ_error_show(struct device *dev,
@@ -77,7 +77,7 @@ static ssize_t occ_error_show(struct dev
 
 	occ_update_response(occ);
 
-	return snprintf(buf, PAGE_SIZE - 1, "%d\n", occ->error);
+	return scnprintf(buf, PAGE_SIZE - 1, "%d\n", occ->error);
 }
 
 static SENSOR_DEVICE_ATTR(occ_master, 0444, occ_sysfs_show, NULL, 0);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-11-20 11:52 drivers/crypto/picoxcell_crypto.c:1200:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-11-20 11:52 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-11-20 11:52 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1878 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Jamie Iles <jamie@jamieiles.com>
CC: Herbert Xu <herbert@gondor.apana.org.au>
CC: linux-arm-kernel(a)lists.infradead.org
CC: linux-crypto(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/crypto/picoxcell_crypto.c:1200: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4d02da974ea85a62074efedf354e82778f910d82
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 14 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 picoxcell_crypto.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/crypto/picoxcell_crypto.c
+++ b/drivers/crypto/picoxcell_crypto.c
@@ -1197,7 +1197,7 @@ static ssize_t spacc_stat_irq_thresh_sho
 {
 	struct spacc_engine *engine = spacc_dev_to_engine(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%u\n", engine->stat_irq_thresh);
+	return scnprintf(buf, PAGE_SIZE, "%u\n", engine->stat_irq_thresh);
 }
 
 static ssize_t spacc_stat_irq_thresh_store(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-11-19  7:24 drivers/hwmon/occ/common.c:554:9-17: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-11-19  7:24 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-11-19  7:24 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6695 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Jean Delvare <jdelvare@suse.com>
CC: Guenter Roeck <linux@roeck-us.net>
CC: linux-hwmon(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/hwmon/occ/common.c:554:9-17: WARNING: use scnprintf or sprintf
drivers/hwmon/occ/common.c:604:9-17: WARNING: use scnprintf or sprintf
drivers/hwmon/occ/common.c:337:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/occ/common.c:367:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/occ/common.c:406:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/occ/common.c:435:9-17: WARNING: use scnprintf or sprintf
drivers/hwmon/occ/common.c:474:9-17: WARNING: use scnprintf or sprintf
drivers/hwmon/occ/common.c:256:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/occ/common.c:307: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c2e7554e1b85935d962127efa3c2a76483b0b3b6
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 11 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 common.c |   32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

--- a/drivers/hwmon/occ/common.c
+++ b/drivers/hwmon/occ/common.c
@@ -253,7 +253,7 @@ static ssize_t occ_show_temp_1(struct de
 		return -EINVAL;
 	}
 
-	return snprintf(buf, PAGE_SIZE - 1, "%u\n", val);
+	return scnprintf(buf, PAGE_SIZE - 1, "%u\n", val);
 }
 
 static ssize_t occ_show_temp_2(struct device *dev,
@@ -304,7 +304,7 @@ static ssize_t occ_show_temp_2(struct de
 		return -EINVAL;
 	}
 
-	return snprintf(buf, PAGE_SIZE - 1, "%u\n", val);
+	return scnprintf(buf, PAGE_SIZE - 1, "%u\n", val);
 }
 
 static ssize_t occ_show_freq_1(struct device *dev,
@@ -334,7 +334,7 @@ static ssize_t occ_show_freq_1(struct de
 		return -EINVAL;
 	}
 
-	return snprintf(buf, PAGE_SIZE - 1, "%u\n", val);
+	return scnprintf(buf, PAGE_SIZE - 1, "%u\n", val);
 }
 
 static ssize_t occ_show_freq_2(struct device *dev,
@@ -364,7 +364,7 @@ static ssize_t occ_show_freq_2(struct de
 		return -EINVAL;
 	}
 
-	return snprintf(buf, PAGE_SIZE - 1, "%u\n", val);
+	return scnprintf(buf, PAGE_SIZE - 1, "%u\n", val);
 }
 
 static ssize_t occ_show_power_1(struct device *dev,
@@ -403,7 +403,7 @@ static ssize_t occ_show_power_1(struct d
 		return -EINVAL;
 	}
 
-	return snprintf(buf, PAGE_SIZE - 1, "%llu\n", val);
+	return scnprintf(buf, PAGE_SIZE - 1, "%llu\n", val);
 }
 
 static u64 occ_get_powr_avg(u64 *accum, u32 *samples)
@@ -432,7 +432,7 @@ static ssize_t occ_show_power_2(struct d
 
 	switch (sattr->nr) {
 	case 0:
-		return snprintf(buf, PAGE_SIZE - 1, "%u_%u_%u\n",
+		return scnprintf(buf, PAGE_SIZE - 1, "%u_%u_%u\n",
 				get_unaligned_be32(&power->sensor_id),
 				power->function_id, power->apss_channel);
 	case 1:
@@ -450,7 +450,7 @@ static ssize_t occ_show_power_2(struct d
 		return -EINVAL;
 	}
 
-	return snprintf(buf, PAGE_SIZE - 1, "%llu\n", val);
+	return scnprintf(buf, PAGE_SIZE - 1, "%llu\n", val);
 }
 
 static ssize_t occ_show_power_a0(struct device *dev,
@@ -471,7 +471,7 @@ static ssize_t occ_show_power_a0(struct
 
 	switch (sattr->nr) {
 	case 0:
-		return snprintf(buf, PAGE_SIZE - 1, "%u_system\n",
+		return scnprintf(buf, PAGE_SIZE - 1, "%u_system\n",
 				get_unaligned_be32(&power->sensor_id));
 	case 1:
 		val = occ_get_powr_avg(&power->system.accumulator,
@@ -485,7 +485,7 @@ static ssize_t occ_show_power_a0(struct
 		val = get_unaligned_be16(&power->system.value) * 1000000ULL;
 		break;
 	case 4:
-		return snprintf(buf, PAGE_SIZE - 1, "%u_proc\n",
+		return scnprintf(buf, PAGE_SIZE - 1, "%u_proc\n",
 				get_unaligned_be32(&power->sensor_id));
 	case 5:
 		val = occ_get_powr_avg(&power->proc.accumulator,
@@ -499,7 +499,7 @@ static ssize_t occ_show_power_a0(struct
 		val = get_unaligned_be16(&power->proc.value) * 1000000ULL;
 		break;
 	case 8:
-		return snprintf(buf, PAGE_SIZE - 1, "%u_vdd\n",
+		return scnprintf(buf, PAGE_SIZE - 1, "%u_vdd\n",
 				get_unaligned_be32(&power->sensor_id));
 	case 9:
 		val = occ_get_powr_avg(&power->vdd.accumulator,
@@ -513,7 +513,7 @@ static ssize_t occ_show_power_a0(struct
 		val = get_unaligned_be16(&power->vdd.value) * 1000000ULL;
 		break;
 	case 12:
-		return snprintf(buf, PAGE_SIZE - 1, "%u_vdn\n",
+		return scnprintf(buf, PAGE_SIZE - 1, "%u_vdn\n",
 				get_unaligned_be32(&power->sensor_id));
 	case 13:
 		val = occ_get_powr_avg(&power->vdn.accumulator,
@@ -530,7 +530,7 @@ static ssize_t occ_show_power_a0(struct
 		return -EINVAL;
 	}
 
-	return snprintf(buf, PAGE_SIZE - 1, "%llu\n", val);
+	return scnprintf(buf, PAGE_SIZE - 1, "%llu\n", val);
 }
 
 static ssize_t occ_show_caps_1_2(struct device *dev,
@@ -551,7 +551,7 @@ static ssize_t occ_show_caps_1_2(struct
 
 	switch (sattr->nr) {
 	case 0:
-		return snprintf(buf, PAGE_SIZE - 1, "system\n");
+		return scnprintf(buf, PAGE_SIZE - 1, "system\n");
 	case 1:
 		val = get_unaligned_be16(&caps->cap) * 1000000ULL;
 		break;
@@ -580,7 +580,7 @@ static ssize_t occ_show_caps_1_2(struct
 		return -EINVAL;
 	}
 
-	return snprintf(buf, PAGE_SIZE - 1, "%llu\n", val);
+	return scnprintf(buf, PAGE_SIZE - 1, "%llu\n", val);
 }
 
 static ssize_t occ_show_caps_3(struct device *dev,
@@ -601,7 +601,7 @@ static ssize_t occ_show_caps_3(struct de
 
 	switch (sattr->nr) {
 	case 0:
-		return snprintf(buf, PAGE_SIZE - 1, "system\n");
+		return scnprintf(buf, PAGE_SIZE - 1, "system\n");
 	case 1:
 		val = get_unaligned_be16(&caps->cap) * 1000000ULL;
 		break;
@@ -627,7 +627,7 @@ static ssize_t occ_show_caps_3(struct de
 		return -EINVAL;
 	}
 
-	return snprintf(buf, PAGE_SIZE - 1, "%llu\n", val);
+	return scnprintf(buf, PAGE_SIZE - 1, "%llu\n", val);
 }
 
 static ssize_t occ_store_caps_user(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-11-17 17:21 drivers/net/can/at91_can.c:1185:9-17: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-11-17 17:21 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-11-17 17:21 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2154 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Wolfgang Grandegger <wg@grandegger.com>
CC: "Marc Kleine-Budde" <mkl@pengutronix.de>
CC: Jakub Kicinski <kuba@kernel.org>
CC: Nicolas Ferre <nicolas.ferre@microchip.com>
CC: Alexandre Belloni <alexandre.belloni@bootlin.com>
CC: Ludovic Desroches <ludovic.desroches@microchip.com>
CC: linux-can(a)vger.kernel.org
CC: netdev(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/net/can/at91_can.c:1185:9-17: 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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9c87c9f41245baa3fc4716cf39141439cf405b01
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 18 hours ago
:::::: commit date: 4 months ago

Please take the patch only if it's a positive warning. Thanks!

 at91_can.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -1182,9 +1182,9 @@ static ssize_t at91_sysfs_show_mb0_id(st
 	struct at91_priv *priv = netdev_priv(to_net_dev(dev));
 
 	if (priv->mb0_id & CAN_EFF_FLAG)
-		return snprintf(buf, PAGE_SIZE, "0x%08x\n", priv->mb0_id);
+		return scnprintf(buf, PAGE_SIZE, "0x%08x\n", priv->mb0_id);
 	else
-		return snprintf(buf, PAGE_SIZE, "0x%03x\n", priv->mb0_id);
+		return scnprintf(buf, PAGE_SIZE, "0x%03x\n", priv->mb0_id);
 }
 
 static ssize_t at91_sysfs_set_mb0_id(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-11-13 17:02 drivers/platform/x86/panasonic-laptop.c:371:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-11-13 17:02 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-11-13 17:02 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3227 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Harald Welte <laforge@gnumonks.org>
CC: Darren Hart <dvhart@infradead.org>
CC: Andy Shevchenko <andy@infradead.org>
CC: platform-driver-x86(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/platform/x86/panasonic-laptop.c:371:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/panasonic-laptop.c:383:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/panasonic-laptop.c:359:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/panasonic-laptop.c:395: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   585e5b17b92dead8a3aca4e3c9876fbca5f7e0ba
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 16 hours ago
:::::: commit date: 3 months ago

Please take the patch only if it's a positive warning. Thanks!

 panasonic-laptop.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -356,7 +356,7 @@ static ssize_t show_numbatt(struct devic
 	if (!acpi_pcc_retrieve_biosdata(pcc))
 		return -EIO;
 
-	return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_NUM_BATTERIES]);
+	return scnprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_NUM_BATTERIES]);
 }
 
 static ssize_t show_lcdtype(struct device *dev, struct device_attribute *attr,
@@ -368,7 +368,7 @@ static ssize_t show_lcdtype(struct devic
 	if (!acpi_pcc_retrieve_biosdata(pcc))
 		return -EIO;
 
-	return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_LCD_TYPE]);
+	return scnprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_LCD_TYPE]);
 }
 
 static ssize_t show_mute(struct device *dev, struct device_attribute *attr,
@@ -380,7 +380,7 @@ static ssize_t show_mute(struct device *
 	if (!acpi_pcc_retrieve_biosdata(pcc))
 		return -EIO;
 
-	return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_MUTE]);
+	return scnprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_MUTE]);
 }
 
 static ssize_t show_sticky(struct device *dev, struct device_attribute *attr,
@@ -392,7 +392,7 @@ static ssize_t show_sticky(struct device
 	if (!acpi_pcc_retrieve_biosdata(pcc))
 		return -EIO;
 
-	return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_STICKY_KEY]);
+	return scnprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_STICKY_KEY]);
 }
 
 static ssize_t set_sticky(struct device *dev, struct device_attribute *attr,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-11-12  1:20 drivers/net/can/janz-ican3.c:1834:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-11-12  1:20 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-11-12  1:20 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1844 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Wolfgang Grandegger <wg@grandegger.com>
CC: "Marc Kleine-Budde" <mkl@pengutronix.de>
CC: Jakub Kicinski <kuba@kernel.org>
CC: linux-can(a)vger.kernel.org
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/net/can/janz-ican3.c:1834: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3d5e28bff7ad55aea081c1af516cc1c94a5eca7d
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 3 hours ago
:::::: commit date: 3 months ago

Please take the patch only if it's a positive warning. Thanks!

 janz-ican3.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -1831,7 +1831,7 @@ static ssize_t ican3_sysfs_show_term(str
 		return -ETIMEDOUT;
 	}
 
-	return snprintf(buf, PAGE_SIZE, "%u\n", mod->termination_enabled);
+	return scnprintf(buf, PAGE_SIZE, "%u\n", mod->termination_enabled);
 }
 
 static ssize_t ican3_sysfs_set_term(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-11-05  1:14 drivers/platform/x86/sony-laptop.c:2054:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-11-05  1:14 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-11-05  1:14 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6214 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Mattia Dongili <malattia@linux.it>
CC: Darren Hart <dvhart@infradead.org>
CC: Andy Shevchenko <andy@infradead.org>
CC: platform-driver-x86(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/platform/x86/sony-laptop.c:2054:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/sony-laptop.c:2722:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/sony-laptop.c:2496:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/sony-laptop.c:2571:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/sony-laptop.c:2711:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/sony-laptop.c:2364:10-18: WARNING: use scnprintf or sprintf
drivers/platform/x86/sony-laptop.c:2645:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/sony-laptop.c:2873:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/sony-laptop.c:967:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/sony-laptop.c:3001:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/sony-laptop.c:2818:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/sony-laptop.c:3999: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4ef8451b332662d004df269d4cdeb7d9f31419b5
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 28 hours ago
:::::: commit date: 3 months ago

Please take the patch only if it's a positive warning. Thanks!

 sony-laptop.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -964,7 +964,7 @@ static ssize_t sony_nc_sysfs_show(struct
 	if (item->validate)
 		value = item->validate(SNC_VALIDATE_OUT, value);
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", value);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", value);
 }
 
 static ssize_t sony_nc_sysfs_store(struct device *dev,
@@ -2051,7 +2051,7 @@ static ssize_t sony_nc_battery_care_limi
 		break;
 	}
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", status);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", status);
 }
 
 static ssize_t sony_nc_battery_care_health_show(struct device *dev,
@@ -2361,7 +2361,7 @@ static ssize_t sony_nc_lid_resume_show(s
 
 	while (pos < LID_RESUME_MAX) {
 		if (&lid_ctl->attrs[pos].attr == &attr->attr)
-			return snprintf(buffer, PAGE_SIZE, "%d\n",
+			return scnprintf(buffer, PAGE_SIZE, "%d\n",
 					(lid_ctl->status >> pos) & 0x01);
 		pos++;
 	}
@@ -2493,7 +2493,7 @@ static ssize_t sony_nc_gfx_switch_status
 	if (pos < 0)
 		return pos;
 
-	return snprintf(buffer, PAGE_SIZE, "%s\n",
+	return scnprintf(buffer, PAGE_SIZE, "%s\n",
 					pos == SPEED ? "speed" :
 					pos == STAMINA ? "stamina" :
 					pos == AUTO ? "auto" : "unknown");
@@ -2568,7 +2568,7 @@ static ssize_t sony_nc_highspeed_chargin
 	if (sony_call_snc_handle(0x0131, 0x0100, &result))
 		return -EIO;
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", result & 0x01);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", result & 0x01);
 }
 
 static int sony_nc_highspeed_charging_setup(struct platform_device *pd)
@@ -2642,7 +2642,7 @@ static ssize_t sony_nc_lowbatt_show(stru
 	if (sony_call_snc_handle(0x0121, 0x0200, &result))
 		return -EIO;
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", result & 1);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", result & 1);
 }
 
 static int sony_nc_lowbatt_setup(struct platform_device *pd)
@@ -2708,7 +2708,7 @@ static ssize_t sony_nc_hsfan_show(struct
 	if (sony_call_snc_handle(0x0149, 0x0100, &result))
 		return -EIO;
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", result & 0x01);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", result & 0x01);
 }
 
 static ssize_t sony_nc_fanspeed_show(struct device *dev,
@@ -2719,7 +2719,7 @@ static ssize_t sony_nc_fanspeed_show(str
 	if (sony_call_snc_handle(0x0149, 0x0300, &result))
 		return -EIO;
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", result & 0xff);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", result & 0xff);
 }
 
 static int sony_nc_fanspeed_setup(struct platform_device *pd)
@@ -2815,7 +2815,7 @@ static ssize_t sony_nc_usb_charge_show(s
 	if (sony_call_snc_handle(0x0155, 0x0000, &result))
 		return -EIO;
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", result & 0x01);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", result & 0x01);
 }
 
 static int sony_nc_usb_charge_setup(struct platform_device *pd)
@@ -2870,7 +2870,7 @@ static ssize_t sony_nc_panelid_show(stru
 	if (sony_call_snc_handle(0x011D, 0x0000, &result))
 		return -EIO;
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", result);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", result);
 }
 
 static int sony_nc_panelid_setup(struct platform_device *pd)
@@ -2998,7 +2998,7 @@ static ssize_t sony_nc_touchpad_show(str
 	if (sony_call_snc_handle(tp_ctl->handle, 0x000, &result))
 		return -EINVAL;
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", !(result & 0x01));
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", !(result & 0x01));
 }
 
 static int sony_nc_touchpad_setup(struct platform_device *pd,
@@ -3996,7 +3996,7 @@ static ssize_t sony_pic_fanspeed_show(st
 	if (sony_pic_get_fanspeed(&value))
 		return -EIO;
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", value);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", value);
 }
 
 #define SPIC_ATTR(_name, _mode)					\

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-10-06  7:21 drivers/platform/x86/lg-laptop.c:496:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-10-06  7:21 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
@ 2020-10-06  7:21 ` kernel test robot
  1 sibling, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-10-06  7:21 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3157 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "Matan Ziv-Av" <matan@svgalib.org>
CC: Darren Hart <dvhart@infradead.org>
CC: Andy Shevchenko <andy@infradead.org>
CC: platform-driver-x86(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/platform/x86/lg-laptop.c:496:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/lg-laptop.c:322:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/lg-laptop.c:447:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/lg-laptop.c:406:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/lg-laptop.c:364: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7575fdda569b2a2e8be32c1a64ecb05d6f96a500
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 12 hours ago
:::::: commit date: 9 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 lg-laptop.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/platform/x86/lg-laptop.c
+++ b/drivers/platform/x86/lg-laptop.c
@@ -319,7 +319,7 @@ static ssize_t fan_mode_show(struct devi
 	status = r->integer.value & 0x01;
 	kfree(r);
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", status);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", status);
 }
 
 static ssize_t usb_charge_store(struct device *dev,
@@ -361,7 +361,7 @@ static ssize_t usb_charge_show(struct de
 
 	kfree(r);
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", status);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", status);
 }
 
 static ssize_t reader_mode_store(struct device *dev,
@@ -403,7 +403,7 @@ static ssize_t reader_mode_show(struct d
 
 	kfree(r);
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", status);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", status);
 }
 
 static ssize_t fn_lock_store(struct device *dev,
@@ -444,7 +444,7 @@ static ssize_t fn_lock_show(struct devic
 	status = !!r->buffer.pointer[0];
 	kfree(r);
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", status);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", status);
 }
 
 static ssize_t battery_care_limit_store(struct device *dev,
@@ -493,7 +493,7 @@ static ssize_t battery_care_limit_show(s
 	if (status != 80 && status != 100)
 		status = 0;
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", status);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", status);
 }
 
 static DEVICE_ATTR_RW(fan_mode);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-10-06  7:21 drivers/platform/x86/lg-laptop.c:496:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-10-06  7:21 ` kernel test robot
  2020-10-06  7:21 ` kernel test robot
  1 sibling, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-10-06  7:21 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3079 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Bernie Thompson <bernie@plugable.com>
CC: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
CC: linux-fbdev(a)vger.kernel.org
CC: dri-devel(a)lists.freedesktop.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/video/fbdev/udlfb.c:1436:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/udlfb.c:1428:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/udlfb.c:1444:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/udlfb.c:1452: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7575fdda569b2a2e8be32c1a64ecb05d6f96a500
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 12 hours ago
:::::: commit date: 9 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 udlfb.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/video/fbdev/udlfb.c
+++ b/drivers/video/fbdev/udlfb.c
@@ -1425,7 +1425,7 @@ static ssize_t metrics_bytes_rendered_sh
 				   struct device_attribute *a, char *buf) {
 	struct fb_info *fb_info = dev_get_drvdata(fbdev);
 	struct dlfb_data *dlfb = fb_info->par;
-	return snprintf(buf, PAGE_SIZE, "%u\n",
+	return scnprintf(buf, PAGE_SIZE, "%u\n",
 			atomic_read(&dlfb->bytes_rendered));
 }
 
@@ -1433,7 +1433,7 @@ static ssize_t metrics_bytes_identical_s
 				   struct device_attribute *a, char *buf) {
 	struct fb_info *fb_info = dev_get_drvdata(fbdev);
 	struct dlfb_data *dlfb = fb_info->par;
-	return snprintf(buf, PAGE_SIZE, "%u\n",
+	return scnprintf(buf, PAGE_SIZE, "%u\n",
 			atomic_read(&dlfb->bytes_identical));
 }
 
@@ -1441,7 +1441,7 @@ static ssize_t metrics_bytes_sent_show(s
 				   struct device_attribute *a, char *buf) {
 	struct fb_info *fb_info = dev_get_drvdata(fbdev);
 	struct dlfb_data *dlfb = fb_info->par;
-	return snprintf(buf, PAGE_SIZE, "%u\n",
+	return scnprintf(buf, PAGE_SIZE, "%u\n",
 			atomic_read(&dlfb->bytes_sent));
 }
 
@@ -1449,7 +1449,7 @@ static ssize_t metrics_cpu_kcycles_used_
 				   struct device_attribute *a, char *buf) {
 	struct fb_info *fb_info = dev_get_drvdata(fbdev);
 	struct dlfb_data *dlfb = fb_info->par;
-	return snprintf(buf, PAGE_SIZE, "%u\n",
+	return scnprintf(buf, PAGE_SIZE, "%u\n",
 			atomic_read(&dlfb->cpu_kcycles_used));
 }
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-10-01  4:11 drivers/block/aoe/aoeblk.c:102:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-10-01  4:11 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-10-01  4:11 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3547 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Justin Sanders <justin@coraid.com>
CC: Jens Axboe <axboe@kernel.dk>
CC: linux-block(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/block/aoe/aoeblk.c:102:8-16: WARNING: use scnprintf or sprintf
drivers/block/aoe/aoeblk.c:55:9-17: WARNING: use scnprintf or sprintf
drivers/block/aoe/aoeblk.c:88:9-17: WARNING: use scnprintf or sprintf
drivers/block/aoe/aoeblk.c:110:8-16: WARNING: use scnprintf or sprintf
drivers/block/aoe/aoeblk.c:40: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   60e720931556fc1034d0981460164dcf02697679
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 7 hours ago
:::::: commit date: 8 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 aoeblk.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -37,7 +37,7 @@ static ssize_t aoedisk_show_state(struct
 	struct gendisk *disk = dev_to_disk(dev);
 	struct aoedev *d = disk->private_data;
 
-	return snprintf(page, PAGE_SIZE,
+	return scnprintf(page, PAGE_SIZE,
 			"%s%s\n",
 			(d->flags & DEVFL_UP) ? "up" : "down",
 			(d->flags & DEVFL_KICKME) ? ",kickme" :
@@ -52,8 +52,8 @@ static ssize_t aoedisk_show_mac(struct d
 	struct aoetgt *t = d->targets[0];
 
 	if (t == NULL)
-		return snprintf(page, PAGE_SIZE, "none\n");
-	return snprintf(page, PAGE_SIZE, "%pm\n", t->addr);
+		return scnprintf(page, PAGE_SIZE, "none\n");
+	return scnprintf(page, PAGE_SIZE, "%pm\n", t->addr);
 }
 static ssize_t aoedisk_show_netif(struct device *dev,
 				  struct device_attribute *attr, char *page)
@@ -85,7 +85,7 @@ static ssize_t aoedisk_show_netif(struct
 	ne = nd;
 	nd = nds;
 	if (*nd == NULL)
-		return snprintf(page, PAGE_SIZE, "none\n");
+		return scnprintf(page, PAGE_SIZE, "none\n");
 	for (p = page; nd < ne; nd++)
 		p += scnprintf(p, PAGE_SIZE - (p-page), "%s%s",
 			p == page ? "" : ",", (*nd)->name);
@@ -99,7 +99,7 @@ static ssize_t aoedisk_show_fwver(struct
 	struct gendisk *disk = dev_to_disk(dev);
 	struct aoedev *d = disk->private_data;
 
-	return snprintf(page, PAGE_SIZE, "0x%04x\n", (unsigned int) d->fw_ver);
+	return scnprintf(page, PAGE_SIZE, "0x%04x\n", (unsigned int) d->fw_ver);
 }
 static ssize_t aoedisk_show_payload(struct device *dev,
 				    struct device_attribute *attr, char *page)
@@ -107,7 +107,7 @@ static ssize_t aoedisk_show_payload(stru
 	struct gendisk *disk = dev_to_disk(dev);
 	struct aoedev *d = disk->private_data;
 
-	return snprintf(page, PAGE_SIZE, "%lu\n", d->maxbcnt);
+	return scnprintf(page, PAGE_SIZE, "%lu\n", d->maxbcnt);
 }
 
 static int aoedisk_debugfs_show(struct seq_file *s, void *ignored)

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-29 20:34 drivers/usb/usbip/stub_dev.c:33:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-09-29 20:34 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-29 20:34 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1759 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Valentina Manea <valentina.manea.m@gmail.com>
CC: Shuah Khan <skhan@linuxfoundation.org>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: linux-usb(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/usb/usbip/stub_dev.c:33: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ccc1d052eff9f3cfe59d201263903fe1d46c79a5
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 3 hours ago
:::::: commit date: 8 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 stub_dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/usbip/stub_dev.c
+++ b/drivers/usb/usbip/stub_dev.c
@@ -30,7 +30,7 @@ static ssize_t usbip_status_show(struct
 	status = sdev->ud.status;
 	spin_unlock_irq(&sdev->ud.lock);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", status);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", status);
 }
 static DEVICE_ATTR_RO(usbip_status);
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-15  7:28 drivers/video/fbdev/sstfb.c:736:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-09-15  7:28 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
@ 2020-09-15  7:28 ` kernel test robot
  1 sibling, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-15  7:28 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1768 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Valentina Manea <valentina.manea.m@gmail.com>
CC: Shuah Khan <skhan@linuxfoundation.org>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: linux-usb(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/usb/usbip/vudc_sysfs.c:203: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fc4f28bb3daf3265d6bc5f73b497306985bb23ab
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 9 hours ago
:::::: commit date: 6 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 vudc_sysfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/usbip/vudc_sysfs.c
+++ b/drivers/usb/usbip/vudc_sysfs.c
@@ -200,7 +200,7 @@ static ssize_t usbip_status_show(struct
 	status = udc->ud.status;
 	spin_unlock_irq(&udc->ud.lock);
 
-	return snprintf(out, PAGE_SIZE, "%d\n", status);
+	return scnprintf(out, PAGE_SIZE, "%d\n", status);
 }
 static DEVICE_ATTR_RO(usbip_status);
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-15  7:28 drivers/video/fbdev/sstfb.c:736:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-09-15  7:28 ` kernel test robot
  2020-09-15  7:28 ` kernel test robot
  1 sibling, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-15  7:28 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1759 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Valentina Manea <valentina.manea.m@gmail.com>
CC: Shuah Khan <skhan@linuxfoundation.org>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: linux-usb(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/usb/usbip/stub_dev.c:33: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fc4f28bb3daf3265d6bc5f73b497306985bb23ab
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 9 hours ago
:::::: commit date: 6 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 stub_dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/usbip/stub_dev.c
+++ b/drivers/usb/usbip/stub_dev.c
@@ -30,7 +30,7 @@ static ssize_t usbip_status_show(struct
 	status = sdev->ud.status;
 	spin_unlock_irq(&sdev->ud.lock);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", status);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", status);
 }
 static DEVICE_ATTR_RO(usbip_status);
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-12 22:57 drivers/scsi/isci/init.c:140:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-09-12 22:57 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-12 22:57 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1908 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Intel SCU Linux support <intel-linux-scu@intel.com>
CC: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/scsi/isci/init.c:140: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   729e3d091984487f7aa1ebfabfe594e5b317ed0f
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 26 hours ago
:::::: commit date: 6 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 init.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/scsi/isci/init.c
+++ b/drivers/scsi/isci/init.c
@@ -137,7 +137,7 @@ static ssize_t isci_show_id(struct devic
 	struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost);
 	struct isci_host *ihost = container_of(sas_ha, typeof(*ihost), sas_ha);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", ihost->id);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", ihost->id);
 }
 
 static DEVICE_ATTR(isci_id, S_IRUGO, isci_show_id, NULL);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-12 10:01 drivers/scsi/csiostor/csio_scsi.c:1433:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-09-12 10:01 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-12 10:01 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2693 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: Nathan Chancellor <natechancellor@gmail.com>
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/scsi/csiostor/csio_scsi.c:1433:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/csiostor/csio_scsi.c:1369:9-17: WARNING: use scnprintf or sprintf
drivers/scsi/csiostor/csio_scsi.c:1477: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   729e3d091984487f7aa1ebfabfe594e5b317ed0f
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 13 hours ago
:::::: commit date: 6 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 csio_scsi.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/scsi/csiostor/csio_scsi.c
+++ b/drivers/scsi/csiostor/csio_scsi.c
@@ -1366,9 +1366,9 @@ csio_show_hw_state(struct device *dev,
 	struct csio_hw *hw = csio_lnode_to_hw(ln);
 
 	if (csio_is_hw_ready(hw))
-		return snprintf(buf, PAGE_SIZE, "ready\n");
+		return scnprintf(buf, PAGE_SIZE, "ready\n");
 	else
-		return snprintf(buf, PAGE_SIZE, "not ready\n");
+		return scnprintf(buf, PAGE_SIZE, "not ready\n");
 }
 
 /* Device reset */
@@ -1430,7 +1430,7 @@ csio_show_dbg_level(struct device *dev,
 {
 	struct csio_lnode *ln = shost_priv(class_to_shost(dev));
 
-	return snprintf(buf, PAGE_SIZE, "%x\n", ln->params.log_level);
+	return scnprintf(buf, PAGE_SIZE, "%x\n", ln->params.log_level);
 }
 
 /* Store debug level */
@@ -1474,7 +1474,7 @@ csio_show_num_reg_rnodes(struct device *
 {
 	struct csio_lnode *ln = shost_priv(class_to_shost(dev));
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", ln->num_reg_rnodes);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", ln->num_reg_rnodes);
 }
 
 static DEVICE_ATTR(num_reg_rnodes, S_IRUGO, csio_show_num_reg_rnodes, NULL);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-10  8:53 drivers/scsi/53c700.c:2063:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (5 preceding siblings ...)
  2020-09-10  8:53 ` kernel test robot
@ 2020-09-10  8:53 ` kernel test robot
  6 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-10  8:53 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1993 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Pablo Neira Ayuso <pablo@netfilter.org>
CC: Jozsef Kadlecsik <kadlec@netfilter.org>
CC: Florian Westphal <fw@strlen.de>
CC: Jakub Kicinski <kuba@kernel.org>
CC: netfilter-devel(a)vger.kernel.org
CC: coreteam(a)netfilter.org
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

net/netfilter/xt_IDLETIMER.c:88:9-17: 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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7fe10096c1508c7f033d34d0741809f8eecc1ed4
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 6 hours ago
:::::: commit date: 5 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 xt_IDLETIMER.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/net/netfilter/xt_IDLETIMER.c
+++ b/net/netfilter/xt_IDLETIMER.c
@@ -85,9 +85,9 @@ static ssize_t idletimer_tg_show(struct
 	mutex_unlock(&list_mutex);
 
 	if (time_after(expires, jiffies) || ktimespec.tv_sec > 0)
-		return snprintf(buf, PAGE_SIZE, "%ld\n", time_diff);
+		return scnprintf(buf, PAGE_SIZE, "%ld\n", time_diff);
 
-	return snprintf(buf, PAGE_SIZE, "0\n");
+	return scnprintf(buf, PAGE_SIZE, "0\n");
 }
 
 static void idletimer_tg_work(struct work_struct *work)

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-10  8:53 drivers/scsi/53c700.c:2063:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (4 preceding siblings ...)
  2020-09-10  8:53 ` kernel test robot
@ 2020-09-10  8:53 ` kernel test robot
  2020-09-10  8:53 ` kernel test robot
  6 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-10  8:53 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 4724 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Jean Delvare <jdelvare@suse.com>
CC: Guenter Roeck <linux@roeck-us.net>
CC: linux-hwmon(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/hwmon/sch5636.c:275:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:261:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:247:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:187:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:179:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:163:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:230:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:216:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5636.c:202: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7fe10096c1508c7f033d34d0741809f8eecc1ed4
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 6 hours ago
:::::: commit date: 5 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 sch5636.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

--- a/drivers/hwmon/sch5636.c
+++ b/drivers/hwmon/sch5636.c
@@ -160,7 +160,7 @@ static int reg_to_rpm(u16 reg)
 static ssize_t name_show(struct device *dev, struct device_attribute *devattr,
 			 char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "%s\n", DEVNAME);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", DEVNAME);
 }
 
 static ssize_t in_value_show(struct device *dev,
@@ -176,7 +176,7 @@ static ssize_t in_value_show(struct devi
 	val = DIV_ROUND_CLOSEST(
 		data->in[attr->index] * SCH5636_REG_IN_FACTORS[attr->index],
 		255);
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t in_label_show(struct device *dev,
@@ -184,7 +184,7 @@ static ssize_t in_label_show(struct devi
 {
 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 
-	return snprintf(buf, PAGE_SIZE, "%s\n",
+	return scnprintf(buf, PAGE_SIZE, "%s\n",
 			SCH5636_IN_LABELS[attr->index]);
 }
 
@@ -199,7 +199,7 @@ static ssize_t temp_value_show(struct de
 		return PTR_ERR(data);
 
 	val = (data->temp_val[attr->index] - 64) * 1000;
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t temp_fault_show(struct device *dev,
@@ -213,7 +213,7 @@ static ssize_t temp_fault_show(struct de
 		return PTR_ERR(data);
 
 	val = (data->temp_ctrl[attr->index] & SCH5636_TEMP_WORKING) ? 0 : 1;
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t temp_alarm_show(struct device *dev,
@@ -227,7 +227,7 @@ static ssize_t temp_alarm_show(struct de
 		return PTR_ERR(data);
 
 	val = (data->temp_ctrl[attr->index] & SCH5636_TEMP_ALARM) ? 1 : 0;
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t fan_value_show(struct device *dev,
@@ -244,7 +244,7 @@ static ssize_t fan_value_show(struct dev
 	if (val < 0)
 		return val;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t fan_fault_show(struct device *dev,
@@ -258,7 +258,7 @@ static ssize_t fan_fault_show(struct dev
 		return PTR_ERR(data);
 
 	val = (data->fan_ctrl[attr->index] & SCH5636_FAN_NOT_PRESENT) ? 1 : 0;
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t fan_alarm_show(struct device *dev,
@@ -272,7 +272,7 @@ static ssize_t fan_alarm_show(struct dev
 		return PTR_ERR(data);
 
 	val = (data->fan_ctrl[attr->index] & SCH5636_FAN_ALARM) ? 1 : 0;
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static struct sensor_device_attribute sch5636_attr[] = {

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-10  8:53 drivers/scsi/53c700.c:2063:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (3 preceding siblings ...)
  2020-09-10  8:53 ` kernel test robot
@ 2020-09-10  8:53 ` kernel test robot
  2020-09-10  8:53 ` kernel test robot
  2020-09-10  8:53 ` kernel test robot
  6 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-10  8:53 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3177 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Harald Welte <laforge@gnumonks.org>
CC: Darren Hart <dvhart@infradead.org>
CC: Andy Shevchenko <andy@infradead.org>
CC: platform-driver-x86(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/platform/x86/panasonic-laptop.c:371:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/panasonic-laptop.c:383:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/panasonic-laptop.c:359:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/panasonic-laptop.c:395: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7fe10096c1508c7f033d34d0741809f8eecc1ed4
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 6 hours ago
:::::: commit date: 5 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 panasonic-laptop.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -356,7 +356,7 @@ static ssize_t show_numbatt(struct devic
 	if (!acpi_pcc_retrieve_biosdata(pcc))
 		return -EIO;
 
-	return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_NUM_BATTERIES]);
+	return scnprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_NUM_BATTERIES]);
 }
 
 static ssize_t show_lcdtype(struct device *dev, struct device_attribute *attr,
@@ -368,7 +368,7 @@ static ssize_t show_lcdtype(struct devic
 	if (!acpi_pcc_retrieve_biosdata(pcc))
 		return -EIO;
 
-	return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_LCD_TYPE]);
+	return scnprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_LCD_TYPE]);
 }
 
 static ssize_t show_mute(struct device *dev, struct device_attribute *attr,
@@ -380,7 +380,7 @@ static ssize_t show_mute(struct device *
 	if (!acpi_pcc_retrieve_biosdata(pcc))
 		return -EIO;
 
-	return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_MUTE]);
+	return scnprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_MUTE]);
 }
 
 static ssize_t show_sticky(struct device *dev, struct device_attribute *attr,
@@ -392,7 +392,7 @@ static ssize_t show_sticky(struct device
 	if (!acpi_pcc_retrieve_biosdata(pcc))
 		return -EIO;
 
-	return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_STICKY_KEY]);
+	return scnprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_STICKY_KEY]);
 }
 
 static ssize_t set_sticky(struct device *dev, struct device_attribute *attr,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-10  8:53 drivers/scsi/53c700.c:2063:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (2 preceding siblings ...)
  2020-09-10  8:53 ` kernel test robot
@ 2020-09-10  8:53 ` kernel test robot
  2020-09-10  8:53 ` kernel test robot
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-10  8:53 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3156 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "Matan Ziv-Av" <matan@svgalib.org>
CC: Darren Hart <dvhart@infradead.org>
CC: Andy Shevchenko <andy@infradead.org>
CC: platform-driver-x86(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/platform/x86/lg-laptop.c:496:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/lg-laptop.c:322:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/lg-laptop.c:447:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/lg-laptop.c:406:8-16: WARNING: use scnprintf or sprintf
drivers/platform/x86/lg-laptop.c:364: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7fe10096c1508c7f033d34d0741809f8eecc1ed4
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 6 hours ago
:::::: commit date: 5 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 lg-laptop.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/platform/x86/lg-laptop.c
+++ b/drivers/platform/x86/lg-laptop.c
@@ -319,7 +319,7 @@ static ssize_t fan_mode_show(struct devi
 	status = r->integer.value & 0x01;
 	kfree(r);
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", status);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", status);
 }
 
 static ssize_t usb_charge_store(struct device *dev,
@@ -361,7 +361,7 @@ static ssize_t usb_charge_show(struct de
 
 	kfree(r);
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", status);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", status);
 }
 
 static ssize_t reader_mode_store(struct device *dev,
@@ -403,7 +403,7 @@ static ssize_t reader_mode_show(struct d
 
 	kfree(r);
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", status);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", status);
 }
 
 static ssize_t fn_lock_store(struct device *dev,
@@ -444,7 +444,7 @@ static ssize_t fn_lock_show(struct devic
 	status = !!r->buffer.pointer[0];
 	kfree(r);
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", status);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", status);
 }
 
 static ssize_t battery_care_limit_store(struct device *dev,
@@ -493,7 +493,7 @@ static ssize_t battery_care_limit_show(s
 	if (status != 80 && status != 100)
 		status = 0;
 
-	return snprintf(buffer, PAGE_SIZE, "%d\n", status);
+	return scnprintf(buffer, PAGE_SIZE, "%d\n", status);
 }
 
 static DEVICE_ATTR_RW(fan_mode);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-10  8:53 drivers/scsi/53c700.c:2063:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-09-10  8:53 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
  2020-09-10  8:53 ` kernel test robot
@ 2020-09-10  8:53 ` kernel test robot
  2020-09-10  8:53 ` kernel test robot
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-10  8:53 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1599 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: linux-ide(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/ide/ide-park.c:112: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7fe10096c1508c7f033d34d0741809f8eecc1ed4
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 6 hours ago
:::::: commit date: 5 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 ide-park.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/ide/ide-park.c
+++ b/drivers/ide/ide-park.c
@@ -109,7 +109,7 @@ ssize_t ide_park_show(struct device *dev
 		msecs = 0;
 	spin_unlock_irq(&hwif->lock);
 
-	return snprintf(buf, 20, "%u\n", msecs);
+	return scnprintf(buf, 20, "%u\n", msecs);
 }
 
 ssize_t ide_park_store(struct device *dev, struct device_attribute *attr,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-10  8:53 drivers/scsi/53c700.c:2063:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-09-10  8:53 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
@ 2020-09-10  8:53 ` kernel test robot
  2020-09-10  8:53 ` kernel test robot
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-10  8:53 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2860 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "Rafael J. Wysocki" <rjw@rjwysocki.net>
CC: Len Brown <lenb@kernel.org>
CC: linux-acpi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/acpi/dock.c:563:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/dock.c:544:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/dock.c:495:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/dock.c:506: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7fe10096c1508c7f033d34d0741809f8eecc1ed4
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 6 hours ago
:::::: commit date: 5 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 dock.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -492,7 +492,7 @@ static ssize_t show_docked(struct device
 	struct acpi_device *adev = NULL;
 
 	acpi_bus_get_device(dock_station->handle, &adev);
-	return snprintf(buf, PAGE_SIZE, "%u\n", acpi_device_enumerated(adev));
+	return scnprintf(buf, PAGE_SIZE, "%u\n", acpi_device_enumerated(adev));
 }
 static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL);
 
@@ -503,7 +503,7 @@ static ssize_t show_flags(struct device
 			  struct device_attribute *attr, char *buf)
 {
 	struct dock_station *dock_station = dev->platform_data;
-	return snprintf(buf, PAGE_SIZE, "%d\n", dock_station->flags);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", dock_station->flags);
 
 }
 static DEVICE_ATTR(flags, S_IRUGO, show_flags, NULL);
@@ -541,7 +541,7 @@ static ssize_t show_dock_uid(struct devi
 	if (ACPI_FAILURE(status))
 	    return 0;
 
-	return snprintf(buf, PAGE_SIZE, "%llx\n", lbuf);
+	return scnprintf(buf, PAGE_SIZE, "%llx\n", lbuf);
 }
 static DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL);
 
@@ -560,7 +560,7 @@ static ssize_t show_dock_type(struct dev
 	else
 		type = "unknown";
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", type);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", type);
 }
 static DEVICE_ATTR(type, S_IRUGO, show_dock_type, NULL);
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-10  8:53 drivers/scsi/53c700.c:2063:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-09-10  8:53 ` kernel test robot
  2020-09-10  8:53 ` kernel test robot
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-10  8:53 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1747 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/scsi/53c700.c:2063: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7fe10096c1508c7f033d34d0741809f8eecc1ed4
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 6 hours ago
:::::: commit date: 5 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 53c700.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -2060,7 +2060,7 @@ NCR_700_show_active_tags(struct device *
 {
 	struct scsi_device *SDp = to_scsi_device(dev);
 
-	return snprintf(buf, 20, "%d\n", NCR_700_get_depth(SDp));
+	return scnprintf(buf, 20, "%d\n", NCR_700_get_depth(SDp));
 }
 
 static struct device_attribute NCR_700_active_tags_attr = {

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-09 15:04 arch/x86/events/intel/pt.c:95:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-09-09 15:04 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-09 15:04 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1983 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Ingo Molnar <mingo@redhat.com>
CC: Arnaldo Carvalho de Melo <acme@kernel.org>
CC: Mark Rutland <mark.rutland@arm.com>
CC: Alexander Shishkin <alexander.shishkin@linux.intel.com>
CC: Jiri Olsa <jolsa@redhat.com>
CC: Namhyung Kim <namhyung@kernel.org>
CC: Thomas Gleixner <tglx@linutronix.de>

From: kernel test robot <lkp@intel.com>

arch/x86/events/intel/pt.c:95: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   34d4ddd359dbcdf6c5fb3f85a179243d7a1cb7f8
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 20 hours ago
:::::: commit date: 5 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 pt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/events/intel/pt.c
+++ b/arch/x86/events/intel/pt.c
@@ -92,7 +92,7 @@ static ssize_t pt_cap_show(struct device
 		container_of(attr, struct dev_ext_attribute, attr);
 	enum pt_capabilities cap = (long)ea->var;
 
-	return snprintf(buf, PAGE_SIZE, "%x\n", intel_pt_validate_hw_cap(cap));
+	return scnprintf(buf, PAGE_SIZE, "%x\n", intel_pt_validate_hw_cap(cap));
 }
 
 static struct attribute_group pt_cap_group __ro_after_init = {

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

* Re: [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-08 11:37     ` Bartlomiej Zolnierkiewicz
  (?)
  (?)
@ 2020-09-08 12:08     ` Julia Lawall
  -1 siblings, 0 replies; 99+ messages in thread
From: Julia Lawall @ 2020-09-08 12:08 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2588 bytes --]



On Tue, 8 Sep 2020, Bartlomiej Zolnierkiewicz wrote:

>
> Hi,
>
> On 8/10/20 11:21 AM, kernel test robot wrote:
> > From: kernel test robot <lkp@intel.com>
> >
> > drivers/video/fbdev/core/fbcon.c:3509:8-16: WARNING: use scnprintf or sprintf
> > drivers/video/fbdev/core/fbcon.c:3484: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
> > CC: Denis Efremov <efremov@linux.com>
> > Signed-off-by: kernel test robot <lkp@intel.com>
> > ---
> >
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head:   fc80c51fd4b23ec007e88d4c688f2cac1b8648e7
> > commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
> >
> > Please take the patch only if it's a positive warning. Thanks!
> >
> >  fbcon.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > --- a/drivers/video/fbdev/core/fbcon.c
> > +++ b/drivers/video/fbdev/core/fbcon.c
> > @@ -3481,7 +3481,7 @@ static ssize_t show_rotate(struct device
> >  	rotate = fbcon_get_rotate(info);
> >  err:
> >  	console_unlock();
> > -	return snprintf(buf, PAGE_SIZE, "%d\n", rotate);
> > +	return scnprintf(buf, PAGE_SIZE, "%d\n", rotate);
>
> buf length is at least PAGE_SIZE and rotate val is an int so
> shouldn't this be converted to use sprintf() instead?

The rule is evolving in this direction.  Thanks for the feedback.

julia

>
> >  }
> >
> >  static ssize_t show_cursor_blink(struct device *device,
> > @@ -3506,7 +3506,7 @@ static ssize_t show_cursor_blink(struct
> >  	blink = (ops->flags & FBCON_FLAGS_CURSOR_TIMER) ? 1 : 0;
> >  err:
> >  	console_unlock();
> > -	return snprintf(buf, PAGE_SIZE, "%d\n", blink);
> > +	return scnprintf(buf, PAGE_SIZE, "%d\n", blink);
>
> ditto for blink val
>
> >  }
> >
> >  static ssize_t store_cursor_blink(struct device *device,
> >
>
> Best regards,
> --
> Bartlomiej Zolnierkiewicz
> Samsung R&D Institute Poland
> Samsung Electronics
> _______________________________________________
> kbuild-all mailing list -- kbuild-all(a)lists.01.org
> To unsubscribe send an email to kbuild-all-leave(a)lists.01.org
>

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

* Re: [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-08-10  9:21   ` kernel test robot
  (?)
@ 2020-09-08 11:37     ` Bartlomiej Zolnierkiewicz
  -1 siblings, 0 replies; 99+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-09-08 11:37 UTC (permalink / raw)
  To: kernel test robot
  Cc: Denis Efremov, kbuild-all, linux-kernel, Julia Lawall,
	Daniel Vetter, Nathan Chancellor, Sam Ravnborg, Alex Deucher,
	Qiujun Huang, Peter Rosin, dri-devel


Hi,

On 8/10/20 11:21 AM, kernel test robot wrote:
> From: kernel test robot <lkp@intel.com>
> 
> drivers/video/fbdev/core/fbcon.c:3509:8-16: WARNING: use scnprintf or sprintf
> drivers/video/fbdev/core/fbcon.c:3484: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
> CC: Denis Efremov <efremov@linux.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> ---
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   fc80c51fd4b23ec007e88d4c688f2cac1b8648e7
> commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
> 
> Please take the patch only if it's a positive warning. Thanks!
> 
>  fbcon.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c
> @@ -3481,7 +3481,7 @@ static ssize_t show_rotate(struct device
>  	rotate = fbcon_get_rotate(info);
>  err:
>  	console_unlock();
> -	return snprintf(buf, PAGE_SIZE, "%d\n", rotate);
> +	return scnprintf(buf, PAGE_SIZE, "%d\n", rotate);

buf length is at least PAGE_SIZE and rotate val is an int so
shouldn't this be converted to use sprintf() instead?

>  }
>  
>  static ssize_t show_cursor_blink(struct device *device,
> @@ -3506,7 +3506,7 @@ static ssize_t show_cursor_blink(struct
>  	blink = (ops->flags & FBCON_FLAGS_CURSOR_TIMER) ? 1 : 0;
>  err:
>  	console_unlock();
> -	return snprintf(buf, PAGE_SIZE, "%d\n", blink);
> +	return scnprintf(buf, PAGE_SIZE, "%d\n", blink);

ditto for blink val

>  }
>  
>  static ssize_t store_cursor_blink(struct device *device,
> 
 
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

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

* Re: [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
@ 2020-09-08 11:37     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 99+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-09-08 11:37 UTC (permalink / raw)
  To: kernel test robot
  Cc: kbuild-all, Daniel Vetter, linux-kernel, Denis Efremov,
	Julia Lawall, dri-devel, Alex Deucher, Nathan Chancellor,
	Sam Ravnborg, Peter Rosin, Qiujun Huang


Hi,

On 8/10/20 11:21 AM, kernel test robot wrote:
> From: kernel test robot <lkp@intel.com>
> 
> drivers/video/fbdev/core/fbcon.c:3509:8-16: WARNING: use scnprintf or sprintf
> drivers/video/fbdev/core/fbcon.c:3484: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
> CC: Denis Efremov <efremov@linux.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> ---
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   fc80c51fd4b23ec007e88d4c688f2cac1b8648e7
> commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
> 
> Please take the patch only if it's a positive warning. Thanks!
> 
>  fbcon.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c
> @@ -3481,7 +3481,7 @@ static ssize_t show_rotate(struct device
>  	rotate = fbcon_get_rotate(info);
>  err:
>  	console_unlock();
> -	return snprintf(buf, PAGE_SIZE, "%d\n", rotate);
> +	return scnprintf(buf, PAGE_SIZE, "%d\n", rotate);

buf length is at least PAGE_SIZE and rotate val is an int so
shouldn't this be converted to use sprintf() instead?

>  }
>  
>  static ssize_t show_cursor_blink(struct device *device,
> @@ -3506,7 +3506,7 @@ static ssize_t show_cursor_blink(struct
>  	blink = (ops->flags & FBCON_FLAGS_CURSOR_TIMER) ? 1 : 0;
>  err:
>  	console_unlock();
> -	return snprintf(buf, PAGE_SIZE, "%d\n", blink);
> +	return scnprintf(buf, PAGE_SIZE, "%d\n", blink);

ditto for blink val

>  }
>  
>  static ssize_t store_cursor_blink(struct device *device,
> 
 
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
@ 2020-09-08 11:37     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 99+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-09-08 11:37 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2161 bytes --]


Hi,

On 8/10/20 11:21 AM, kernel test robot wrote:
> From: kernel test robot <lkp@intel.com>
> 
> drivers/video/fbdev/core/fbcon.c:3509:8-16: WARNING: use scnprintf or sprintf
> drivers/video/fbdev/core/fbcon.c:3484: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
> CC: Denis Efremov <efremov@linux.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> ---
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   fc80c51fd4b23ec007e88d4c688f2cac1b8648e7
> commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
> 
> Please take the patch only if it's a positive warning. Thanks!
> 
>  fbcon.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c
> @@ -3481,7 +3481,7 @@ static ssize_t show_rotate(struct device
>  	rotate = fbcon_get_rotate(info);
>  err:
>  	console_unlock();
> -	return snprintf(buf, PAGE_SIZE, "%d\n", rotate);
> +	return scnprintf(buf, PAGE_SIZE, "%d\n", rotate);

buf length is at least PAGE_SIZE and rotate val is an int so
shouldn't this be converted to use sprintf() instead?

>  }
>  
>  static ssize_t show_cursor_blink(struct device *device,
> @@ -3506,7 +3506,7 @@ static ssize_t show_cursor_blink(struct
>  	blink = (ops->flags & FBCON_FLAGS_CURSOR_TIMER) ? 1 : 0;
>  err:
>  	console_unlock();
> -	return snprintf(buf, PAGE_SIZE, "%d\n", blink);
> +	return scnprintf(buf, PAGE_SIZE, "%d\n", blink);

ditto for blink val

>  }
>  
>  static ssize_t store_cursor_blink(struct device *device,
> 
 
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-02 12:37 drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-09-02 12:37 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
  2020-09-02 12:37 ` kernel test robot
@ 2020-09-02 12:37 ` kernel test robot
  2 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-02 12:37 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3892 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Michal Januszewski <spock@gentoo.org>
CC: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
CC: linux-fbdev(a)vger.kernel.org
CC: dri-devel(a)lists.freedesktop.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/video/fbdev/uvesafb.c:1640:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/uvesafb.c:1626:9-17: WARNING: use scnprintf or sprintf
drivers/video/fbdev/uvesafb.c:1596:9-17: WARNING: use scnprintf or sprintf
drivers/video/fbdev/uvesafb.c:1611:9-17: WARNING: use scnprintf or sprintf
drivers/video/fbdev/uvesafb.c:1550:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/uvesafb.c:1581:9-17: 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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9c7d619be5a002ea29c172df5e3c1227c22cbb41
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 10 hours ago
:::::: commit date: 4 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 uvesafb.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -1547,7 +1547,7 @@ static ssize_t uvesafb_show_vbe_ver(stru
 	struct fb_info *info = dev_get_drvdata(dev);
 	struct uvesafb_par *par = info->par;
 
-	return snprintf(buf, PAGE_SIZE, "%.4x\n", par->vbe_ib.vbe_version);
+	return scnprintf(buf, PAGE_SIZE, "%.4x\n", par->vbe_ib.vbe_version);
 }
 
 static DEVICE_ATTR(vbe_version, S_IRUGO, uvesafb_show_vbe_ver, NULL);
@@ -1578,7 +1578,7 @@ static ssize_t uvesafb_show_vendor(struc
 	struct uvesafb_par *par = info->par;
 
 	if (par->vbe_ib.oem_vendor_name_ptr)
-		return snprintf(buf, PAGE_SIZE, "%s\n", (char *)
+		return scnprintf(buf, PAGE_SIZE, "%s\n", (char *)
 			(&par->vbe_ib) + par->vbe_ib.oem_vendor_name_ptr);
 	else
 		return 0;
@@ -1593,7 +1593,7 @@ static ssize_t uvesafb_show_product_name
 	struct uvesafb_par *par = info->par;
 
 	if (par->vbe_ib.oem_product_name_ptr)
-		return snprintf(buf, PAGE_SIZE, "%s\n", (char *)
+		return scnprintf(buf, PAGE_SIZE, "%s\n", (char *)
 			(&par->vbe_ib) + par->vbe_ib.oem_product_name_ptr);
 	else
 		return 0;
@@ -1608,7 +1608,7 @@ static ssize_t uvesafb_show_product_rev(
 	struct uvesafb_par *par = info->par;
 
 	if (par->vbe_ib.oem_product_rev_ptr)
-		return snprintf(buf, PAGE_SIZE, "%s\n", (char *)
+		return scnprintf(buf, PAGE_SIZE, "%s\n", (char *)
 			(&par->vbe_ib) + par->vbe_ib.oem_product_rev_ptr);
 	else
 		return 0;
@@ -1623,7 +1623,7 @@ static ssize_t uvesafb_show_oem_string(s
 	struct uvesafb_par *par = info->par;
 
 	if (par->vbe_ib.oem_string_ptr)
-		return snprintf(buf, PAGE_SIZE, "%s\n",
+		return scnprintf(buf, PAGE_SIZE, "%s\n",
 			(char *)(&par->vbe_ib) + par->vbe_ib.oem_string_ptr);
 	else
 		return 0;
@@ -1637,7 +1637,7 @@ static ssize_t uvesafb_show_nocrtc(struc
 	struct fb_info *info = dev_get_drvdata(dev);
 	struct uvesafb_par *par = info->par;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", par->nocrtc);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", par->nocrtc);
 }
 
 static ssize_t uvesafb_store_nocrtc(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-02 12:37 drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-09-02 12:37 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
@ 2020-09-02 12:37 ` kernel test robot
  2020-09-02 12:37 ` kernel test robot
  2 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-02 12:37 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5034 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Hans de Goede <hdegoede@redhat.com>
CC: Jean Delvare <jdelvare@suse.com>
CC: Guenter Roeck <linux@roeck-us.net>
CC: linux-hwmon(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/hwmon/sch5627.c:275:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5627.c:288:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5627.c:263:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5627.c:312:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5627.c:304:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5627.c:198:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5627.c:246:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5627.c:224:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5627.c:235:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/sch5627.c:212: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9c7d619be5a002ea29c172df5e3c1227c22cbb41
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 10 hours ago
:::::: commit date: 4 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 sch5627.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

--- a/drivers/hwmon/sch5627.c
+++ b/drivers/hwmon/sch5627.c
@@ -195,7 +195,7 @@ static int reg_to_rpm(u16 reg)
 static ssize_t name_show(struct device *dev, struct device_attribute *devattr,
 	char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "%s\n", DEVNAME);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", DEVNAME);
 }
 
 static ssize_t temp_show(struct device *dev, struct device_attribute *devattr,
@@ -209,7 +209,7 @@ static ssize_t temp_show(struct device *
 		return PTR_ERR(data);
 
 	val = reg_to_temp(data->temp[attr->index]);
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t temp_fault_show(struct device *dev,
@@ -221,7 +221,7 @@ static ssize_t temp_fault_show(struct de
 	if (IS_ERR(data))
 		return PTR_ERR(data);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", data->temp[attr->index] == 0);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", data->temp[attr->index] == 0);
 }
 
 static ssize_t temp_max_show(struct device *dev,
@@ -232,7 +232,7 @@ static ssize_t temp_max_show(struct devi
 	int val;
 
 	val = reg_to_temp_limit(data->temp_max[attr->index]);
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t temp_crit_show(struct device *dev,
@@ -243,7 +243,7 @@ static ssize_t temp_crit_show(struct dev
 	int val;
 
 	val = reg_to_temp_limit(data->temp_crit[attr->index]);
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t fan_show(struct device *dev, struct device_attribute *devattr,
@@ -260,7 +260,7 @@ static ssize_t fan_show(struct device *d
 	if (val < 0)
 		return val;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t fan_fault_show(struct device *dev,
@@ -272,7 +272,7 @@ static ssize_t fan_fault_show(struct dev
 	if (IS_ERR(data))
 		return PTR_ERR(data);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n",
+	return scnprintf(buf, PAGE_SIZE, "%d\n",
 			data->fan[attr->index] == 0xffff);
 }
 
@@ -285,7 +285,7 @@ static ssize_t fan_min_show(struct devic
 	if (val < 0)
 		return val;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t in_show(struct device *dev, struct device_attribute *devattr,
@@ -301,7 +301,7 @@ static ssize_t in_show(struct device *de
 	val = DIV_ROUND_CLOSEST(
 		data->in[attr->index] * SCH5627_REG_IN_FACTOR[attr->index],
 		10000);
-	return snprintf(buf, PAGE_SIZE, "%d\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", val);
 }
 
 static ssize_t in_label_show(struct device *dev,
@@ -309,7 +309,7 @@ static ssize_t in_label_show(struct devi
 {
 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 
-	return snprintf(buf, PAGE_SIZE, "%s\n",
+	return scnprintf(buf, PAGE_SIZE, "%s\n",
 			SCH5627_IN_LABELS[attr->index]);
 }
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-02 12:37 drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-09-02 12:37 ` kernel test robot
  2020-09-02 12:37 ` kernel test robot
  2020-09-02 12:37 ` kernel test robot
  2 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-02 12:37 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2237 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Borislav Petkov <bp@alien8.de>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Tony Luck <tony.luck@intel.com>
CC: James Morse <james.morse@arm.com>
CC: Robert Richter <rrichter@marvell.com>
CC: linux-edac(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf
drivers/edac/edac_mc_sysfs.c:490: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9c7d619be5a002ea29c172df5e3c1227c22cbb41
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 10 hours ago
:::::: commit date: 4 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 edac_mc_sysfs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -207,7 +207,7 @@ static ssize_t channel_dimm_label_show(s
 	if (!rank->dimm->label[0])
 		return 0;
 
-	return snprintf(data, sizeof(rank->dimm->label) + 1, "%s\n",
+	return scnprintf(data, sizeof(rank->dimm->label) + 1, "%s\n",
 			rank->dimm->label);
 }
 
@@ -487,7 +487,7 @@ static ssize_t dimmdev_label_show(struct
 	if (!dimm->label[0])
 		return 0;
 
-	return snprintf(data, sizeof(dimm->label) + 1, "%s\n", dimm->label);
+	return scnprintf(data, sizeof(dimm->label) + 1, "%s\n", dimm->label);
 }
 
 static ssize_t dimmdev_label_store(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-09-01  8:46 drivers/scsi/pmcraid.c:4091:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-09-01  8:46 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-09-01  8:46 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2474 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/scsi/pmcraid.c:4091:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/pmcraid.c:4058:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/pmcraid.c:3999: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b51594df17d0ce80b9f9f35394a1f42d7ac94472
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 13 hours ago
:::::: commit date: 4 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 pmcraid.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -3996,7 +3996,7 @@ static ssize_t pmcraid_show_log_level(
 	struct Scsi_Host *shost = class_to_shost(dev);
 	struct pmcraid_instance *pinstance =
 		(struct pmcraid_instance *)shost->hostdata;
-	return snprintf(buf, PAGE_SIZE, "%d\n", pinstance->current_log_level);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", pinstance->current_log_level);
 }
 
 /**
@@ -4055,7 +4055,7 @@ static ssize_t pmcraid_show_drv_version(
 	char *buf
 )
 {
-	return snprintf(buf, PAGE_SIZE, "version: %s\n",
+	return scnprintf(buf, PAGE_SIZE, "version: %s\n",
 			PMCRAID_DRIVER_VERSION);
 }
 
@@ -4088,7 +4088,7 @@ static ssize_t pmcraid_show_adapter_id(
 		pinstance->pdev->devfn;
 	u32 aen_group = pmcraid_event_family.id;
 
-	return snprintf(buf, PAGE_SIZE,
+	return scnprintf(buf, PAGE_SIZE,
 			"adapter id: %d\nminor: %d\naen group: %d\n",
 			adapter_id, MINOR(pinstance->cdev.dev), aen_group);
 }

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-08-26 19:38 drivers/scsi/aacraid/linit.c:1355:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-08-26 19:38 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-26 19:38 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3668 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Adaptec OEM Raid Solutions <aacraid@microsemi.com>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/scsi/aacraid/linit.c:1355:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/aacraid/linit.c:1381:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/aacraid/linit.c:1388:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/aacraid/linit.c:563:9-17: WARNING: use scnprintf or sprintf
drivers/scsi/aacraid/linit.c:590: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2ac69819ba9e3d8d550bb5d2d2df74848e556812
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 19 hours ago
:::::: commit date: 3 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 linit.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -560,10 +560,10 @@ static ssize_t aac_show_raid_level(struc
 	struct scsi_device *sdev = to_scsi_device(dev);
 	struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata);
 	if (sdev_channel(sdev) != CONTAINER_CHANNEL)
-		return snprintf(buf, PAGE_SIZE, sdev->no_uld_attach
+		return scnprintf(buf, PAGE_SIZE, sdev->no_uld_attach
 		  ? "Hidden\n" :
 		  ((aac->jbod && (sdev->type == TYPE_DISK)) ? "JBOD\n" : ""));
-	return snprintf(buf, PAGE_SIZE, "%s\n",
+	return scnprintf(buf, PAGE_SIZE, "%s\n",
 	  get_container_type(aac->fsa_dev[sdev_id(sdev)].type));
 }
 
@@ -587,7 +587,7 @@ static ssize_t aac_show_unique_id(struct
 	if (sdev_channel(sdev) == CONTAINER_CHANNEL)
 		memcpy(sn, aac->fsa_dev[sdev_id(sdev)].identifier, sizeof(sn));
 
-	return snprintf(buf, 16 * 2 + 2,
+	return scnprintf(buf, 16 * 2 + 2,
 		"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X\n",
 		sn[0], sn[1], sn[2], sn[3],
 		sn[4], sn[5], sn[6], sn[7],
@@ -1352,7 +1352,7 @@ static ssize_t aac_show_driver_version(s
 					struct device_attribute *attr,
 					char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "%s\n", aac_driver_version);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", aac_driver_version);
 }
 
 static ssize_t aac_show_serial_number(struct device *device,
@@ -1378,14 +1378,14 @@ static ssize_t aac_show_serial_number(st
 static ssize_t aac_show_max_channel(struct device *device,
 				    struct device_attribute *attr, char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "%d\n",
+	return scnprintf(buf, PAGE_SIZE, "%d\n",
 	  class_to_shost(device)->max_channel);
 }
 
 static ssize_t aac_show_max_id(struct device *device,
 			       struct device_attribute *attr, char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "%d\n",
+	return scnprintf(buf, PAGE_SIZE, "%d\n",
 	  class_to_shost(device)->max_id);
 }
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-08-18 22:52 drivers/video/fbdev/sstfb.c:736:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-08-18 22:52 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-18 22:52 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1879 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
CC: Daniel Vetter <daniel.vetter@ffwll.ch>
CC: Jani Nikula <jani.nikula@intel.com>
CC: Arnd Bergmann <arnd@arndb.de>
CC: dri-devel(a)lists.freedesktop.org
CC: linux-fbdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/video/fbdev/sstfb.c:736: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   18445bf405cb331117bc98427b1ba6f12418ad17
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
:::::: branch date: 85 minutes ago
:::::: commit date: 2 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 sstfb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/video/fbdev/sstfb.c
+++ b/drivers/video/fbdev/sstfb.c
@@ -733,7 +733,7 @@ static ssize_t show_vgapass(struct devic
 {
 	struct fb_info *info = dev_get_drvdata(device);
 	struct sstfb_par *par = info->par;
-	return snprintf(buf, PAGE_SIZE, "%d\n", par->vgapass);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", par->vgapass);
 }
 
 static struct device_attribute device_attrs[] = {

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-08-13  0:56 drivers/acpi/dock.c:563:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-08-13  0:56   ` kernel test robot
  2020-08-13  0:56   ` kernel test robot
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: Denis Efremov
  Cc: kbuild-all, linux-kernel, Julia Lawall, Jiri Kosina,
	Benjamin Tissoires, linux-input

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-sony.c:611:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-sony.c:648:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-sony.c:660: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 hid-sony.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -608,7 +608,7 @@ static ssize_t ds4_show_poll_interval(st
 	struct hid_device *hdev = to_hid_device(dev);
 	struct sony_sc *sc = hid_get_drvdata(hdev);
 
-	return snprintf(buf, PAGE_SIZE, "%i\n", sc->ds4_bt_poll_interval);
+	return scnprintf(buf, PAGE_SIZE, "%i\n", sc->ds4_bt_poll_interval);
 }
 
 static ssize_t ds4_store_poll_interval(struct device *dev,
@@ -645,7 +645,7 @@ static ssize_t sony_show_firmware_versio
 	struct hid_device *hdev = to_hid_device(dev);
 	struct sony_sc *sc = hid_get_drvdata(hdev);
 
-	return snprintf(buf, PAGE_SIZE, "0x%04x\n", sc->fw_version);
+	return scnprintf(buf, PAGE_SIZE, "0x%04x\n", sc->fw_version);
 }
 
 static DEVICE_ATTR(firmware_version, 0444, sony_show_firmware_version, NULL);
@@ -657,7 +657,7 @@ static ssize_t sony_show_hardware_versio
 	struct hid_device *hdev = to_hid_device(dev);
 	struct sony_sc *sc = hid_get_drvdata(hdev);
 
-	return snprintf(buf, PAGE_SIZE, "0x%04x\n", sc->hw_version);
+	return scnprintf(buf, PAGE_SIZE, "0x%04x\n", sc->hw_version);
 }
 
 static DEVICE_ATTR(hardware_version, 0444, sony_show_hardware_version, NULL);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
@ 2020-08-13  0:56   ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2296 bytes --]

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-sony.c:611:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-sony.c:648:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-sony.c:660: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 hid-sony.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -608,7 +608,7 @@ static ssize_t ds4_show_poll_interval(st
 	struct hid_device *hdev = to_hid_device(dev);
 	struct sony_sc *sc = hid_get_drvdata(hdev);
 
-	return snprintf(buf, PAGE_SIZE, "%i\n", sc->ds4_bt_poll_interval);
+	return scnprintf(buf, PAGE_SIZE, "%i\n", sc->ds4_bt_poll_interval);
 }
 
 static ssize_t ds4_store_poll_interval(struct device *dev,
@@ -645,7 +645,7 @@ static ssize_t sony_show_firmware_versio
 	struct hid_device *hdev = to_hid_device(dev);
 	struct sony_sc *sc = hid_get_drvdata(hdev);
 
-	return snprintf(buf, PAGE_SIZE, "0x%04x\n", sc->fw_version);
+	return scnprintf(buf, PAGE_SIZE, "0x%04x\n", sc->fw_version);
 }
 
 static DEVICE_ATTR(firmware_version, 0444, sony_show_firmware_version, NULL);
@@ -657,7 +657,7 @@ static ssize_t sony_show_hardware_versio
 	struct hid_device *hdev = to_hid_device(dev);
 	struct sony_sc *sc = hid_get_drvdata(hdev);
 
-	return snprintf(buf, PAGE_SIZE, "0x%04x\n", sc->hw_version);
+	return scnprintf(buf, PAGE_SIZE, "0x%04x\n", sc->hw_version);
 }
 
 static DEVICE_ATTR(hardware_version, 0444, sony_show_hardware_version, NULL);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-08-13  0:56 drivers/acpi/dock.c:563:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-08-13  0:56   ` kernel test robot
  2020-08-13  0:56   ` kernel test robot
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: Denis Efremov
  Cc: kbuild-all, linux-kernel, Julia Lawall, Stefan Achatz,
	Jiri Kosina, Benjamin Tissoires, linux-input

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-roccat-pyra.c:289:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-pyra.c:306:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-pyra.c:327: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 hid-roccat-pyra.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/hid/hid-roccat-pyra.c
+++ b/drivers/hid/hid-roccat-pyra.c
@@ -286,7 +286,7 @@ static ssize_t pyra_sysfs_show_actual_cp
 {
 	struct pyra_device *pyra =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", pyra->actual_cpi);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", pyra->actual_cpi);
 }
 static DEVICE_ATTR(actual_cpi, 0440, pyra_sysfs_show_actual_cpi, NULL);
 
@@ -303,7 +303,7 @@ static ssize_t pyra_sysfs_show_actual_pr
 			&settings, PYRA_SIZE_SETTINGS);
 	mutex_unlock(&pyra->pyra_lock);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", settings.startup_profile);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", settings.startup_profile);
 }
 static DEVICE_ATTR(actual_profile, 0440, pyra_sysfs_show_actual_profile, NULL);
 static DEVICE_ATTR(startup_profile, 0440, pyra_sysfs_show_actual_profile, NULL);
@@ -324,7 +324,7 @@ static ssize_t pyra_sysfs_show_firmware_
 			&info, PYRA_SIZE_INFO);
 	mutex_unlock(&pyra->pyra_lock);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
 }
 static DEVICE_ATTR(firmware_version, 0440, pyra_sysfs_show_firmware_version,
 		   NULL);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
@ 2020-08-13  0:56   ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2384 bytes --]

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-roccat-pyra.c:289:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-pyra.c:306:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-pyra.c:327: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 hid-roccat-pyra.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/hid/hid-roccat-pyra.c
+++ b/drivers/hid/hid-roccat-pyra.c
@@ -286,7 +286,7 @@ static ssize_t pyra_sysfs_show_actual_cp
 {
 	struct pyra_device *pyra =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", pyra->actual_cpi);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", pyra->actual_cpi);
 }
 static DEVICE_ATTR(actual_cpi, 0440, pyra_sysfs_show_actual_cpi, NULL);
 
@@ -303,7 +303,7 @@ static ssize_t pyra_sysfs_show_actual_pr
 			&settings, PYRA_SIZE_SETTINGS);
 	mutex_unlock(&pyra->pyra_lock);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", settings.startup_profile);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", settings.startup_profile);
 }
 static DEVICE_ATTR(actual_profile, 0440, pyra_sysfs_show_actual_profile, NULL);
 static DEVICE_ATTR(startup_profile, 0440, pyra_sysfs_show_actual_profile, NULL);
@@ -324,7 +324,7 @@ static ssize_t pyra_sysfs_show_firmware_
 			&info, PYRA_SIZE_INFO);
 	mutex_unlock(&pyra->pyra_lock);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
 }
 static DEVICE_ATTR(firmware_version, 0440, pyra_sysfs_show_firmware_version,
 		   NULL);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-08-13  0:56 drivers/acpi/dock.c:563:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-08-13  0:56   ` kernel test robot
  2020-08-13  0:56   ` kernel test robot
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: Denis Efremov
  Cc: kbuild-all, linux-kernel, Julia Lawall, Stefan Achatz,
	Jiri Kosina, Benjamin Tissoires, linux-input

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-roccat-kovaplus.c:330:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kovaplus.c:277:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kovaplus.c:339:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kovaplus.c:349:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kovaplus.c:370: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 hid-roccat-kovaplus.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/hid/hid-roccat-kovaplus.c
+++ b/drivers/hid/hid-roccat-kovaplus.c
@@ -274,7 +274,7 @@ static ssize_t kovaplus_sysfs_show_actua
 {
 	struct kovaplus_device *kovaplus =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_profile);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_profile);
 }
 
 static ssize_t kovaplus_sysfs_set_actual_profile(struct device *dev,
@@ -327,7 +327,7 @@ static ssize_t kovaplus_sysfs_show_actua
 {
 	struct kovaplus_device *kovaplus =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_cpi);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_cpi);
 }
 static DEVICE_ATTR(actual_cpi, 0440, kovaplus_sysfs_show_actual_cpi, NULL);
 
@@ -336,7 +336,7 @@ static ssize_t kovaplus_sysfs_show_actua
 {
 	struct kovaplus_device *kovaplus =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_x_sensitivity);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_x_sensitivity);
 }
 static DEVICE_ATTR(actual_sensitivity_x, 0440,
 		   kovaplus_sysfs_show_actual_sensitivity_x, NULL);
@@ -346,7 +346,7 @@ static ssize_t kovaplus_sysfs_show_actua
 {
 	struct kovaplus_device *kovaplus =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_y_sensitivity);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_y_sensitivity);
 }
 static DEVICE_ATTR(actual_sensitivity_y, 0440,
 		   kovaplus_sysfs_show_actual_sensitivity_y, NULL);
@@ -367,7 +367,7 @@ static ssize_t kovaplus_sysfs_show_firmw
 			&info, KOVAPLUS_SIZE_INFO);
 	mutex_unlock(&kovaplus->kovaplus_lock);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
 }
 static DEVICE_ATTR(firmware_version, 0440,
 		   kovaplus_sysfs_show_firmware_version, NULL);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
@ 2020-08-13  0:56   ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3394 bytes --]

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-roccat-kovaplus.c:330:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kovaplus.c:277:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kovaplus.c:339:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kovaplus.c:349:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kovaplus.c:370: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 hid-roccat-kovaplus.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/hid/hid-roccat-kovaplus.c
+++ b/drivers/hid/hid-roccat-kovaplus.c
@@ -274,7 +274,7 @@ static ssize_t kovaplus_sysfs_show_actua
 {
 	struct kovaplus_device *kovaplus =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_profile);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_profile);
 }
 
 static ssize_t kovaplus_sysfs_set_actual_profile(struct device *dev,
@@ -327,7 +327,7 @@ static ssize_t kovaplus_sysfs_show_actua
 {
 	struct kovaplus_device *kovaplus =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_cpi);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_cpi);
 }
 static DEVICE_ATTR(actual_cpi, 0440, kovaplus_sysfs_show_actual_cpi, NULL);
 
@@ -336,7 +336,7 @@ static ssize_t kovaplus_sysfs_show_actua
 {
 	struct kovaplus_device *kovaplus =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_x_sensitivity);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_x_sensitivity);
 }
 static DEVICE_ATTR(actual_sensitivity_x, 0440,
 		   kovaplus_sysfs_show_actual_sensitivity_x, NULL);
@@ -346,7 +346,7 @@ static ssize_t kovaplus_sysfs_show_actua
 {
 	struct kovaplus_device *kovaplus =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_y_sensitivity);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_y_sensitivity);
 }
 static DEVICE_ATTR(actual_sensitivity_y, 0440,
 		   kovaplus_sysfs_show_actual_sensitivity_y, NULL);
@@ -367,7 +367,7 @@ static ssize_t kovaplus_sysfs_show_firmw
 			&info, KOVAPLUS_SIZE_INFO);
 	mutex_unlock(&kovaplus->kovaplus_lock);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
 }
 static DEVICE_ATTR(firmware_version, 0440,
 		   kovaplus_sysfs_show_firmware_version, NULL);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-08-13  0:56 drivers/acpi/dock.c:563:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-08-13  0:56   ` kernel test robot
  2020-08-13  0:56   ` kernel test robot
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: Denis Efremov
  Cc: kbuild-all, linux-kernel, Julia Lawall, Stefan Achatz,
	Jiri Kosina, Benjamin Tissoires, linux-input

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-roccat-koneplus.c:247:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-koneplus.c:314: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 hid-roccat-koneplus.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/hid/hid-roccat-koneplus.c
+++ b/drivers/hid/hid-roccat-koneplus.c
@@ -244,7 +244,7 @@ static ssize_t koneplus_sysfs_show_actua
 {
 	struct koneplus_device *koneplus =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", koneplus->actual_profile);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", koneplus->actual_profile);
 }
 
 static ssize_t koneplus_sysfs_set_actual_profile(struct device *dev,
@@ -311,7 +311,7 @@ static ssize_t koneplus_sysfs_show_firmw
 			&info, KONEPLUS_SIZE_INFO);
 	mutex_unlock(&koneplus->koneplus_lock);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
 }
 static DEVICE_ATTR(firmware_version, 0440,
 		   koneplus_sysfs_show_firmware_version, NULL);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
@ 2020-08-13  0:56   ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1917 bytes --]

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-roccat-koneplus.c:247:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-koneplus.c:314: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 hid-roccat-koneplus.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/hid/hid-roccat-koneplus.c
+++ b/drivers/hid/hid-roccat-koneplus.c
@@ -244,7 +244,7 @@ static ssize_t koneplus_sysfs_show_actua
 {
 	struct koneplus_device *koneplus =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", koneplus->actual_profile);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", koneplus->actual_profile);
 }
 
 static ssize_t koneplus_sysfs_set_actual_profile(struct device *dev,
@@ -311,7 +311,7 @@ static ssize_t koneplus_sysfs_show_firmw
 			&info, KONEPLUS_SIZE_INFO);
 	mutex_unlock(&koneplus->koneplus_lock);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
 }
 static DEVICE_ATTR(firmware_version, 0440,
 		   koneplus_sysfs_show_firmware_version, NULL);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-08-13  0:56 drivers/acpi/dock.c:563:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-08-13  0:56   ` kernel test robot
  2020-08-13  0:56   ` kernel test robot
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: Denis Efremov
  Cc: kbuild-all, linux-kernel, Julia Lawall, Stefan Achatz,
	Jiri Kosina, Benjamin Tissoires, linux-input

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-roccat-kone.c:406:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kone.c:397:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kone.c:438:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kone.c:550:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kone.c:448:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kone.c:429: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 hid-roccat-kone.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/hid/hid-roccat-kone.c
+++ b/drivers/hid/hid-roccat-kone.c
@@ -394,7 +394,7 @@ static ssize_t kone_sysfs_show_actual_pr
 {
 	struct kone_device *kone =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kone->actual_profile);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kone->actual_profile);
 }
 static DEVICE_ATTR(actual_profile, 0440, kone_sysfs_show_actual_profile, NULL);
 
@@ -403,7 +403,7 @@ static ssize_t kone_sysfs_show_actual_dp
 {
 	struct kone_device *kone =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kone->actual_dpi);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kone->actual_dpi);
 }
 static DEVICE_ATTR(actual_dpi, 0440, kone_sysfs_show_actual_dpi, NULL);
 
@@ -426,7 +426,7 @@ static ssize_t kone_sysfs_show_weight(st
 
 	if (retval)
 		return retval;
-	return snprintf(buf, PAGE_SIZE, "%d\n", weight);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", weight);
 }
 static DEVICE_ATTR(weight, 0440, kone_sysfs_show_weight, NULL);
 
@@ -435,7 +435,7 @@ static ssize_t kone_sysfs_show_firmware_
 {
 	struct kone_device *kone =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kone->firmware_version);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kone->firmware_version);
 }
 static DEVICE_ATTR(firmware_version, 0440, kone_sysfs_show_firmware_version,
 		   NULL);
@@ -445,7 +445,7 @@ static ssize_t kone_sysfs_show_tcu(struc
 {
 	struct kone_device *kone =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.tcu);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kone->settings.tcu);
 }
 
 static int kone_tcu_command(struct usb_device *usb_dev, int number)
@@ -547,7 +547,7 @@ static ssize_t kone_sysfs_show_startup_p
 {
 	struct kone_device *kone =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.startup_profile);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kone->settings.startup_profile);
 }
 
 static ssize_t kone_sysfs_set_startup_profile(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
@ 2020-08-13  0:56   ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3598 bytes --]

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-roccat-kone.c:406:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kone.c:397:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kone.c:438:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kone.c:550:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kone.c:448:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kone.c:429: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 hid-roccat-kone.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/hid/hid-roccat-kone.c
+++ b/drivers/hid/hid-roccat-kone.c
@@ -394,7 +394,7 @@ static ssize_t kone_sysfs_show_actual_pr
 {
 	struct kone_device *kone =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kone->actual_profile);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kone->actual_profile);
 }
 static DEVICE_ATTR(actual_profile, 0440, kone_sysfs_show_actual_profile, NULL);
 
@@ -403,7 +403,7 @@ static ssize_t kone_sysfs_show_actual_dp
 {
 	struct kone_device *kone =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kone->actual_dpi);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kone->actual_dpi);
 }
 static DEVICE_ATTR(actual_dpi, 0440, kone_sysfs_show_actual_dpi, NULL);
 
@@ -426,7 +426,7 @@ static ssize_t kone_sysfs_show_weight(st
 
 	if (retval)
 		return retval;
-	return snprintf(buf, PAGE_SIZE, "%d\n", weight);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", weight);
 }
 static DEVICE_ATTR(weight, 0440, kone_sysfs_show_weight, NULL);
 
@@ -435,7 +435,7 @@ static ssize_t kone_sysfs_show_firmware_
 {
 	struct kone_device *kone =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kone->firmware_version);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kone->firmware_version);
 }
 static DEVICE_ATTR(firmware_version, 0440, kone_sysfs_show_firmware_version,
 		   NULL);
@@ -445,7 +445,7 @@ static ssize_t kone_sysfs_show_tcu(struc
 {
 	struct kone_device *kone =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.tcu);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kone->settings.tcu);
 }
 
 static int kone_tcu_command(struct usb_device *usb_dev, int number)
@@ -547,7 +547,7 @@ static ssize_t kone_sysfs_show_startup_p
 {
 	struct kone_device *kone =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.startup_profile);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", kone->settings.startup_profile);
 }
 
 static ssize_t kone_sysfs_set_startup_profile(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-08-13  0:56 drivers/acpi/dock.c:563:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-08-13  0:56   ` kernel test robot
  2020-08-13  0:56   ` kernel test robot
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: Denis Efremov
  Cc: kbuild-all, linux-kernel, Julia Lawall, Stefan Achatz,
	Jiri Kosina, Benjamin Tissoires, linux-input

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-roccat-isku.c:66: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 hid-roccat-isku.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/hid/hid-roccat-isku.c
+++ b/drivers/hid/hid-roccat-isku.c
@@ -63,7 +63,7 @@ static ssize_t isku_sysfs_show_actual_pr
 {
 	struct isku_device *isku =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", isku->actual_profile);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", isku->actual_profile);
 }
 
 static ssize_t isku_sysfs_set_actual_profile(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
@ 2020-08-13  0:56   ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1418 bytes --]

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-roccat-isku.c:66: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 hid-roccat-isku.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/hid/hid-roccat-isku.c
+++ b/drivers/hid/hid-roccat-isku.c
@@ -63,7 +63,7 @@ static ssize_t isku_sysfs_show_actual_pr
 {
 	struct isku_device *isku =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", isku->actual_profile);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", isku->actual_profile);
 }
 
 static ssize_t isku_sysfs_set_actual_profile(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-08-13  0:56 drivers/acpi/dock.c:563:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-08-13  0:56   ` kernel test robot
  2020-08-13  0:56   ` kernel test robot
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: Denis Efremov
  Cc: kbuild-all, linux-kernel, Julia Lawall, Stefan Achatz,
	Jiri Kosina, Benjamin Tissoires, linux-input

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-roccat-arvo.c:149:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-arvo.c:95:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-arvo.c:45: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 hid-roccat-arvo.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/hid/hid-roccat-arvo.c
+++ b/drivers/hid/hid-roccat-arvo.c
@@ -42,7 +42,7 @@ static ssize_t arvo_sysfs_show_mode_key(
 	if (retval)
 		return retval;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", temp_buf.state);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", temp_buf.state);
 }
 
 static ssize_t arvo_sysfs_set_mode_key(struct device *dev,
@@ -92,7 +92,7 @@ static ssize_t arvo_sysfs_show_key_mask(
 	if (retval)
 		return retval;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", temp_buf.key_mask);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", temp_buf.key_mask);
 }
 
 static ssize_t arvo_sysfs_set_key_mask(struct device *dev,
@@ -146,7 +146,7 @@ static ssize_t arvo_sysfs_show_actual_pr
 	struct arvo_device *arvo =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", arvo->actual_profile);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", arvo->actual_profile);
 }
 
 static ssize_t arvo_sysfs_set_actual_profile(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
@ 2020-08-13  0:56   ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2152 bytes --]

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-roccat-arvo.c:149:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-arvo.c:95:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-arvo.c:45: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 hid-roccat-arvo.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/hid/hid-roccat-arvo.c
+++ b/drivers/hid/hid-roccat-arvo.c
@@ -42,7 +42,7 @@ static ssize_t arvo_sysfs_show_mode_key(
 	if (retval)
 		return retval;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", temp_buf.state);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", temp_buf.state);
 }
 
 static ssize_t arvo_sysfs_set_mode_key(struct device *dev,
@@ -92,7 +92,7 @@ static ssize_t arvo_sysfs_show_key_mask(
 	if (retval)
 		return retval;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", temp_buf.key_mask);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", temp_buf.key_mask);
 }
 
 static ssize_t arvo_sysfs_set_key_mask(struct device *dev,
@@ -146,7 +146,7 @@ static ssize_t arvo_sysfs_show_actual_pr
 	struct arvo_device *arvo =
 			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", arvo->actual_profile);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", arvo->actual_profile);
 }
 
 static ssize_t arvo_sysfs_set_actual_profile(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-08-13  0:56 drivers/acpi/dock.c:563:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-08-13  0:56   ` kernel test robot
  2020-08-13  0:56   ` kernel test robot
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: Denis Efremov
  Cc: kbuild-all, linux-kernel, Julia Lawall, Rafael J. Wysocki,
	Len Brown, linux-acpi

From: kernel test robot <lkp@intel.com>

drivers/acpi/dock.c:563:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/dock.c:544:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/dock.c:495:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/dock.c:506: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 dock.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -492,7 +492,7 @@ static ssize_t show_docked(struct device
 	struct acpi_device *adev = NULL;
 
 	acpi_bus_get_device(dock_station->handle, &adev);
-	return snprintf(buf, PAGE_SIZE, "%u\n", acpi_device_enumerated(adev));
+	return scnprintf(buf, PAGE_SIZE, "%u\n", acpi_device_enumerated(adev));
 }
 static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL);
 
@@ -503,7 +503,7 @@ static ssize_t show_flags(struct device
 			  struct device_attribute *attr, char *buf)
 {
 	struct dock_station *dock_station = dev->platform_data;
-	return snprintf(buf, PAGE_SIZE, "%d\n", dock_station->flags);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", dock_station->flags);
 
 }
 static DEVICE_ATTR(flags, S_IRUGO, show_flags, NULL);
@@ -541,7 +541,7 @@ static ssize_t show_dock_uid(struct devi
 	if (ACPI_FAILURE(status))
 	    return 0;
 
-	return snprintf(buf, PAGE_SIZE, "%llx\n", lbuf);
+	return scnprintf(buf, PAGE_SIZE, "%llx\n", lbuf);
 }
 static DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL);
 
@@ -560,7 +560,7 @@ static ssize_t show_dock_type(struct dev
 	else
 		type = "unknown";
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", type);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", type);
 }
 static DEVICE_ATTR(type, S_IRUGO, show_dock_type, NULL);
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
@ 2020-08-13  0:56   ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-13  0:56 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2497 bytes --]

From: kernel test robot <lkp@intel.com>

drivers/acpi/dock.c:563:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/dock.c:544:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/dock.c:495:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/dock.c:506: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 dock.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -492,7 +492,7 @@ static ssize_t show_docked(struct device
 	struct acpi_device *adev = NULL;
 
 	acpi_bus_get_device(dock_station->handle, &adev);
-	return snprintf(buf, PAGE_SIZE, "%u\n", acpi_device_enumerated(adev));
+	return scnprintf(buf, PAGE_SIZE, "%u\n", acpi_device_enumerated(adev));
 }
 static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL);
 
@@ -503,7 +503,7 @@ static ssize_t show_flags(struct device
 			  struct device_attribute *attr, char *buf)
 {
 	struct dock_station *dock_station = dev->platform_data;
-	return snprintf(buf, PAGE_SIZE, "%d\n", dock_station->flags);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", dock_station->flags);
 
 }
 static DEVICE_ATTR(flags, S_IRUGO, show_flags, NULL);
@@ -541,7 +541,7 @@ static ssize_t show_dock_uid(struct devi
 	if (ACPI_FAILURE(status))
 	    return 0;
 
-	return snprintf(buf, PAGE_SIZE, "%llx\n", lbuf);
+	return scnprintf(buf, PAGE_SIZE, "%llx\n", lbuf);
 }
 static DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL);
 
@@ -560,7 +560,7 @@ static ssize_t show_dock_type(struct dev
 	else
 		type = "unknown";
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", type);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", type);
 }
 static DEVICE_ATTR(type, S_IRUGO, show_dock_type, NULL);
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-08-10  9:20 drivers/video/fbdev/core/fbcon.c:3509:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-08-10  9:21   ` kernel test robot
@ 2020-08-10  9:21   ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-10  9:21 UTC (permalink / raw)
  To: Denis Efremov
  Cc: kbuild-all, linux-kernel, Julia Lawall,
	Bartlomiej Zolnierkiewicz, Daniel Vetter, Nathan Chancellor,
	Sam Ravnborg, Alex Deucher, Qiujun Huang, Peter Rosin, dri-devel

From: kernel test robot <lkp@intel.com>

drivers/video/fbdev/core/fbcon.c:3509:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/core/fbcon.c:3484: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fc80c51fd4b23ec007e88d4c688f2cac1b8648e7
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 fbcon.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -3481,7 +3481,7 @@ static ssize_t show_rotate(struct device
 	rotate = fbcon_get_rotate(info);
 err:
 	console_unlock();
-	return snprintf(buf, PAGE_SIZE, "%d\n", rotate);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", rotate);
 }
 
 static ssize_t show_cursor_blink(struct device *device,
@@ -3506,7 +3506,7 @@ static ssize_t show_cursor_blink(struct
 	blink = (ops->flags & FBCON_FLAGS_CURSOR_TIMER) ? 1 : 0;
 err:
 	console_unlock();
-	return snprintf(buf, PAGE_SIZE, "%d\n", blink);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", blink);
 }
 
 static ssize_t store_cursor_blink(struct device *device,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
@ 2020-08-10  9:21   ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-10  9:21 UTC (permalink / raw)
  To: Denis Efremov
  Cc: kbuild-all, Bartlomiej Zolnierkiewicz, Daniel Vetter,
	linux-kernel, dri-devel, Julia Lawall, Alex Deucher,
	Nathan Chancellor, Sam Ravnborg, Peter Rosin, Qiujun Huang

From: kernel test robot <lkp@intel.com>

drivers/video/fbdev/core/fbcon.c:3509:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/core/fbcon.c:3484: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fc80c51fd4b23ec007e88d4c688f2cac1b8648e7
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 fbcon.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -3481,7 +3481,7 @@ static ssize_t show_rotate(struct device
 	rotate = fbcon_get_rotate(info);
 err:
 	console_unlock();
-	return snprintf(buf, PAGE_SIZE, "%d\n", rotate);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", rotate);
 }
 
 static ssize_t show_cursor_blink(struct device *device,
@@ -3506,7 +3506,7 @@ static ssize_t show_cursor_blink(struct
 	blink = (ops->flags & FBCON_FLAGS_CURSOR_TIMER) ? 1 : 0;
 err:
 	console_unlock();
-	return snprintf(buf, PAGE_SIZE, "%d\n", blink);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", blink);
 }
 
 static ssize_t store_cursor_blink(struct device *device,
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
@ 2020-08-10  9:21   ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-08-10  9:21 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1759 bytes --]

From: kernel test robot <lkp@intel.com>

drivers/video/fbdev/core/fbcon.c:3509:8-16: WARNING: use scnprintf or sprintf
drivers/video/fbdev/core/fbcon.c:3484: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: abfc19ff202d ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fc80c51fd4b23ec007e88d4c688f2cac1b8648e7
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script

Please take the patch only if it's a positive warning. Thanks!

 fbcon.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -3481,7 +3481,7 @@ static ssize_t show_rotate(struct device
 	rotate = fbcon_get_rotate(info);
 err:
 	console_unlock();
-	return snprintf(buf, PAGE_SIZE, "%d\n", rotate);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", rotate);
 }
 
 static ssize_t show_cursor_blink(struct device *device,
@@ -3506,7 +3506,7 @@ static ssize_t show_cursor_blink(struct
 	blink = (ops->flags & FBCON_FLAGS_CURSOR_TIMER) ? 1 : 0;
 err:
 	console_unlock();
-	return snprintf(buf, PAGE_SIZE, "%d\n", blink);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", blink);
 }
 
 static ssize_t store_cursor_blink(struct device *device,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-27  3:35 [jlawall:for-5.9 1/7] drivers/most/core.c:254:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-07-27  3:35 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-27  3:35 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 8056 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: Christian Gromm <christian.gromm@microchip.com>
CC: Masahiro Yamada <masahiroy@kernel.org>
CC: Peikan Tsai <peikantsai@gmail.com>
CC: Takashi Iwai <tiwai@suse.de>
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/most/core.c:254:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:398:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:409:9-17: WARNING: use scnprintf or sprintf
drivers/most/core.c:211:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:222:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:272:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:297:10-18: WARNING: use scnprintf or sprintf
drivers/most/core.c:326:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:282:9-17: WARNING: use scnprintf or sprintf
drivers/most/core.c:263:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:318:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:309:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:233:8-16: WARNING: use scnprintf or sprintf
drivers/most/core.c:244: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.9
head:   89c775cf9e2b970ac05b0f659597a114da2457de
commit: 988676da837516bbfafda5478472fd4265f0de4e [1/7] coccinelle: api: add device_attr_show script
:::::: branch date: 2 days ago
:::::: commit date: 5 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 core.c |   52 ++++++++++++++++++++++++++--------------------------
 1 file changed, 26 insertions(+), 26 deletions(-)

--- a/drivers/most/core.c
+++ b/drivers/most/core.c
@@ -208,7 +208,7 @@ static ssize_t number_of_packet_buffers_
 	struct most_channel *c = to_channel(dev);
 	unsigned int i = c->channel_id;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n",
+	return scnprintf(buf, PAGE_SIZE, "%d\n",
 			c->iface->channel_vector[i].num_buffers_packet);
 }
 
@@ -219,7 +219,7 @@ static ssize_t number_of_stream_buffers_
 	struct most_channel *c = to_channel(dev);
 	unsigned int i = c->channel_id;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n",
+	return scnprintf(buf, PAGE_SIZE, "%d\n",
 			c->iface->channel_vector[i].num_buffers_streaming);
 }
 
@@ -230,7 +230,7 @@ static ssize_t size_of_packet_buffer_sho
 	struct most_channel *c = to_channel(dev);
 	unsigned int i = c->channel_id;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n",
+	return scnprintf(buf, PAGE_SIZE, "%d\n",
 			c->iface->channel_vector[i].buffer_size_packet);
 }
 
@@ -241,7 +241,7 @@ static ssize_t size_of_stream_buffer_sho
 	struct most_channel *c = to_channel(dev);
 	unsigned int i = c->channel_id;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n",
+	return scnprintf(buf, PAGE_SIZE, "%d\n",
 			c->iface->channel_vector[i].buffer_size_streaming);
 }
 
@@ -251,7 +251,7 @@ static ssize_t channel_starving_show(str
 {
 	struct most_channel *c = to_channel(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", c->is_starving);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", c->is_starving);
 }
 
 static ssize_t set_number_of_buffers_show(struct device *dev,
@@ -260,7 +260,7 @@ static ssize_t set_number_of_buffers_sho
 {
 	struct most_channel *c = to_channel(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", c->cfg.num_buffers);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", c->cfg.num_buffers);
 }
 
 static ssize_t set_buffer_size_show(struct device *dev,
@@ -269,7 +269,7 @@ static ssize_t set_buffer_size_show(stru
 {
 	struct most_channel *c = to_channel(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", c->cfg.buffer_size);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", c->cfg.buffer_size);
 }
 
 static ssize_t set_direction_show(struct device *dev,
@@ -279,10 +279,10 @@ static ssize_t set_direction_show(struct
 	struct most_channel *c = to_channel(dev);
 
 	if (c->cfg.direction & MOST_CH_TX)
-		return snprintf(buf, PAGE_SIZE, "tx\n");
+		return scnprintf(buf, PAGE_SIZE, "tx\n");
 	else if (c->cfg.direction & MOST_CH_RX)
-		return snprintf(buf, PAGE_SIZE, "rx\n");
-	return snprintf(buf, PAGE_SIZE, "unconfigured\n");
+		return scnprintf(buf, PAGE_SIZE, "rx\n");
+	return scnprintf(buf, PAGE_SIZE, "unconfigured\n");
 }
 
 static ssize_t set_datatype_show(struct device *dev,
@@ -294,10 +294,10 @@ static ssize_t set_datatype_show(struct
 
 	for (i = 0; i < ARRAY_SIZE(ch_data_type); i++) {
 		if (c->cfg.data_type & ch_data_type[i].most_ch_data_type)
-			return snprintf(buf, PAGE_SIZE, "%s",
+			return scnprintf(buf, PAGE_SIZE, "%s",
 					ch_data_type[i].name);
 	}
-	return snprintf(buf, PAGE_SIZE, "unconfigured\n");
+	return scnprintf(buf, PAGE_SIZE, "unconfigured\n");
 }
 
 static ssize_t set_subbuffer_size_show(struct device *dev,
@@ -306,7 +306,7 @@ static ssize_t set_subbuffer_size_show(s
 {
 	struct most_channel *c = to_channel(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", c->cfg.subbuffer_size);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", c->cfg.subbuffer_size);
 }
 
 static ssize_t set_packets_per_xact_show(struct device *dev,
@@ -315,7 +315,7 @@ static ssize_t set_packets_per_xact_show
 {
 	struct most_channel *c = to_channel(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", c->cfg.packets_per_xact);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", c->cfg.packets_per_xact);
 }
 
 static ssize_t set_dbr_size_show(struct device *dev,
@@ -323,7 +323,7 @@ static ssize_t set_dbr_size_show(struct
 {
 	struct most_channel *c = to_channel(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", c->cfg.dbr_size);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", c->cfg.dbr_size);
 }
 
 #define to_dev_attr(a) container_of(a, struct device_attribute, attr)
@@ -395,7 +395,7 @@ static ssize_t description_show(struct d
 {
 	struct most_interface *iface = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", iface->description);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", iface->description);
 }
 
 static ssize_t interface_show(struct device *dev,
@@ -406,25 +406,25 @@ static ssize_t interface_show(struct dev
 
 	switch (iface->interface) {
 	case ITYPE_LOOPBACK:
-		return snprintf(buf, PAGE_SIZE, "loopback\n");
+		return scnprintf(buf, PAGE_SIZE, "loopback\n");
 	case ITYPE_I2C:
-		return snprintf(buf, PAGE_SIZE, "i2c\n");
+		return scnprintf(buf, PAGE_SIZE, "i2c\n");
 	case ITYPE_I2S:
-		return snprintf(buf, PAGE_SIZE, "i2s\n");
+		return scnprintf(buf, PAGE_SIZE, "i2s\n");
 	case ITYPE_TSI:
-		return snprintf(buf, PAGE_SIZE, "tsi\n");
+		return scnprintf(buf, PAGE_SIZE, "tsi\n");
 	case ITYPE_HBI:
-		return snprintf(buf, PAGE_SIZE, "hbi\n");
+		return scnprintf(buf, PAGE_SIZE, "hbi\n");
 	case ITYPE_MEDIALB_DIM:
-		return snprintf(buf, PAGE_SIZE, "mlb_dim\n");
+		return scnprintf(buf, PAGE_SIZE, "mlb_dim\n");
 	case ITYPE_MEDIALB_DIM2:
-		return snprintf(buf, PAGE_SIZE, "mlb_dim2\n");
+		return scnprintf(buf, PAGE_SIZE, "mlb_dim2\n");
 	case ITYPE_USB:
-		return snprintf(buf, PAGE_SIZE, "usb\n");
+		return scnprintf(buf, PAGE_SIZE, "usb\n");
 	case ITYPE_PCIE:
-		return snprintf(buf, PAGE_SIZE, "pcie\n");
+		return scnprintf(buf, PAGE_SIZE, "pcie\n");
 	}
-	return snprintf(buf, PAGE_SIZE, "unknown\n");
+	return scnprintf(buf, PAGE_SIZE, "unknown\n");
 }
 
 static DEVICE_ATTR_RO(description);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-26 23:39 [jlawall:for-5.9 1/7] drivers/scsi/ufs/ufshcd.c:1749:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-07-26 23:39 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-26 23:39 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2719 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Alim Akhtar <alim.akhtar@samsung.com>
CC: Avri Altman <avri.altman@wdc.com>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: Stanley Chu <stanley.chu@mediatek.com>
CC: Can Guo <cang@codeaurora.org>
CC: Bean Huo <beanhuo@micron.com>
CC: Bart Van Assche <bvanassche@acm.org>

From: kernel test robot <lkp@intel.com>

drivers/scsi/ufs/ufshcd.c:1749:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/ufs/ufshcd.c:1772:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/ufs/ufshcd.c:1460: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.9
head:   89c775cf9e2b970ac05b0f659597a114da2457de
commit: 988676da837516bbfafda5478472fd4265f0de4e [1/7] coccinelle: api: add device_attr_show script
:::::: branch date: 2 days ago
:::::: commit date: 5 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 ufshcd.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1457,7 +1457,7 @@ static ssize_t ufshcd_clkscale_enable_sh
 {
 	struct ufs_hba *hba = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", hba->clk_scaling.is_allowed);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", hba->clk_scaling.is_allowed);
 }
 
 static ssize_t ufshcd_clkscale_enable_store(struct device *dev,
@@ -1746,7 +1746,7 @@ static ssize_t ufshcd_clkgate_delay_show
 {
 	struct ufs_hba *hba = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%lu\n", hba->clk_gating.delay_ms);
+	return scnprintf(buf, PAGE_SIZE, "%lu\n", hba->clk_gating.delay_ms);
 }
 
 static ssize_t ufshcd_clkgate_delay_store(struct device *dev,
@@ -1769,7 +1769,7 @@ static ssize_t ufshcd_clkgate_enable_sho
 {
 	struct ufs_hba *hba = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", hba->clk_gating.is_enabled);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", hba->clk_gating.is_enabled);
 }
 
 static ssize_t ufshcd_clkgate_enable_store(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-08  2:42 [jlawall:for-5.9 1/3] drivers/char/hw_random/core.c:399:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-07-08  2:42 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
  2020-07-08  2:42 ` kernel test robot
@ 2020-07-08  2:42 ` kernel test robot
  2 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-08  2:42 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2193 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: Jiri Slaby <jslaby@suse.com>
CC: Nicolas Pitre <nico@fluxnic.net>
CC: Sam Ravnborg <sam@ravnborg.org>
CC: Eric Biggers <ebiggers@google.com>
CC: Lukas Wunner <lukas@wunner.de>
CC: Daniel Vetter <daniel.vetter@ffwll.ch>
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/tty/vt/vt.c:3813:8-16: WARNING: use scnprintf or sprintf
drivers/tty/vt/vt.c:3821: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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!

 vt.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -3810,7 +3810,7 @@ static ssize_t show_bind(struct device *
 	bind = con_is_bound(con->con);
 	console_unlock();
 
-	return snprintf(buf, PAGE_SIZE, "%i\n", bind);
+	return scnprintf(buf, PAGE_SIZE, "%i\n", bind);
 }
 
 static ssize_t show_name(struct device *dev, struct device_attribute *attr,
@@ -3818,7 +3818,7 @@ static ssize_t show_name(struct device *
 {
 	struct con_driver *con = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%s %s\n",
+	return scnprintf(buf, PAGE_SIZE, "%s %s\n",
 			(con->flag & CON_DRIVER_FLAG_MODULE) ? "(M)" : "(S)",
 			 con->desc);
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-08  2:42 [jlawall:for-5.9 1/3] drivers/char/hw_random/core.c:399:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-07-08  2:42 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
@ 2020-07-08  2:42 ` kernel test robot
  2020-07-08  2:42 ` kernel test robot
  2 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-08  2:42 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2720 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Alim Akhtar <alim.akhtar@samsung.com>
CC: Avri Altman <avri.altman@wdc.com>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: Stanley Chu <stanley.chu@mediatek.com>
CC: Bean Huo <beanhuo@micron.com>
CC: Can Guo <cang@codeaurora.org>
CC: Bart Van Assche <bvanassche@acm.org>

From: kernel test robot <lkp@intel.com>

drivers/scsi/ufs/ufshcd.c:1749:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/ufs/ufshcd.c:1772:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/ufs/ufshcd.c:1460: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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!

 ufshcd.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1457,7 +1457,7 @@ static ssize_t ufshcd_clkscale_enable_sh
 {
 	struct ufs_hba *hba = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", hba->clk_scaling.is_allowed);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", hba->clk_scaling.is_allowed);
 }
 
 static ssize_t ufshcd_clkscale_enable_store(struct device *dev,
@@ -1746,7 +1746,7 @@ static ssize_t ufshcd_clkgate_delay_show
 {
 	struct ufs_hba *hba = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%lu\n", hba->clk_gating.delay_ms);
+	return scnprintf(buf, PAGE_SIZE, "%lu\n", hba->clk_gating.delay_ms);
 }
 
 static ssize_t ufshcd_clkgate_delay_store(struct device *dev,
@@ -1769,7 +1769,7 @@ static ssize_t ufshcd_clkgate_enable_sho
 {
 	struct ufs_hba *hba = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", hba->clk_gating.is_enabled);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", hba->clk_gating.is_enabled);
 }
 
 static ssize_t ufshcd_clkgate_enable_store(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-08  2:42 [jlawall:for-5.9 1/3] drivers/char/hw_random/core.c:399:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-07-08  2:42 ` kernel test robot
  2020-07-08  2:42 ` kernel test robot
  2020-07-08  2:42 ` kernel test robot
  2 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-08  2:42 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1911 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Matt Mackall <mpm@selenic.com>
CC: Herbert Xu <herbert@gondor.apana.org.au>
CC: Arnd Bergmann <arnd@arndb.de>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: Laurent Vivier <lvivier@redhat.com>
CC: Alexandre Belloni <alexandre.belloni@bootlin.com>
CC: Stephen Boyd <swboyd@chromium.org>
CC: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

From: kernel test robot <lkp@intel.com>

drivers/char/hw_random/core.c:399: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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!

 core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -396,7 +396,7 @@ static ssize_t hwrng_attr_selected_show(
 					struct device_attribute *attr,
 					char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "%d\n", cur_rng_set_by_user);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", cur_rng_set_by_user);
 }
 
 static DEVICE_ATTR(rng_current, S_IRUGO | S_IWUSR,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-07 17:07 [jlawall:for-5.9 1/3] drivers/scsi/pcmcia/sym53c500_cs.c:621:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-07-07 17:07 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-07 17:07 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1703 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-03 11:35 [jlawall:for-5.9 1/3] drivers/tty/serial/8250/8250_port.c:2989:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (10 preceding siblings ...)
  2020-07-03 11:36 ` kernel test robot
@ 2020-07-03 11:36 ` kernel test robot
  11 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-03 11:36 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6658 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: Jiri Slaby <jslaby@suse.com>
CC: linux-serial(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/tty/serial/serial_core.c:2701:8-16: WARNING: use scnprintf or sprintf
drivers/tty/serial/serial_core.c:2711:8-16: WARNING: use scnprintf or sprintf
drivers/tty/serial/serial_core.c:2721:8-16: WARNING: use scnprintf or sprintf
drivers/tty/serial/serial_core.c:2681:8-16: WARNING: use scnprintf or sprintf
drivers/tty/serial/serial_core.c:2731:8-16: WARNING: use scnprintf or sprintf
drivers/tty/serial/serial_core.c:2741:8-16: WARNING: use scnprintf or sprintf
drivers/tty/serial/serial_core.c:2751:8-16: WARNING: use scnprintf or sprintf
drivers/tty/serial/serial_core.c:2671:8-16: WARNING: use scnprintf or sprintf
drivers/tty/serial/serial_core.c:2647:8-16: WARNING: use scnprintf or sprintf
drivers/tty/serial/serial_core.c:2661:8-16: WARNING: use scnprintf or sprintf
drivers/tty/serial/serial_core.c:2637:8-16: WARNING: use scnprintf or sprintf
drivers/tty/serial/serial_core.c:2627:8-16: WARNING: use scnprintf or sprintf
drivers/tty/serial/serial_core.c:2691: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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: 8 days ago
:::::: commit date: 9 days ago

Please take the patch only if it's a positive warning. Thanks!

 serial_core.c |   26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2624,7 +2624,7 @@ static ssize_t uartclk_show(struct devic
 	struct tty_port *port = dev_get_drvdata(dev);
 
 	uart_get_info(port, &tmp);
-	return snprintf(buf, PAGE_SIZE, "%d\n", tmp.baud_base * 16);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", tmp.baud_base * 16);
 }
 
 static ssize_t type_show(struct device *dev,
@@ -2634,7 +2634,7 @@ static ssize_t type_show(struct device *
 	struct tty_port *port = dev_get_drvdata(dev);
 
 	uart_get_info(port, &tmp);
-	return snprintf(buf, PAGE_SIZE, "%d\n", tmp.type);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", tmp.type);
 }
 
 static ssize_t line_show(struct device *dev,
@@ -2644,7 +2644,7 @@ static ssize_t line_show(struct device *
 	struct tty_port *port = dev_get_drvdata(dev);
 
 	uart_get_info(port, &tmp);
-	return snprintf(buf, PAGE_SIZE, "%d\n", tmp.line);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", tmp.line);
 }
 
 static ssize_t port_show(struct device *dev,
@@ -2658,7 +2658,7 @@ static ssize_t port_show(struct device *
 	ioaddr = tmp.port;
 	if (HIGH_BITS_OFFSET)
 		ioaddr |= (unsigned long)tmp.port_high << HIGH_BITS_OFFSET;
-	return snprintf(buf, PAGE_SIZE, "0x%lX\n", ioaddr);
+	return scnprintf(buf, PAGE_SIZE, "0x%lX\n", ioaddr);
 }
 
 static ssize_t irq_show(struct device *dev,
@@ -2668,7 +2668,7 @@ static ssize_t irq_show(struct device *d
 	struct tty_port *port = dev_get_drvdata(dev);
 
 	uart_get_info(port, &tmp);
-	return snprintf(buf, PAGE_SIZE, "%d\n", tmp.irq);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", tmp.irq);
 }
 
 static ssize_t flags_show(struct device *dev,
@@ -2678,7 +2678,7 @@ static ssize_t flags_show(struct device
 	struct tty_port *port = dev_get_drvdata(dev);
 
 	uart_get_info(port, &tmp);
-	return snprintf(buf, PAGE_SIZE, "0x%X\n", tmp.flags);
+	return scnprintf(buf, PAGE_SIZE, "0x%X\n", tmp.flags);
 }
 
 static ssize_t xmit_fifo_size_show(struct device *dev,
@@ -2688,7 +2688,7 @@ static ssize_t xmit_fifo_size_show(struc
 	struct tty_port *port = dev_get_drvdata(dev);
 
 	uart_get_info(port, &tmp);
-	return snprintf(buf, PAGE_SIZE, "%d\n", tmp.xmit_fifo_size);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", tmp.xmit_fifo_size);
 }
 
 static ssize_t close_delay_show(struct device *dev,
@@ -2698,7 +2698,7 @@ static ssize_t close_delay_show(struct d
 	struct tty_port *port = dev_get_drvdata(dev);
 
 	uart_get_info(port, &tmp);
-	return snprintf(buf, PAGE_SIZE, "%d\n", tmp.close_delay);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", tmp.close_delay);
 }
 
 static ssize_t closing_wait_show(struct device *dev,
@@ -2708,7 +2708,7 @@ static ssize_t closing_wait_show(struct
 	struct tty_port *port = dev_get_drvdata(dev);
 
 	uart_get_info(port, &tmp);
-	return snprintf(buf, PAGE_SIZE, "%d\n", tmp.closing_wait);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", tmp.closing_wait);
 }
 
 static ssize_t custom_divisor_show(struct device *dev,
@@ -2718,7 +2718,7 @@ static ssize_t custom_divisor_show(struc
 	struct tty_port *port = dev_get_drvdata(dev);
 
 	uart_get_info(port, &tmp);
-	return snprintf(buf, PAGE_SIZE, "%d\n", tmp.custom_divisor);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", tmp.custom_divisor);
 }
 
 static ssize_t io_type_show(struct device *dev,
@@ -2728,7 +2728,7 @@ static ssize_t io_type_show(struct devic
 	struct tty_port *port = dev_get_drvdata(dev);
 
 	uart_get_info(port, &tmp);
-	return snprintf(buf, PAGE_SIZE, "%d\n", tmp.io_type);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", tmp.io_type);
 }
 
 static ssize_t iomem_base_show(struct device *dev,
@@ -2738,7 +2738,7 @@ static ssize_t iomem_base_show(struct de
 	struct tty_port *port = dev_get_drvdata(dev);
 
 	uart_get_info(port, &tmp);
-	return snprintf(buf, PAGE_SIZE, "0x%lX\n", (unsigned long)tmp.iomem_base);
+	return scnprintf(buf, PAGE_SIZE, "0x%lX\n", (unsigned long)tmp.iomem_base);
 }
 
 static ssize_t iomem_reg_shift_show(struct device *dev,
@@ -2748,7 +2748,7 @@ static ssize_t iomem_reg_shift_show(stru
 	struct tty_port *port = dev_get_drvdata(dev);
 
 	uart_get_info(port, &tmp);
-	return snprintf(buf, PAGE_SIZE, "%d\n", tmp.iomem_reg_shift);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", tmp.iomem_reg_shift);
 }
 
 static ssize_t console_show(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-03 11:35 [jlawall:for-5.9 1/3] drivers/tty/serial/8250/8250_port.c:2989:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (9 preceding siblings ...)
  2020-07-03 11:36 ` kernel test robot
@ 2020-07-03 11:36 ` kernel test robot
  2020-07-03 11:36 ` kernel test robot
  11 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-03 11:36 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5728 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/scsi/scsi_transport_fc.c:1557:9-17: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_transport_fc.c:1481:9-17: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_transport_fc.c:1505:9-17: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_transport_fc.c:1590:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_transport_fc.c:955:9-17: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_transport_fc.c:921:10-18: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_transport_fc.c:826:9-17: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_transport_fc.c:1255:9-17: 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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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: 8 days ago
:::::: commit date: 9 days ago

Please take the patch only if it's a positive warning. Thanks!

 scsi_transport_fc.c |   30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -823,7 +823,7 @@ show_fc_rport_supported_classes (struct
 {
 	struct fc_rport *rport = transport_class_to_rport(dev);
 	if (rport->supported_classes == FC_COS_UNSPECIFIED)
-		return snprintf(buf, 20, "unspecified\n");
+		return scnprintf(buf, 20, "unspecified\n");
 	return get_fc_cos_names(rport->supported_classes, buf);
 }
 static FC_DEVICE_ATTR(rport, supported_classes, S_IRUGO,
@@ -918,21 +918,21 @@ show_fc_rport_roles (struct device *dev,
 					FC_WELLKNOWN_PORTID_MASK) {
 		switch (rport->port_id & FC_WELLKNOWN_ROLE_MASK) {
 		case FC_FPORT_PORTID:
-			return snprintf(buf, 30, "Fabric Port\n");
+			return scnprintf(buf, 30, "Fabric Port\n");
 		case FC_FABCTLR_PORTID:
-			return snprintf(buf, 30, "Fabric Controller\n");
+			return scnprintf(buf, 30, "Fabric Controller\n");
 		case FC_DIRSRVR_PORTID:
-			return snprintf(buf, 30, "Directory Server\n");
+			return scnprintf(buf, 30, "Directory Server\n");
 		case FC_TIMESRVR_PORTID:
-			return snprintf(buf, 30, "Time Server\n");
+			return scnprintf(buf, 30, "Time Server\n");
 		case FC_MGMTSRVR_PORTID:
-			return snprintf(buf, 30, "Management Server\n");
+			return scnprintf(buf, 30, "Management Server\n");
 		default:
-			return snprintf(buf, 30, "Unknown Fabric Entity\n");
+			return scnprintf(buf, 30, "Unknown Fabric Entity\n");
 		}
 	} else {
 		if (rport->roles == FC_PORT_ROLE_UNKNOWN)
-			return snprintf(buf, 20, "unknown\n");
+			return scnprintf(buf, 20, "unknown\n");
 		return get_fc_port_roles_names(rport->roles, buf);
 	}
 }
@@ -952,8 +952,8 @@ show_fc_rport_fast_io_fail_tmo (struct d
 	struct fc_rport *rport = transport_class_to_rport(dev);
 
 	if (rport->fast_io_fail_tmo == -1)
-		return snprintf(buf, 5, "off\n");
-	return snprintf(buf, 20, "%d\n", rport->fast_io_fail_tmo);
+		return scnprintf(buf, 5, "off\n");
+	return scnprintf(buf, 20, "%d\n", rport->fast_io_fail_tmo);
 }
 
 static ssize_t
@@ -1252,7 +1252,7 @@ show_fc_vport_roles (struct device *dev,
 	struct fc_vport *vport = transport_class_to_vport(dev);
 
 	if (vport->roles == FC_PORT_ROLE_UNKNOWN)
-		return snprintf(buf, 20, "unknown\n");
+		return scnprintf(buf, 20, "unknown\n");
 	return get_fc_port_roles_names(vport->roles, buf);
 }
 static FC_DEVICE_ATTR(vport, roles, S_IRUGO, show_fc_vport_roles, NULL);
@@ -1478,7 +1478,7 @@ show_fc_host_supported_classes (struct d
 	struct Scsi_Host *shost = transport_class_to_shost(dev);
 
 	if (fc_host_supported_classes(shost) == FC_COS_UNSPECIFIED)
-		return snprintf(buf, 20, "unspecified\n");
+		return scnprintf(buf, 20, "unspecified\n");
 
 	return get_fc_cos_names(fc_host_supported_classes(shost), buf);
 }
@@ -1502,7 +1502,7 @@ show_fc_host_supported_speeds (struct de
 	struct Scsi_Host *shost = transport_class_to_shost(dev);
 
 	if (fc_host_supported_speeds(shost) == FC_PORTSPEED_UNKNOWN)
-		return snprintf(buf, 20, "unknown\n");
+		return scnprintf(buf, 20, "unknown\n");
 
 	return get_fc_port_speed_names(fc_host_supported_speeds(shost), buf);
 }
@@ -1554,7 +1554,7 @@ show_fc_host_speed (struct device *dev,
 		i->f->get_host_speed(shost);
 
 	if (fc_host_speed(shost) == FC_PORTSPEED_UNKNOWN)
-		return snprintf(buf, 20, "unknown\n");
+		return scnprintf(buf, 20, "unknown\n");
 
 	return get_fc_port_speed_names(fc_host_speed(shost), buf);
 }
@@ -1587,7 +1587,7 @@ show_fc_private_host_tgtid_bind_type(str
 	name = get_fc_tgtid_bind_type_name(fc_host_tgtid_bind_type(shost));
 	if (!name)
 		return -EINVAL;
-	return snprintf(buf, FC_BINDTYPE_MAX_NAMELEN, "%s\n", name);
+	return scnprintf(buf, FC_BINDTYPE_MAX_NAMELEN, "%s\n", name);
 }
 
 #define get_list_head_entry(pos, head, member) 		\

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-03 11:35 [jlawall:for-5.9 1/3] drivers/tty/serial/8250/8250_port.c:2989:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (8 preceding siblings ...)
  2020-07-03 11:36 ` kernel test robot
@ 2020-07-03 11:36 ` kernel test robot
  2020-07-03 11:36 ` kernel test robot
  2020-07-03 11:36 ` kernel test robot
  11 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-03 11:36 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6722 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/scsi/scsi_sysfs.c:671:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_sysfs.c:662:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_sysfs.c:1068:9-17: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_sysfs.c:704:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_sysfs.c:935:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_sysfs.c:1158:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_sysfs.c:683:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_sysfs.c:385:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_sysfs.c:910:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_sysfs.c:833:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_sysfs.c:276:9-17: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_sysfs.c:326:9-17: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_sysfs.c:230:8-16: WARNING: use scnprintf or sprintf
drivers/scsi/scsi_sysfs.c:818: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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: 8 days ago
:::::: commit date: 9 days ago

Please take the patch only if it's a positive warning. Thanks!

 scsi_sysfs.c |   30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -227,7 +227,7 @@ show_shost_state(struct device *dev, str
 	if (!name)
 		return -EINVAL;
 
-	return snprintf(buf, 20, "%s\n", name);
+	return scnprintf(buf, 20, "%s\n", name);
 }
 
 /* DEVICE_ATTR(state) clashes with dev_attr_state for sdev */
@@ -273,7 +273,7 @@ show_shost_active_mode(struct device *de
 	struct Scsi_Host *shost = class_to_shost(dev);
 
 	if (shost->active_mode == MODE_UNKNOWN)
-		return snprintf(buf, 20, "unknown\n");
+		return scnprintf(buf, 20, "unknown\n");
 	else
 		return show_shost_mode(shost->active_mode, buf);
 }
@@ -323,7 +323,7 @@ show_shost_eh_deadline(struct device *de
 	struct Scsi_Host *shost = class_to_shost(dev);
 
 	if (shost->eh_deadline == -1)
-		return snprintf(buf, strlen("off") + 2, "off\n");
+		return scnprintf(buf, strlen("off") + 2, "off\n");
 	return sprintf(buf, "%u\n", shost->eh_deadline / HZ);
 }
 
@@ -382,7 +382,7 @@ static ssize_t
 show_host_busy(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	struct Scsi_Host *shost = class_to_shost(dev);
-	return snprintf(buf, 20, "%d\n", scsi_host_busy(shost));
+	return scnprintf(buf, 20, "%d\n", scsi_host_busy(shost));
 }
 static DEVICE_ATTR(host_busy, S_IRUGO, show_host_busy, NULL);
 
@@ -659,7 +659,7 @@ sdev_show_device_busy(struct device *dev
 		char *buf)
 {
 	struct scsi_device *sdev = to_scsi_device(dev);
-	return snprintf(buf, 20, "%d\n", atomic_read(&sdev->device_busy));
+	return scnprintf(buf, 20, "%d\n", atomic_read(&sdev->device_busy));
 }
 static DEVICE_ATTR(device_busy, S_IRUGO, sdev_show_device_busy, NULL);
 
@@ -668,7 +668,7 @@ sdev_show_device_blocked(struct device *
 		char *buf)
 {
 	struct scsi_device *sdev = to_scsi_device(dev);
-	return snprintf(buf, 20, "%d\n", atomic_read(&sdev->device_blocked));
+	return scnprintf(buf, 20, "%d\n", atomic_read(&sdev->device_blocked));
 }
 static DEVICE_ATTR(device_blocked, S_IRUGO, sdev_show_device_blocked, NULL);
 
@@ -680,7 +680,7 @@ sdev_show_timeout (struct device *dev, s
 {
 	struct scsi_device *sdev;
 	sdev = to_scsi_device(dev);
-	return snprintf(buf, 20, "%d\n", sdev->request_queue->rq_timeout / HZ);
+	return scnprintf(buf, 20, "%d\n", sdev->request_queue->rq_timeout / HZ);
 }
 
 static ssize_t
@@ -701,7 +701,7 @@ sdev_show_eh_timeout(struct device *dev,
 {
 	struct scsi_device *sdev;
 	sdev = to_scsi_device(dev);
-	return snprintf(buf, 20, "%u\n", sdev->eh_timeout / HZ);
+	return scnprintf(buf, 20, "%u\n", sdev->eh_timeout / HZ);
 }
 
 static ssize_t
@@ -815,7 +815,7 @@ show_state_field(struct device *dev, str
 	if (!name)
 		return -EINVAL;
 
-	return snprintf(buf, 20, "%s\n", name);
+	return scnprintf(buf, 20, "%s\n", name);
 }
 
 static DEVICE_ATTR(state, S_IRUGO | S_IWUSR, show_state_field, store_state_field);
@@ -830,7 +830,7 @@ show_queue_type_field(struct device *dev
 	if (sdev->simple_tags)
 		name = "simple";
 
-	return snprintf(buf, 20, "%s\n", name);
+	return scnprintf(buf, 20, "%s\n", name);
 }
 
 static ssize_t
@@ -907,7 +907,7 @@ static ssize_t
 show_iostat_counterbits(struct device *dev, struct device_attribute *attr,
 			char *buf)
 {
-	return snprintf(buf, 20, "%d\n", (int)sizeof(atomic_t) * 8);
+	return scnprintf(buf, 20, "%d\n", (int)sizeof(atomic_t) * 8);
 }
 
 static DEVICE_ATTR(iocounterbits, S_IRUGO, show_iostat_counterbits, NULL);
@@ -932,7 +932,7 @@ sdev_show_modalias(struct device *dev, s
 {
 	struct scsi_device *sdev;
 	sdev = to_scsi_device(dev);
-	return snprintf (buf, 20, SCSI_DEVICE_MODALIAS_FMT "\n", sdev->type);
+	return scnprintf (buf, 20, SCSI_DEVICE_MODALIAS_FMT "\n", sdev->type);
 }
 static DEVICE_ATTR(modalias, S_IRUGO, sdev_show_modalias, NULL);
 
@@ -1065,9 +1065,9 @@ sdev_show_dh_state(struct device *dev, s
 	struct scsi_device *sdev = to_scsi_device(dev);
 
 	if (!sdev->handler)
-		return snprintf(buf, 20, "detached\n");
+		return scnprintf(buf, 20, "detached\n");
 
-	return snprintf(buf, 20, "%s\n", sdev->handler->name);
+	return scnprintf(buf, 20, "%s\n", sdev->handler->name);
 }
 
 static ssize_t
@@ -1155,7 +1155,7 @@ sdev_show_queue_ramp_up_period(struct de
 {
 	struct scsi_device *sdev;
 	sdev = to_scsi_device(dev);
-	return snprintf(buf, 20, "%u\n",
+	return scnprintf(buf, 20, "%u\n",
 			jiffies_to_msecs(sdev->queue_ramp_up_period));
 }
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-03 11:35 [jlawall:for-5.9 1/3] drivers/tty/serial/8250/8250_port.c:2989:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (7 preceding siblings ...)
  2020-07-03 11:35 ` kernel test robot
@ 2020-07-03 11:36 ` kernel test robot
  2020-07-03 11:36 ` kernel test robot
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-03 11:36 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2129 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Jens Axboe <axboe@kernel.dk>
CC: linux-ide(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/ata/libata-sata.c:954:8-16: WARNING: use scnprintf or sprintf
drivers/ata/libata-sata.c:830: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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: 8 days ago
:::::: commit date: 9 days ago

Please take the patch only if it's a positive warning. Thanks!

 libata-sata.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/ata/libata-sata.c
+++ b/drivers/ata/libata-sata.c
@@ -827,7 +827,7 @@ static ssize_t ata_scsi_lpm_show(struct
 	if (ap->target_lpm_policy >= ARRAY_SIZE(ata_lpm_policy_names))
 		return -EINVAL;
 
-	return snprintf(buf, PAGE_SIZE, "%s\n",
+	return scnprintf(buf, PAGE_SIZE, "%s\n",
 			ata_lpm_policy_names[ap->target_lpm_policy]);
 }
 DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR,
@@ -951,7 +951,7 @@ ata_scsi_em_message_type_show(struct dev
 	struct Scsi_Host *shost = class_to_shost(dev);
 	struct ata_port *ap = ata_shost_to_port(shost);
 
-	return snprintf(buf, 23, "%d\n", ap->em_message_type);
+	return scnprintf(buf, 23, "%d\n", ap->em_message_type);
 }
 DEVICE_ATTR(em_message_type, S_IRUGO,
 		  ata_scsi_em_message_type_show, NULL);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-03 11:35 [jlawall:for-5.9 1/3] drivers/tty/serial/8250/8250_port.c:2989:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (6 preceding siblings ...)
  2020-07-03 11:35 ` kernel test robot
@ 2020-07-03 11:35 ` kernel test robot
  2020-07-03 11:36 ` kernel test robot
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-03 11:35 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5006 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Corey Minyard <minyard@acm.org>
CC: Arnd Bergmann <arnd@arndb.de>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: openipmi-developer(a)lists.sourceforge.net
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/char/ipmi/ipmi_msghandler.c:2694:8-16: WARNING: use scnprintf or sprintf
drivers/char/ipmi/ipmi_msghandler.c:2743:8-16: WARNING: use scnprintf or sprintf
drivers/char/ipmi/ipmi_msghandler.c:2612:8-16: WARNING: use scnprintf or sprintf
drivers/char/ipmi/ipmi_msghandler.c:2659:8-16: WARNING: use scnprintf or sprintf
drivers/char/ipmi/ipmi_msghandler.c:2765:8-16: WARNING: use scnprintf or sprintf
drivers/char/ipmi/ipmi_msghandler.c:2676:8-16: WARNING: use scnprintf or sprintf
drivers/char/ipmi/ipmi_msghandler.c:2711:8-16: WARNING: use scnprintf or sprintf
drivers/char/ipmi/ipmi_msghandler.c:2727:8-16: WARNING: use scnprintf or sprintf
drivers/char/ipmi/ipmi_msghandler.c:2628:8-16: WARNING: use scnprintf or sprintf
drivers/char/ipmi/ipmi_msghandler.c:2643: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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: 8 days ago
:::::: commit date: 9 days ago

Please take the patch only if it's a positive warning. Thanks!

 ipmi_msghandler.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -2609,7 +2609,7 @@ static ssize_t device_id_show(struct dev
 	if (rv)
 		return rv;
 
-	return snprintf(buf, 10, "%u\n", id.device_id);
+	return scnprintf(buf, 10, "%u\n", id.device_id);
 }
 static DEVICE_ATTR_RO(device_id);
 
@@ -2625,7 +2625,7 @@ static ssize_t provides_device_sdrs_show
 	if (rv)
 		return rv;
 
-	return snprintf(buf, 10, "%u\n", (id.device_revision & 0x80) >> 7);
+	return scnprintf(buf, 10, "%u\n", (id.device_revision & 0x80) >> 7);
 }
 static DEVICE_ATTR_RO(provides_device_sdrs);
 
@@ -2640,7 +2640,7 @@ static ssize_t revision_show(struct devi
 	if (rv)
 		return rv;
 
-	return snprintf(buf, 20, "%u\n", id.device_revision & 0x0F);
+	return scnprintf(buf, 20, "%u\n", id.device_revision & 0x0F);
 }
 static DEVICE_ATTR_RO(revision);
 
@@ -2656,7 +2656,7 @@ static ssize_t firmware_revision_show(st
 	if (rv)
 		return rv;
 
-	return snprintf(buf, 20, "%u.%x\n", id.firmware_revision_1,
+	return scnprintf(buf, 20, "%u.%x\n", id.firmware_revision_1,
 			id.firmware_revision_2);
 }
 static DEVICE_ATTR_RO(firmware_revision);
@@ -2673,7 +2673,7 @@ static ssize_t ipmi_version_show(struct
 	if (rv)
 		return rv;
 
-	return snprintf(buf, 20, "%u.%u\n",
+	return scnprintf(buf, 20, "%u.%u\n",
 			ipmi_version_major(&id),
 			ipmi_version_minor(&id));
 }
@@ -2691,7 +2691,7 @@ static ssize_t add_dev_support_show(stru
 	if (rv)
 		return rv;
 
-	return snprintf(buf, 10, "0x%02x\n", id.additional_device_support);
+	return scnprintf(buf, 10, "0x%02x\n", id.additional_device_support);
 }
 static DEVICE_ATTR(additional_device_support, S_IRUGO, add_dev_support_show,
 		   NULL);
@@ -2708,7 +2708,7 @@ static ssize_t manufacturer_id_show(stru
 	if (rv)
 		return rv;
 
-	return snprintf(buf, 20, "0x%6.6x\n", id.manufacturer_id);
+	return scnprintf(buf, 20, "0x%6.6x\n", id.manufacturer_id);
 }
 static DEVICE_ATTR_RO(manufacturer_id);
 
@@ -2724,7 +2724,7 @@ static ssize_t product_id_show(struct de
 	if (rv)
 		return rv;
 
-	return snprintf(buf, 10, "0x%4.4x\n", id.product_id);
+	return scnprintf(buf, 10, "0x%4.4x\n", id.product_id);
 }
 static DEVICE_ATTR_RO(product_id);
 
@@ -2740,7 +2740,7 @@ static ssize_t aux_firmware_rev_show(str
 	if (rv)
 		return rv;
 
-	return snprintf(buf, 21, "0x%02x 0x%02x 0x%02x 0x%02x\n",
+	return scnprintf(buf, 21, "0x%02x 0x%02x 0x%02x 0x%02x\n",
 			id.aux_firmware_revision[3],
 			id.aux_firmware_revision[2],
 			id.aux_firmware_revision[1],
@@ -2762,7 +2762,7 @@ static ssize_t guid_show(struct device *
 	if (!guid_set)
 		return -ENOENT;
 
-	return snprintf(buf, UUID_STRING_LEN + 1 + 1, "%pUl\n", &guid);
+	return scnprintf(buf, UUID_STRING_LEN + 1 + 1, "%pUl\n", &guid);
 }
 static DEVICE_ATTR_RO(guid);
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-03 11:35 [jlawall:for-5.9 1/3] drivers/tty/serial/8250/8250_port.c:2989:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (5 preceding siblings ...)
  2020-07-03 11:35 ` kernel test robot
@ 2020-07-03 11:35 ` kernel test robot
  2020-07-03 11:35 ` kernel test robot
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-03 11:35 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1673 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Stefan Richter <stefanr@s5r6.in-berlin.de>
CC: linux1394-devel(a)lists.sourceforge.net
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/firewire/core-device.c:375: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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: 8 days ago
:::::: commit date: 9 days ago

Please take the patch only if it's a positive warning. Thanks!

 core-device.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/firewire/core-device.c
+++ b/drivers/firewire/core-device.c
@@ -372,7 +372,7 @@ static ssize_t rom_index_show(struct dev
 	struct fw_device *device = fw_device(dev->parent);
 	struct fw_unit *unit = fw_unit(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n",
+	return scnprintf(buf, PAGE_SIZE, "%d\n",
 			(int)(unit->directory - device->config_rom));
 }
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-03 11:35 [jlawall:for-5.9 1/3] drivers/tty/serial/8250/8250_port.c:2989:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (4 preceding siblings ...)
  2020-07-03 11:35 ` kernel test robot
@ 2020-07-03 11:35 ` kernel test robot
  2020-07-03 11:35 ` kernel test robot
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-03 11:35 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3407 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Keith Busch <kbusch@kernel.org>
CC: Jens Axboe <axboe@kernel.dk>
CC: Christoph Hellwig <hch@lst.de>
CC: Sagi Grimberg <sagi@grimberg.me>
CC: linux-nvme(a)lists.infradead.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/nvme/host/core.c:2671:8-16: WARNING: use scnprintf or sprintf
drivers/nvme/host/core.c:3388:8-16: WARNING: use scnprintf or sprintf
drivers/nvme/host/core.c:3378:8-16: WARNING: use scnprintf or sprintf
drivers/nvme/host/core.c:3368:8-16: WARNING: use scnprintf or sprintf
drivers/nvme/host/core.c:3335: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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: 8 days ago
:::::: commit date: 9 days ago

Please take the patch only if it's a positive warning. Thanks!

 core.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2668,7 +2668,7 @@ static ssize_t nvme_subsys_show_nqn(stru
 	struct nvme_subsystem *subsys =
 		container_of(dev, struct nvme_subsystem, dev);
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", subsys->subnqn);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", subsys->subnqn);
 }
 static SUBSYS_ATTR_RO(subsysnqn, S_IRUGO, nvme_subsys_show_nqn);
 
@@ -3332,7 +3332,7 @@ static ssize_t nvme_sysfs_show_transport
 {
 	struct nvme_ctrl *ctrl = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", ctrl->ops->name);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", ctrl->ops->name);
 }
 static DEVICE_ATTR(transport, S_IRUGO, nvme_sysfs_show_transport, NULL);
 
@@ -3365,7 +3365,7 @@ static ssize_t nvme_sysfs_show_subsysnqn
 {
 	struct nvme_ctrl *ctrl = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", ctrl->subsys->subnqn);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", ctrl->subsys->subnqn);
 }
 static DEVICE_ATTR(subsysnqn, S_IRUGO, nvme_sysfs_show_subsysnqn, NULL);
 
@@ -3375,7 +3375,7 @@ static ssize_t nvme_sysfs_show_hostnqn(s
 {
 	struct nvme_ctrl *ctrl = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", ctrl->opts->host->nqn);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", ctrl->opts->host->nqn);
 }
 static DEVICE_ATTR(hostnqn, S_IRUGO, nvme_sysfs_show_hostnqn, NULL);
 
@@ -3385,7 +3385,7 @@ static ssize_t nvme_sysfs_show_hostid(st
 {
 	struct nvme_ctrl *ctrl = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%pU\n", &ctrl->opts->host->id);
+	return scnprintf(buf, PAGE_SIZE, "%pU\n", &ctrl->opts->host->id);
 }
 static DEVICE_ATTR(hostid, S_IRUGO, nvme_sysfs_show_hostid, NULL);
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-03 11:35 [jlawall:for-5.9 1/3] drivers/tty/serial/8250/8250_port.c:2989:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (3 preceding siblings ...)
  2020-07-03 11:35 ` kernel test robot
@ 2020-07-03 11:35 ` kernel test robot
  2020-07-03 11:35 ` kernel test robot
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-03 11:35 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1656 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

mm/backing-dev.c:209: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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: 8 days ago
:::::: commit date: 9 days ago

Please take the patch only if it's a positive warning. Thanks!

 backing-dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -206,7 +206,7 @@ static ssize_t stable_pages_required_sho
 {
 	struct backing_dev_info *bdi = dev_get_drvdata(dev);
 
-	return snprintf(page, PAGE_SIZE-1, "%d\n",
+	return scnprintf(page, PAGE_SIZE-1, "%d\n",
 			bdi_cap_stable_pages_required(bdi) ? 1 : 0);
 }
 static DEVICE_ATTR_RO(stable_pages_required);

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-03 11:35 [jlawall:for-5.9 1/3] drivers/tty/serial/8250/8250_port.c:2989:8-16: WARNING: use scnprintf or sprintf kernel test robot
                   ` (2 preceding siblings ...)
  2020-07-03 11:35 ` kernel test robot
@ 2020-07-03 11:35 ` kernel test robot
  2020-07-03 11:35 ` kernel test robot
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-03 11:35 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2079 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: "Christian König" <christian.koenig@amd.com>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: Hawking Zhang <Hawking.Zhang@amd.com>
CC: Tao Zhou <tao.zhou1@amd.com>
CC: Guchun Chen <guchun.chen@amd.com>
CC: Dennis Li <Dennis.Li@amd.com>

From: kernel test robot <lkp@intel.com>

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:419:9-17: 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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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: 8 days ago
:::::: commit date: 9 days ago

Please take the patch only if it's a positive warning. Thanks!

 amdgpu_ras.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -416,13 +416,13 @@ static ssize_t amdgpu_ras_sysfs_read(str
 	};
 
 	if (!amdgpu_ras_get_error_query_ready(obj->adev))
-		return snprintf(buf, PAGE_SIZE,
+		return scnprintf(buf, PAGE_SIZE,
 				"Query currently inaccessible\n");
 
 	if (amdgpu_ras_error_query(obj->adev, &info))
 		return -EINVAL;
 
-	return snprintf(buf, PAGE_SIZE, "%s: %lu\n%s: %lu\n",
+	return scnprintf(buf, PAGE_SIZE, "%s: %lu\n%s: %lu\n",
 			"ue", info.ue_count,
 			"ce", info.ce_count);
 }

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-03 11:35 [jlawall:for-5.9 1/3] drivers/tty/serial/8250/8250_port.c:2989:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-07-03 11:35 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
  2020-07-03 11:35 ` kernel test robot
@ 2020-07-03 11:35 ` kernel test robot
  2020-07-03 11:35 ` kernel test robot
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-03 11:35 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1864 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: "Christian König" <christian.koenig@amd.com>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: Hawking Zhang <Hawking.Zhang@amd.com>
CC: John Clements <john.clements@amd.com>
CC: Xiaojie Yuan <xiaojie.yuan@amd.com>
CC: Evan Quan <evan.quan@amd.com>

From: kernel test robot <lkp@intel.com>

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:2154: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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: 8 days ago
:::::: commit date: 9 days ago

Please take the patch only if it's a positive warning. Thanks!

 amdgpu_psp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -2151,7 +2151,7 @@ static ssize_t psp_usbc_pd_fw_sysfs_read
 		return ret;
 	}
 
-	return snprintf(buf, PAGE_SIZE, "%x\n", fw_ver);
+	return scnprintf(buf, PAGE_SIZE, "%x\n", fw_ver);
 }
 
 static ssize_t psp_usbc_pd_fw_sysfs_write(struct device *dev,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-03 11:35 [jlawall:for-5.9 1/3] drivers/tty/serial/8250/8250_port.c:2989:8-16: WARNING: use scnprintf or sprintf kernel test robot
  2020-07-03 11:35 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
@ 2020-07-03 11:35 ` kernel test robot
  2020-07-03 11:35 ` kernel test robot
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-03 11:35 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3253 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: "Christian König" <christian.koenig@amd.com>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: Evan Quan <evan.quan@amd.com>
CC: Hawking Zhang <Hawking.Zhang@amd.com>
CC: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
CC: Monk Liu <Monk.Liu@amd.com>

From: kernel test robot <lkp@intel.com>

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:134:8-16: WARNING: use scnprintf or sprintf
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:158:8-16: WARNING: use scnprintf or sprintf
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:180:8-16: WARNING: use scnprintf or sprintf
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:202: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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: 8 days ago
:::::: commit date: 9 days ago

Please take the patch only if it's a positive warning. Thanks!

 amdgpu_device.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -131,7 +131,7 @@ static ssize_t amdgpu_device_get_pcie_re
 	struct amdgpu_device *adev = ddev->dev_private;
 	uint64_t cnt = amdgpu_asic_get_pcie_replay_count(adev);
 
-	return snprintf(buf, PAGE_SIZE, "%llu\n", cnt);
+	return scnprintf(buf, PAGE_SIZE, "%llu\n", cnt);
 }
 
 static DEVICE_ATTR(pcie_replay_count, S_IRUGO,
@@ -155,7 +155,7 @@ static ssize_t amdgpu_device_get_product
 	struct drm_device *ddev = dev_get_drvdata(dev);
 	struct amdgpu_device *adev = ddev->dev_private;
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", adev->product_name);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", adev->product_name);
 }
 
 static DEVICE_ATTR(product_name, S_IRUGO,
@@ -177,7 +177,7 @@ static ssize_t amdgpu_device_get_product
 	struct drm_device *ddev = dev_get_drvdata(dev);
 	struct amdgpu_device *adev = ddev->dev_private;
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", adev->product_number);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", adev->product_number);
 }
 
 static DEVICE_ATTR(product_number, S_IRUGO,
@@ -199,7 +199,7 @@ static ssize_t amdgpu_device_get_serial_
 	struct drm_device *ddev = dev_get_drvdata(dev);
 	struct amdgpu_device *adev = ddev->dev_private;
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", adev->serial);
+	return scnprintf(buf, PAGE_SIZE, "%s\n", adev->serial);
 }
 
 static DEVICE_ATTR(serial_number, S_IRUGO,

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-07-03 11:35 [jlawall:for-5.9 1/3] drivers/tty/serial/8250/8250_port.c:2989:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-07-03 11:35 ` kernel test robot
  2020-07-03 11:35 ` kernel test robot
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-07-03 11:35 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1903 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: Jiri Slaby <jslaby@suse.com>
CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
CC: Lukas Wunner <lukas@wunner.de>
CC: Vignesh Raghavendra <vigneshr@ti.com>
CC: Aaron Sierra <asierra@xes-inc.com>
CC: linux-serial(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/tty/serial/8250/8250_port.c:2989: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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: 8 days ago
:::::: commit date: 9 days ago

Please take the patch only if it's a positive warning. Thanks!

 8250_port.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -2986,7 +2986,7 @@ static ssize_t rx_trig_bytes_show(struct
 	if (rxtrig_bytes < 0)
 		return rxtrig_bytes;
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", rxtrig_bytes);
+	return scnprintf(buf, PAGE_SIZE, "%d\n", rxtrig_bytes);
 }
 
 static int do_set_rxtrig(struct tty_port *port, unsigned char bytes)

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-06-25  4:50 [jlawall:for-5.9 1/3] drivers/base/core.c:1526:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-06-25  4:50 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-06-25  4:50 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2406 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: "Rafael J. Wysocki" <rafael@kernel.org>
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/base/core.c:1526:8-16: WARNING: use scnprintf or sprintf
drivers/base/core.c:1505:8-16: WARNING: use scnprintf or sprintf
drivers/base/core.c:1475: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.9
head:   9bba51dafe9fe6bdaa0ef557ea322e981e85bf4c
commit: 988676da837516bbfafda5478472fd4265f0de4e [1/3] coccinelle: api: add device_attr_show script
:::::: branch date: 9 hours ago
:::::: commit date: 9 hours ago

Please take the patch only if it's a positive warning. Thanks!

 core.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1472,7 +1472,7 @@ ssize_t device_show_ulong(struct device
 			  char *buf)
 {
 	struct dev_ext_attribute *ea = to_ext_attr(attr);
-	return snprintf(buf, PAGE_SIZE, "%lx\n", *(unsigned long *)(ea->var));
+	return scnprintf(buf, PAGE_SIZE, "%lx\n", *(unsigned long *)(ea->var));
 }
 EXPORT_SYMBOL_GPL(device_show_ulong);
 
@@ -1502,7 +1502,7 @@ ssize_t device_show_int(struct device *d
 {
 	struct dev_ext_attribute *ea = to_ext_attr(attr);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", *(int *)(ea->var));
+	return scnprintf(buf, PAGE_SIZE, "%d\n", *(int *)(ea->var));
 }
 EXPORT_SYMBOL_GPL(device_show_int);
 
@@ -1523,7 +1523,7 @@ ssize_t device_show_bool(struct device *
 {
 	struct dev_ext_attribute *ea = to_ext_attr(attr);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", *(bool *)(ea->var));
+	return scnprintf(buf, PAGE_SIZE, "%d\n", *(bool *)(ea->var));
 }
 EXPORT_SYMBOL_GPL(device_show_bool);
 

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

* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
  2020-06-25  3:41 [jlawall:for-5.9 1/3] arch/x86/events/core.c:2219:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-06-25  3:41 ` kernel test robot
  0 siblings, 0 replies; 99+ messages in thread
From: kernel test robot @ 2020-06-25  3:41 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2243 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Ingo Molnar <mingo@redhat.com>
CC: Arnaldo Carvalho de Melo <acme@kernel.org>
CC: Mark Rutland <mark.rutland@arm.com>
CC: Alexander Shishkin <alexander.shishkin@linux.intel.com>
CC: Jiri Olsa <jolsa@redhat.com>
CC: Namhyung Kim <namhyung@kernel.org>
CC: Thomas Gleixner <tglx@linutronix.de>

From: kernel test robot <lkp@intel.com>

arch/x86/events/core.c:2219:8-16: WARNING: use scnprintf or sprintf
arch/x86/events/core.c:2277: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 <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.9
head:   9bba51dafe9fe6bdaa0ef557ea322e981e85bf4c
commit: 988676da837516bbfafda5478472fd4265f0de4e [1/3] coccinelle: api: add device_attr_show script
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago

Please take the patch only if it's a positive warning. Thanks!

 core.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/x86/events/core.c
+++ b/arch/x86/events/core.c
@@ -2216,7 +2216,7 @@ static ssize_t get_attr_rdpmc(struct dev
 			      struct device_attribute *attr,
 			      char *buf)
 {
-	return snprintf(buf, 40, "%d\n", x86_pmu.attr_rdpmc);
+	return scnprintf(buf, 40, "%d\n", x86_pmu.attr_rdpmc);
 }
 
 static ssize_t set_attr_rdpmc(struct device *cdev,
@@ -2274,7 +2274,7 @@ static ssize_t max_precise_show(struct d
 				  struct device_attribute *attr,
 				  char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "%d\n", x86_pmu_max_precise());
+	return scnprintf(buf, PAGE_SIZE, "%d\n", x86_pmu_max_precise());
 }
 
 static DEVICE_ATTR_RO(max_precise);

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

end of thread, other threads:[~2020-12-30  1:19 UTC | newest]

Thread overview: 99+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-29  4:59 drivers/acpi/bgrt.c:28:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-12-29  4:59 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
     [not found] <86ae66c7-927b-d41b-f097-b46f28943f58@linux.com>
2020-12-30  1:19 ` Rong Chen
  -- strict thread matches above, loose matches on Subject: below --
2020-12-29  7:35 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:1950:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-12-29  7:35 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-12-27 20:04 drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-12-27 20:04 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-12-27 20:04 ` kernel test robot
2020-12-27 20:04 ` kernel test robot
2020-12-27 20:04 ` kernel test robot
2020-12-27 20:05 ` kernel test robot
2020-12-27 20:05 ` kernel test robot
2020-12-27 20:05 ` kernel test robot
2020-12-27 20:05 ` kernel test robot
2020-12-27 20:05 ` kernel test robot
2020-12-14 17:27 drivers/hid/hid-sensor-custom.c:371:10-18: WARNING: use scnprintf or sprintf kernel test robot
2020-12-14 17:27 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-12-14 15:10 mm/backing-dev.c:209:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-12-14 15:10 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-12-14 15:10 ` kernel test robot
2020-12-14 15:10 ` kernel test robot
2020-12-14 15:10 ` kernel test robot
2020-12-14 15:10 ` kernel test robot
2020-12-14 15:10 ` kernel test robot
2020-12-10 21:20 drivers/hid/wacom_sys.c:1796:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-12-10 21:20 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-12-07  6:03 drivers/net/can/janz-ican3.c:1834:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-12-07  6:03 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-12-02 13:02 drivers/iio/trigger/iio-trig-hrtimer.c:41:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-12-02 13:02 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-12-01  1:10 drivers/scsi/fcoe/fcoe_sysfs.c:376:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-12-01  1:10 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-11-30 21:50 drivers/perf/fsl_imx8_ddr_perf.c:119:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-11-30 21:50 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-11-24 20:47 drivers/iio/trigger/stm32-timer-trigger.c:299:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-11-24 20:47 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-11-22 19:07 drivers/hwmon/pmbus/inspur-ipsps.c:94:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-11-22 19:07 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-11-22 10:27 drivers/char/ipmi/ipmi_msghandler.c:2694:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-11-22 10:27 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-11-20 11:52 drivers/crypto/picoxcell_crypto.c:1200:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-11-20 11:52 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-11-19  7:24 drivers/hwmon/occ/common.c:554:9-17: WARNING: use scnprintf or sprintf kernel test robot
2020-11-19  7:24 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-11-17 17:21 drivers/net/can/at91_can.c:1185:9-17: WARNING: use scnprintf or sprintf kernel test robot
2020-11-17 17:21 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-11-13 17:02 drivers/platform/x86/panasonic-laptop.c:371:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-11-13 17:02 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-11-12  1:20 drivers/net/can/janz-ican3.c:1834:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-11-12  1:20 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-11-05  1:14 drivers/platform/x86/sony-laptop.c:2054:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-11-05  1:14 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-10-06  7:21 drivers/platform/x86/lg-laptop.c:496:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-10-06  7:21 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-10-06  7:21 ` kernel test robot
2020-10-01  4:11 drivers/block/aoe/aoeblk.c:102:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-10-01  4:11 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-09-29 20:34 drivers/usb/usbip/stub_dev.c:33:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-09-29 20:34 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-09-15  7:28 drivers/video/fbdev/sstfb.c:736:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-09-15  7:28 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-09-15  7:28 ` kernel test robot
2020-09-12 22:57 drivers/scsi/isci/init.c:140:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-09-12 22:57 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-09-12 10:01 drivers/scsi/csiostor/csio_scsi.c:1433:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-09-12 10:01 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-09-10  8:53 drivers/scsi/53c700.c:2063:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-09-10  8:53 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-09-10  8:53 ` kernel test robot
2020-09-10  8:53 ` kernel test robot
2020-09-10  8:53 ` kernel test robot
2020-09-10  8:53 ` kernel test robot
2020-09-10  8:53 ` kernel test robot
2020-09-10  8:53 ` kernel test robot
2020-09-09 15:04 arch/x86/events/intel/pt.c:95:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-09-09 15:04 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-09-02 12:37 drivers/edac/edac_mc_sysfs.c:210:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-09-02 12:37 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-09-02 12:37 ` kernel test robot
2020-09-02 12:37 ` kernel test robot
2020-09-01  8:46 drivers/scsi/pmcraid.c:4091:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-09-01  8:46 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-08-26 19:38 drivers/scsi/aacraid/linit.c:1355:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-08-26 19:38 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-08-18 22:52 drivers/video/fbdev/sstfb.c:736:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-08-18 22:52 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-08-13  0:56 drivers/acpi/dock.c:563:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-08-13  0:56 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-08-13  0:56   ` kernel test robot
2020-08-13  0:56 ` kernel test robot
2020-08-13  0:56   ` kernel test robot
2020-08-13  0:56 ` kernel test robot
2020-08-13  0:56   ` kernel test robot
2020-08-13  0:56 ` kernel test robot
2020-08-13  0:56   ` kernel test robot
2020-08-13  0:56 ` kernel test robot
2020-08-13  0:56   ` kernel test robot
2020-08-13  0:56 ` kernel test robot
2020-08-13  0:56   ` kernel test robot
2020-08-13  0:56 ` kernel test robot
2020-08-13  0:56   ` kernel test robot
2020-08-13  0:56 ` kernel test robot
2020-08-13  0:56   ` kernel test robot
2020-08-10  9:20 drivers/video/fbdev/core/fbcon.c:3509:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-08-10  9:21 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-08-10  9:21   ` kernel test robot
2020-08-10  9:21   ` kernel test robot
2020-09-08 11:37   ` Bartlomiej Zolnierkiewicz
2020-09-08 11:37     ` Bartlomiej Zolnierkiewicz
2020-09-08 11:37     ` Bartlomiej Zolnierkiewicz
2020-09-08 12:08     ` Julia Lawall
2020-07-27  3:35 [jlawall:for-5.9 1/7] drivers/most/core.c:254:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-07-27  3:35 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-07-26 23:39 [jlawall:for-5.9 1/7] drivers/scsi/ufs/ufshcd.c:1749:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-07-26 23:39 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-07-08  2:42 [jlawall:for-5.9 1/3] drivers/char/hw_random/core.c:399:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-07-08  2:42 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-07-08  2:42 ` kernel test robot
2020-07-08  2:42 ` kernel test robot
2020-07-07 17:07 [jlawall:for-5.9 1/3] drivers/scsi/pcmcia/sym53c500_cs.c:621:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-07-07 17:07 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-07-03 11:35 [jlawall:for-5.9 1/3] drivers/tty/serial/8250/8250_port.c:2989:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-07-03 11:35 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-07-03 11:35 ` kernel test robot
2020-07-03 11:35 ` kernel test robot
2020-07-03 11:35 ` kernel test robot
2020-07-03 11:35 ` kernel test robot
2020-07-03 11:35 ` kernel test robot
2020-07-03 11:35 ` kernel test robot
2020-07-03 11:35 ` kernel test robot
2020-07-03 11:36 ` kernel test robot
2020-07-03 11:36 ` kernel test robot
2020-07-03 11:36 ` kernel test robot
2020-07-03 11:36 ` kernel test robot
2020-06-25  4:50 [jlawall:for-5.9 1/3] drivers/base/core.c:1526:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-06-25  4:50 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
2020-06-25  3:41 [jlawall:for-5.9 1/3] arch/x86/events/core.c:2219:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-06-25  3:41 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.