Skip to contentSkip to conversation

ARM: S3C64XX: Fix section mismatch from cpufreq init

PATCH New Mark Brown 3 participants 8 messages Mar 10, 2011 – Mar 16, 2011

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

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
index 74c0e83..4375b97 100644
@@ -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
#1 lore raw

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 __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- renamed from arch/arm/mach-s3c64xx/cpufreq.c +0 -0

s3c64xx/cpufreq.c
index 74c0e83..4375b97 100644

arch/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.

#2 lore raw

PATCH 1/1 ARM: S3C64XX: Fix section mismatch from cpufreq init

In reply to Mark Brown
Quoted 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 __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- renamed from arch/arm/mach-s3c64xx/cpufreq.c +0 -0

s3c64xx/cpufreq.c
index 74c0e83..4375b97 100644

arch/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.

author
#3 lore raw

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.

#4 lore raw

PATCH 1/1 ARM: S3C64XX: Fix section mismatch from cpufreq init

In reply to Mark Brown
Quoted 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 __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 +0 -0
index 74c0e83..4375b97 100644

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/  |
author
#5 lore raw

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 struct cpufreq_driver and change the prototype of cpufreq_register_driver to

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.

#6 lore raw

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 struct cpufreq_driver and change the prototype of cpufreq_register_driver to

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/  |
author
#7 lore raw

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.