diff options
author | David Disseldorp <ddiss@suse.de> | 2022-09-06 10:03:18 +0200 |
---|---|---|
committer | Luis Chamberlain <mcgrof@kernel.org> | 2022-09-08 17:00:43 -0700 |
commit | 77d6354bd422c8a451ef7d2235322dbf33e7427b (patch) | |
tree | 67ab792629e5b1bf3cc1320f9d41de8c06c86f35 /kernel/module | |
parent | beef988c2085e197ea5f36144dc753aff5b2e7af (diff) | |
download | lwn-77d6354bd422c8a451ef7d2235322dbf33e7427b.tar.gz lwn-77d6354bd422c8a451ef7d2235322dbf33e7427b.zip |
module/decompress: generate sysfs string at compile time
compression_show() before (with noinline):
0xffffffff810b5ff0 <+0>: mov %rdx,%rdi
0xffffffff810b5ff3 <+3>: mov $0xffffffff81b55629,%rsi
0xffffffff810b5ffa <+10>: mov $0xffffffff81b0cde2,%rdx
0xffffffff810b6001 <+17>: call 0xffffffff811b8fd0 <sysfs_emit>
0xffffffff810b6006 <+22>: cltq
0xffffffff810b6008 <+24>: ret
After:
0xffffffff810b5ff0 <+0>: mov $0xffffffff81b0cde2,%rsi
0xffffffff810b5ff7 <+7>: mov %rdx,%rdi
0xffffffff810b5ffa <+10>: call 0xffffffff811b8fd0 <sysfs_emit>
0xffffffff810b5fff <+15>: cltq
0xffffffff810b6001 <+17>: ret
Signed-off-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Aaron Tomlin <atomlin@redhat.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'kernel/module')
-rw-r--r-- | kernel/module/decompress.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/module/decompress.c b/kernel/module/decompress.c index 4d0bcb3d9e44..c033572d83f0 100644 --- a/kernel/module/decompress.c +++ b/kernel/module/decompress.c @@ -256,7 +256,7 @@ void module_decompress_cleanup(struct load_info *info) static ssize_t compression_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { - return sysfs_emit(buf, "%s\n", __stringify(MODULE_COMPRESSION)); + return sysfs_emit(buf, __stringify(MODULE_COMPRESSION) "\n"); } static struct kobj_attribute module_compression_attr = __ATTR_RO(compression); |