Skip to content

Commit

Permalink
staging: unisys/visorbus: add __init/__exit annotations
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
arndb authored and gregkh committed Sep 18, 2017
1 parent 2bd6bf0 commit 056e4fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/unisys/visorbus/visorchipset.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}
Expand Down

0 comments on commit 056e4fc

Please sign in to comment.