summaryrefslogtreecommitdiffstats
path: root/drivers/base/topology.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2020-09-16 13:40:42 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-02 13:12:07 +0200
commit948b3edba8988306b635578a72b0dab6091a5eb0 (patch)
tree08cd168cd9b11df4eda9a86478d1ab0b51c34017 /drivers/base/topology.c
parent27275d301813d1f3b1b2fe5576d4afd690df6b99 (diff)
downloadlinux-948b3edba8988306b635578a72b0dab6091a5eb0.tar.bz2
drivers core: Miscellaneous changes for sysfs_emit
Change additional instances that could use sysfs_emit and sysfs_emit_at that the coccinelle script could not convert. o macros creating show functions with ## concatenation o unbound sprintf uses with buf+len for start of output to sysfs_emit_at o returns with ?: tests and sprintf to sysfs_emit o sysfs output with struct class * not struct device * arguments Miscellanea: o remove unnecessary initializations around these changes o consistently use int len for return length of show functions o use octal permissions and not S_<FOO> o rename a few show function names so DEVICE_ATTR_<FOO> can be used o use DEVICE_ATTR_ADMIN_RO where appropriate o consistently use const char *output for strings o checkpatch/style neatening Signed-off-by: Joe Perches <joe@perches.com> Link: https://lore.kernel.org/r/8bc24444fe2049a9b2de6127389b57edfdfe324d.1600285923.git.joe@perches.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/topology.c')
-rw-r--r--drivers/base/topology.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/base/topology.c b/drivers/base/topology.c
index ad8d33c6077b..4d254fcc93d1 100644
--- a/drivers/base/topology.c
+++ b/drivers/base/topology.c
@@ -14,11 +14,11 @@
#include <linux/hardirq.h>
#include <linux/topology.h>
-#define define_id_show_func(name) \
-static ssize_t name##_show(struct device *dev, \
- struct device_attribute *attr, char *buf) \
-{ \
- return sprintf(buf, "%d\n", topology_##name(dev->id)); \
+#define define_id_show_func(name) \
+static ssize_t name##_show(struct device *dev, \
+ struct device_attribute *attr, char *buf) \
+{ \
+ return sysfs_emit(buf, "%d\n", topology_##name(dev->id)); \
}
#define define_siblings_show_map(name, mask) \