1 // SPDX-License-Identifier: GPL-2.0-only
3 /// From Documentation/filesystems/sysfs.rst:
4 /// show() must not use snprintf() when formatting the value to be
5 /// returned to user space. If you can guarantee that an overflow
6 /// will never happen you can use sprintf() otherwise you must use
10 // Copyright: (C) 2020 Denis Efremov ISPRAS
11 // Options: --no-includes --include-headers
20 identifier show, dev, attr, buf;
24 ssize_t show(struct device *dev, struct device_attribute *attr, char *buf)
27 * return snprintf@p(...);
32 identifier show, dev, attr, buf;
35 ssize_t show(struct device *dev, struct device_attribute *attr, char *buf)
45 @script: python depends on report@
49 coccilib.report.print_report(p[0], "WARNING: use scnprintf or sprintf")
51 @script: python depends on org@
55 coccilib.org.print_todo(p[0], "WARNING: use scnprintf or sprintf")