1 // SPDX-License-Identifier: GPL-2.0-only
3 /// From Documentation/filesystems/sysfs.rst:
4 /// show() should only use sysfs_emit() or sysfs_emit_at() when formatting
5 /// the value to be returned to user space.
8 // Copyright: (C) 2020 Denis Efremov ISPRAS
9 // Options: --no-includes --include-headers
18 identifier show, dev, attr, buf;
22 ssize_t show(struct device *dev, struct device_attribute *attr, char *buf)
25 * return snprintf@p(...);
30 identifier show, dev, attr, buf;
31 expression BUF, SZ, FORMAT;
34 ssize_t show(struct device *dev, struct device_attribute *attr, char *buf)
38 - snprintf(BUF, SZ, FORMAT
39 + sysfs_emit(BUF, FORMAT
44 @script: python depends on report@
48 coccilib.report.print_report(p[0], "WARNING: please use sysfs_emit or sysfs_emit_at")
50 @script: python depends on org@
54 coccilib.org.print_todo(p[0], "WARNING: please use sysfs_emit or sysfs_emit_at")