public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] avr32/clock.c: Move '#include linux/export.h' to fix build failure
@ 2011-08-15 18:02 Peter Huewe
  2011-08-15 19:22 ` Paul Gortmaker
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Huewe @ 2011-08-15 18:02 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: Haavard Skinnemoen, Hans-Christian Egtvedt, linux-kernel,
	Stephen Rothwell, Peter Huewe

This patch fixes a build failure for the avr32 defconfig by moving the include
of linux/export.h to the top of the file where it is needed.

Without the patch the build first warns about:
arch/avr32/mach-at32ap/clock.c:62: warning: data definition has no type
or storage class
arch/avr32/mach-at32ap/clock.c:62: warning: type defaults to 'int' in
declaration of 'EXPORT_SYMBOL'
arch/avr32/mach-at32ap/clock.c:62: warning: parameter names (without
types) in function declaration
(...)

And then fails with
ERROR: "clk_enable" [sound/spi/snd-at73c213.ko] undefined!
ERROR: "clk_disable" [sound/spi/snd-at73c213.ko] undefined!
(...)

This is because the definition of EXPORT_SYMBOL is needed before the
first usage, and thus the include has to be on the top of the file.

While at it, I sorted the include list alphabetically.

KernelVersion: Linux-next 20110812

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
 arch/avr32/mach-at32ap/clock.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/avr32/mach-at32ap/clock.c b/arch/avr32/mach-at32ap/clock.c
index 579d619..78c873a 100644
--- a/arch/avr32/mach-at32ap/clock.c
+++ b/arch/avr32/mach-at32ap/clock.c
@@ -12,10 +12,11 @@
  * published by the Free Software Foundation.
  */
 #include <linux/clk.h>
-#include <linux/err.h>
 #include <linux/device.h>
-#include <linux/string.h>
+#include <linux/err.h>
+#include <linux/export.h>
 #include <linux/list.h>
+#include <linux/string.h>
 
 #include <mach/chip.h>
 
@@ -186,7 +187,6 @@ EXPORT_SYMBOL(clk_get_parent);
 #include <linux/io.h>
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
-#include <linux/export.h>
 #include "pm.h"
 
 
-- 
1.7.3.4


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

* Re: [PATCH] avr32/clock.c: Move '#include linux/export.h' to fix build failure
  2011-08-15 18:02 [PATCH] avr32/clock.c: Move '#include linux/export.h' to fix build failure Peter Huewe
@ 2011-08-15 19:22 ` Paul Gortmaker
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Gortmaker @ 2011-08-15 19:22 UTC (permalink / raw)
  To: Peter Huewe
  Cc: Haavard Skinnemoen, Hans-Christian Egtvedt, linux-kernel,
	Stephen Rothwell

On 11-08-15 02:02 PM, Peter Huewe wrote:
> This patch fixes a build failure for the avr32 defconfig by moving the include
> of linux/export.h to the top of the file where it is needed.
> 
> Without the patch the build first warns about:
> arch/avr32/mach-at32ap/clock.c:62: warning: data definition has no type
> or storage class
> arch/avr32/mach-at32ap/clock.c:62: warning: type defaults to 'int' in
> declaration of 'EXPORT_SYMBOL'
> arch/avr32/mach-at32ap/clock.c:62: warning: parameter names (without
> types) in function declaration
> (...)
> 
> And then fails with
> ERROR: "clk_enable" [sound/spi/snd-at73c213.ko] undefined!
> ERROR: "clk_disable" [sound/spi/snd-at73c213.ko] undefined!
> (...)
> 
> This is because the definition of EXPORT_SYMBOL is needed before the
> first usage, and thus the include has to be on the top of the file.

Thanks Peter,  I'll squish this fix into the commit that introduces
the misplacement.  It was searching out the last "#include <linux/xyz.h>
and appending after that.  Occasionally where someone has a large
block of them in an #ifdef CONFIG_BLAH did it get misplaced.  And then
it was only visible if the arch didn't set CONFIG_BLAH, as what has
happened here on avr32 it seems.

Paul.

> 
> While at it, I sorted the include list alphabetically.
> 
> KernelVersion: Linux-next 20110812
> 
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
> ---
>  arch/avr32/mach-at32ap/clock.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/avr32/mach-at32ap/clock.c b/arch/avr32/mach-at32ap/clock.c
> index 579d619..78c873a 100644
> --- a/arch/avr32/mach-at32ap/clock.c
> +++ b/arch/avr32/mach-at32ap/clock.c
> @@ -12,10 +12,11 @@
>   * published by the Free Software Foundation.
>   */
>  #include <linux/clk.h>
> -#include <linux/err.h>
>  #include <linux/device.h>
> -#include <linux/string.h>
> +#include <linux/err.h>
> +#include <linux/export.h>
>  #include <linux/list.h>
> +#include <linux/string.h>
>  
>  #include <mach/chip.h>
>  
> @@ -186,7 +187,6 @@ EXPORT_SYMBOL(clk_get_parent);
>  #include <linux/io.h>
>  #include <linux/debugfs.h>
>  #include <linux/seq_file.h>
> -#include <linux/export.h>
>  #include "pm.h"
>  
>  

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

end of thread, other threads:[~2011-08-15 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-15 18:02 [PATCH] avr32/clock.c: Move '#include linux/export.h' to fix build failure Peter Huewe
2011-08-15 19:22 ` Paul Gortmaker

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