linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH resend] module/decompress: generate sysfs string at compile time
@ 2022-09-06  8:03 David Disseldorp
  2022-09-06 18:12 ` Dmitry Torokhov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Disseldorp @ 2022-09-06  8:03 UTC (permalink / raw)
  To: dmitry.torokhov, mcgrof; +Cc: linux-modules, David Disseldorp

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>
---
 kernel/module/decompress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Resend: Maintainer addresses added.

Feel free to drop the to-be-expected commit message body if desired.

diff --git a/kernel/module/decompress.c b/kernel/module/decompress.c
index 4d0bcb3d9e449..c033572d83f0e 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);
-- 
2.35.3


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

* Re: [PATCH resend] module/decompress: generate sysfs string at compile time
  2022-09-06  8:03 [PATCH resend] module/decompress: generate sysfs string at compile time David Disseldorp
@ 2022-09-06 18:12 ` Dmitry Torokhov
  2022-09-07 15:23 ` Aaron Tomlin
  2022-09-09  0:01 ` Luis Chamberlain
  2 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2022-09-06 18:12 UTC (permalink / raw)
  To: David Disseldorp; +Cc: mcgrof, linux-modules

On Tue, Sep 06, 2022 at 10:03:18AM +0200, David Disseldorp wrote:
> 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>
> ---
>  kernel/module/decompress.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Resend: Maintainer addresses added.
> 
> Feel free to drop the to-be-expected commit message body if desired.
> 
> diff --git a/kernel/module/decompress.c b/kernel/module/decompress.c
> index 4d0bcb3d9e449..c033572d83f0e 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");

I guess we van trust the kernel source not to put garbage into
MODULE_COMPRESSION macro.

Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Thanks.

-- 
Dmitry

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

* Re: [PATCH resend] module/decompress: generate sysfs string at compile time
  2022-09-06  8:03 [PATCH resend] module/decompress: generate sysfs string at compile time David Disseldorp
  2022-09-06 18:12 ` Dmitry Torokhov
@ 2022-09-07 15:23 ` Aaron Tomlin
  2022-09-09  0:01 ` Luis Chamberlain
  2 siblings, 0 replies; 4+ messages in thread
From: Aaron Tomlin @ 2022-09-07 15:23 UTC (permalink / raw)
  To: David Disseldorp; +Cc: dmitry.torokhov, mcgrof, linux-modules

On Tue 2022-09-06 10:03 +0200, David Disseldorp wrote:
> 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>
> ---
>  kernel/module/decompress.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Resend: Maintainer addresses added.
> 
> Feel free to drop the to-be-expected commit message body if desired.
> 
> diff --git a/kernel/module/decompress.c b/kernel/module/decompress.c
> index 4d0bcb3d9e449..c033572d83f0e 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);
> -- 
> 2.35.3
> 

Reviewed-by: Aaron Tomlin <atomlin@redhat.com>

-- 
Aaron Tomlin


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

* Re: [PATCH resend] module/decompress: generate sysfs string at compile time
  2022-09-06  8:03 [PATCH resend] module/decompress: generate sysfs string at compile time David Disseldorp
  2022-09-06 18:12 ` Dmitry Torokhov
  2022-09-07 15:23 ` Aaron Tomlin
@ 2022-09-09  0:01 ` Luis Chamberlain
  2 siblings, 0 replies; 4+ messages in thread
From: Luis Chamberlain @ 2022-09-09  0:01 UTC (permalink / raw)
  To: David Disseldorp; +Cc: dmitry.torokhov, linux-modules

On Tue, Sep 06, 2022 at 10:03:18AM +0200, David Disseldorp wrote:
> 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>

Thanks! Queued up to modules-testing.

  Luis

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

end of thread, other threads:[~2022-09-09  0:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-06  8:03 [PATCH resend] module/decompress: generate sysfs string at compile time David Disseldorp
2022-09-06 18:12 ` Dmitry Torokhov
2022-09-07 15:23 ` Aaron Tomlin
2022-09-09  0:01 ` Luis Chamberlain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).