ARM: S3C64XX: Fix section mismatch from cpufreq init
Subsystems (3)
PATCH 1/1 ARM: S3C64XX: Fix section mismatch from cpufreq init
The cpufreq init function is referenced from the driver structure and we don't appear to have annotations which allow us to mark that it'll never be called after system init, causing the linker consistency infrastructure to complain. Just remove the __init annotation to avoid noise from the build.
--- arch/arm/mach-s3c64xx/cpufreq.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-s3c64xx/cpufreq.c +1 -1
@@ -181,7 +181,7 @@ static void __init s3c64xx_cpufreq_config_regulator(void) }#endif -static int __init s3c64xx_cpufreq_driver_init (struct cpufreq_policy *policy) +static int s3c64xx_cpufreq_driver_init (struct cpufreq_policy *policy) {int ret;struct cpufreq_frequency_table *freq;
Signature · 1 line
1.7.2.3
PATCH 1/1 ARM: S3C64XX: Fix section mismatch from cpufreq init
arch/arm/mach-s3c64xx/cpufreq.c static void __init
Quoted 18 lines · Mark Brown
The cpufreq init function is referenced from the driver structure and we don't appear to have annotations which allow us to mark that it'll never be called after system init, causing the linker consistency infrastructure to complain. Just remove the
__initannotation to avoid noise from the build.Signed-off-by Mark Brown <[email protected]>--- arch/arm/mach-s3c64xx/cpufreq.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/arm/mach- renamed from arch/arm/mach-s3c64xx/cpufreq.c +0
-0
s3c64xx/cpufreq.c
index 74c0e83..4375b97 100644arch/arm/mach-s3c64xx/cpufreq.c +0
-0@@ -181,7 +181,7 @@ static void __init
s3c64xx_cpufreq_config_regulator(void)
arch/arm/mach-s3c64xx/cpufreq.c static void __init · line 184
Quoted 4 lines
arch/arm/mach-s3c64xx/cpufreq.c +0
-1}#endif -static int __init s3c64xx_cpufreq_driver_init(struct cpufreq_policy
*policy)
arch/arm/mach-s3c64xx/cpufreq.c static void __init s3c64xx_cpufreq_config_regulator(void)
Quoted 5 lines
arch/arm/mach-s3c64xx/cpufreq.c +1
-1+static int s3c64xx_cpufreq_driver_init (struct cpufreq_policy *policy) {int ret;struct cpufreq_frequency_table *freq; --
Looks ok, applied into s5p-fixes-for-linus for 38 :) Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH 1/1 ARM: S3C64XX: Fix section mismatch from cpufreq init
In reply to Mark BrownQuoted 26 lines · Kukjin Kim
arch/arm/mach-s3c64xx/cpufreq.c static void __init
Quoted 18 lines · Mark Brown
The cpufreq init function is referenced from the driver structure and we don't appear to have annotations which allow us to mark that it'll never be called after system init, causing the linker consistency infrastructure to complain. Just remove the
__initannotation to avoid noise from the build.Signed-off-by Mark Brown <[email protected]>--- arch/arm/mach-s3c64xx/cpufreq.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/arm/mach- renamed from arch/arm/mach-s3c64xx/cpufreq.c +0
-0
s3c64xx/cpufreq.c
index 74c0e83..4375b97 100644arch/arm/mach-s3c64xx/cpufreq.c +0
-0@@ -181,7 +181,7 @@ static void __init
s3c64xx_cpufreq_config_regulator(void)arch/arm/mach-s3c64xx/cpufreq.c static void __init · line 184
Quoted 4 lines
arch/arm/mach-s3c64xx/cpufreq.c +0
-1}#endif -static int __init s3c64xx_cpufreq_driver_init(struct cpufreq_policy*policy)
Quoted 9 lines
arch/arm/mach-s3c64xx/cpufreq.c static void __init s3c64xx_cpufreq_config_regulator(void)
Quoted 5 lines
arch/arm/mach-s3c64xx/cpufreq.c +1
-1+static int s3c64xx_cpufreq_driver_init (struct cpufreq_policy *policy) {int ret;struct cpufreq_frequency_table *freq; --Looks ok, applied into s5p-fixes-for-linus for 38 :) Thanks.
Oops, I missed 'pull request' before 38 :(
So will apply this into for-next...
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH 1/1 ARM: S3C64XX: Fix section mismatch from cpufreq init
Quoted 2 lines · Kukjin Kim
Oops, I missed 'pull request' before 38 :(
So will apply this into for-next...
No worries, it's a warning fix rather than something urgent.
PATCH 1/1 ARM: S3C64XX: Fix section mismatch from cpufreq init
In reply to Mark BrownQuoted 16 lines · Mark Brown
The cpufreq init function is referenced from the driver structure and we don't appear to have annotations which allow us to mark that it'll never be called after system init, causing the linker consistency infrastructure to complain. Just remove the
__initannotation to avoid noise from the build.Signed-off-by Mark Brown <[email protected]>--- arch/arm/mach-s3c64xx/cpufreq.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/arm/mach-s3c64xx/cpufreq.c +0
-0
arch/arm/mach-s3c64xx/cpufreq.c static void __init s3c64xx_cpufreq_config_regulator(void) · line 187
Quoted 8 lines
arch/arm/mach-s3c64xx/cpufreq.c +1
-1@@ -181,7 +181,7 @@ static void __init s3c64xx_cpufreq_config_regulator(void) }#endif -static int __init s3c64xx_cpufreq_driver_init (struct cpufreq_policy *policy) +static int s3c64xx_cpufreq_driver_init (struct cpufreq_policy *policy) {int ret;struct cpufreq_frequency_table *freq;
Actually this is warning is a false positive. There is a section mismatch, but it is never a problem because the .init callback is only called by cpufreq_register_driver. To get rid of the warning the right fix is to remove the .init callback from struct cpufreq_driver and change the prototype of cpufreq_register_driver to
int cpufreq_register_driver(struct cpufreq_driver *, int (*)(struct cpufreq_policy *))
(that is pass the init callback to cpufreq_register_driver).
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH 1/1 ARM: S3C64XX: Fix section mismatch from cpufreq init
Quoted 9 lines · Uwe Kleine-König
Quoted 2 lines · Mark Brown
we don't appear to have annotations which allow us to mark that it'll never be called after system init, causing the linker consistency
Actually this is warning is a false positive. There is a section mismatch, but it is never a problem because the .init callback is only called by
cpufreq_register_driver. To get rid of the warning the right fix is to remove the .init callback from structcpufreq_driverand change the prototype ofcpufreq_register_driverto
That's what I said above, pretty much. Ideally we'd have a way of annotating the call sites so that the linker infrastructure rather than having to faff about splitting the structures like this.
PATCH 1/1 ARM: S3C64XX: Fix section mismatch from cpufreq init
Quoted 11 lines · Mark Brown
Quoted 9 lines · Uwe Kleine-K?nig
Quoted 2 lines · Mark Brown
we don't appear to have annotations which allow us to mark that it'll never be called after system init, causing the linker consistency
Actually this is warning is a false positive. There is a section mismatch, but it is never a problem because the .init callback is only called by
cpufreq_register_driver. To get rid of the warning the right fix is to remove the .init callback from structcpufreq_driverand change the prototype ofcpufreq_register_driverto
Quoted 3 lines
That's what I said above, pretty much. Ideally we'd have a way of annotating the call sites so that the linker infrastructure rather than having to faff about splitting the structures like this.
You can mark the driver struct using __ref. But IMHO not saving a reference to a function only used once is cleaner.
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH 1/1 ARM: S3C64XX: Fix section mismatch from cpufreq init
Quoted 8 lines · Uwe Kleine-K?nig
Quoted 3 lines · Mark Brown
That's what I said above, pretty much. Ideally we'd have a way of annotating the call sites so that the linker infrastructure rather than having to faff about splitting the structures like this.
You can mark the driver struct using
__ref. But IMHO not saving a reference to a function only used once is cleaner.
It's pretty annoying to have to define two structs for the affected drivers (it's not like cpufreq is the only affected subsystem here) - there's good reasons why we use things like __devexit_p() rather than split structs for common cases like this.