mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: unisys/visorbus: add __init/__exit annotations
@ 2017-09-15 19:23 Arnd Bergmann
  2017-09-27 18:52 ` Kershner, David A
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-09-15 19:23 UTC (permalink / raw)
  To: David Kershner, Greg Kroah-Hartman
  Cc: Arnd Bergmann, Tim Sell, Sameer Wadgaonkar, David Binder,
	Bryan Thompson, sparmaintainer, devel, linux-kernel

gcc-4.6 causes a harmless warning about the init function:

WARNING: vmlinux.o(.text+0xed62c2): Section mismatch in reference from the function init_unisys() to the function .init.text:visorutil_spar_detect()
The function init_unisys() references
the function __init visorutil_spar_detect().
This is often because init_unisys lacks a __init
annotation or the annotation of visorutil_spar_detect is wrong.

It appears that newer versions inline visorutil_spar_detect(),
end up with an empty __init section. This marks the module
entry points as __init and __exit respectively, which avoids
the warning and slightly reduces the runtime code size.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/unisys/visorbus/visorchipset.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 74cce4f1a7bd..27ecf6fb49fd 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1826,7 +1826,7 @@ static __init int visorutil_spar_detect(void)
 	return 0;
 }
 
-static int init_unisys(void)
+static int __init init_unisys(void)
 {
 	int result;
 
@@ -1841,7 +1841,7 @@ static int init_unisys(void)
 	return 0;
 };
 
-static void exit_unisys(void)
+static void __exit exit_unisys(void)
 {
 	acpi_bus_unregister_driver(&unisys_acpi_driver);
 }
-- 
2.9.0

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

* RE: [PATCH] staging: unisys/visorbus: add __init/__exit annotations
  2017-09-15 19:23 [PATCH] staging: unisys/visorbus: add __init/__exit annotations Arnd Bergmann
@ 2017-09-27 18:52 ` Kershner, David A
  0 siblings, 0 replies; 2+ messages in thread
From: Kershner, David A @ 2017-09-27 18:52 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman
  Cc: Sell, Timothy C, Wadgaonkar, Sameer Laxmikant, Binder,
	David Anthony, Thompson, Bryan E.,
	*S-Par-Maintainer, devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2250 bytes --]

> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd@arndb.de]
> Sent: Friday, September 15, 2017 3:23 PM
> To: Kershner, David A <David.Kershner@unisys.com>; Greg Kroah-Hartman
> <gregkh@linuxfoundation.org>
> Cc: Arnd Bergmann <arnd@arndb.de>; Sell, Timothy C
> <Timothy.Sell@unisys.com>; Wadgaonkar, Sameer Laxmikant
> <Sameer.Wadgaonkar@unisys.com>; Binder, David Anthony
> <David.Binder@unisys.com>; Thompson, Bryan E.
> <bryan.thompson@unisys.com>; *S-Par-Maintainer
> <SParMaintainer@unisys.com>; devel@driverdev.osuosl.org; linux-
> kernel@vger.kernel.org
> Subject: [PATCH] staging: unisys/visorbus: add __init/__exit annotations
> 
> gcc-4.6 causes a harmless warning about the init function:
> 
> WARNING: vmlinux.o(.text+0xed62c2): Section mismatch in reference from
> the function init_unisys() to the function
.init.text:visorutil_spar_detect()
> The function init_unisys() references
> the function __init visorutil_spar_detect().
> This is often because init_unisys lacks a __init
> annotation or the annotation of visorutil_spar_detect is wrong.
> 
> It appears that newer versions inline visorutil_spar_detect(),
> end up with an empty __init section. This marks the module
> entry points as __init and __exit respectively, which avoids
> the warning and slightly reduces the runtime code size.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: David Kershner <david.kershner@unisys.com>

Thanks,
David Kershner

> ---
>  drivers/staging/unisys/visorbus/visorchipset.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/unisys/visorbus/visorchipset.c
> b/drivers/staging/unisys/visorbus/visorchipset.c
> index 74cce4f1a7bd..27ecf6fb49fd 100644
> --- a/drivers/staging/unisys/visorbus/visorchipset.c
> +++ b/drivers/staging/unisys/visorbus/visorchipset.c
> @@ -1826,7 +1826,7 @@ static __init int visorutil_spar_detect(void)
>  	return 0;
>  }
> 
> -static int init_unisys(void)
> +static int __init init_unisys(void)
>  {
>  	int result;
> 
> @@ -1841,7 +1841,7 @@ static int init_unisys(void)
>  	return 0;
>  };
> 
> -static void exit_unisys(void)
> +static void __exit exit_unisys(void)
>  {
>  	acpi_bus_unregister_driver(&unisys_acpi_driver);
>  }
> --
> 2.9.0


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 7862 bytes --]

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

end of thread, other threads:[~2017-09-27 18:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-15 19:23 [PATCH] staging: unisys/visorbus: add __init/__exit annotations Arnd Bergmann
2017-09-27 18:52 ` Kershner, David A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®