2011-09-20 17:39:15

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH -next] bcma: needs export.h

From: Randy Dunlap <[email protected]>

bcma/driver_chipcommon_pmu.c needs to include <linux/export.h>,
so add it to the headers that are included by bcma_private.h.

Fixes these warnings:

drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: data definition has no type or storage class
drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: parameter names (without types) in function declaration
drivers/bcma/driver_chipcommon_pmu.c:36:1: warning: data definition has no type or storage class
drivers/bcma/driver_chipcommon_pmu.c:36:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
drivers/bcma/driver_chipcommon_pmu.c:36:1: warning: parameter names (without types) in function declaration
drivers/bcma/driver_chipcommon_pmu.c:45:1: warning: data definition has no type or storage class
drivers/bcma/driver_chipcommon_pmu.c:45:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
drivers/bcma/driver_chipcommon_pmu.c:45:1: warning: parameter names (without types) in function declaration
drivers/bcma/driver_chipcommon_pmu.c:54:1: warning: data definition has no type or storage class
drivers/bcma/driver_chipcommon_pmu.c:54:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
drivers/bcma/driver_chipcommon_pmu.c:54:1: warning: parameter names (without types) in function declaration

Signed-off-by: Randy Dunlap <[email protected]>
---
drivers/bcma/bcma_private.h | 1 +
1 file changed, 1 insertion(+)

--- next-2011-0920.orig/drivers/bcma/bcma_private.h
+++ next-2011-0920/drivers/bcma/bcma_private.h
@@ -7,6 +7,7 @@

#include <linux/bcma/bcma.h>
#include <linux/delay.h>
+#include <linux/export.h>

#define BCMA_CORE_SIZE 0x1000




2011-09-21 21:42:13

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH -next] bcma: main.c and driver_mips.c need linux/export.h

On 09/21/2011 04:07 PM, Randy Dunlap wrote:
> From: Randy Dunlap<[email protected]>
>
> main.c and driver_mips.c use EXPORT_SYMBOL() etc.
> so they should include<linux/export.h>.
>
> Signed-off-by: Randy Dunlap<[email protected]>

From this commit message, it appears that every routine that uses
EXPORT_SYMBOL() will need to include this header. I looked at modifying rtlwifi
and friends to include this header, but found that include/linux/export.h does
not exist in any of my source trees. From that I assume that the change will
happen in 3.2.

I have prepared a patch, but cannot use it at the moment. Is there somewhere
that I should send it?

Larry



2011-09-21 18:00:58

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH -next v2] bcma: driver_chipcommon_pmu.c needs linux/export.h

W dniu 21 września 2011 17:52 użytkownik Randy Dunlap
<[email protected]> napisał:
> On 09/20/2011 11:45 PM, Rafał Miłecki wrote:
>> W dniu 20 września 2011 22:51 użytkownik Randy Dunlap
>> <[email protected]> napisał:
>>> From: Randy Dunlap <[email protected]>
>>>
>>> bcma/driver_chipcommon_pmu.c needs to include <linux/export.h>
>>> to fix these warnings:
>>>
>>> drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: data definition has no type or storage class
>>> drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
>>> drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: parameter names (without types) in function declaration
>>
>> Don't you get the same warning for core.c? Weird...
>
> No, I don't.  Stranger things have happened, I'm sure.
>
> Feel free to add export.h to other files, or do you want me
> to do that?

Please do that while you're hacking that include anyway.

--
Rafał

2011-09-21 06:46:09

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH -next v2] bcma: driver_chipcommon_pmu.c needs linux/export.h

W dniu 20 września 2011 22:51 użytkownik Randy Dunlap
<[email protected]> napisał:
> From: Randy Dunlap <[email protected]>
>
> bcma/driver_chipcommon_pmu.c needs to include <linux/export.h>
> to fix these warnings:
>
> drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: data definition has no type or storage class
> drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
> drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: parameter names (without types) in function declaration

Don't you get the same warning for core.c? Weird...

--
Rafał

2011-09-20 20:51:41

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH -next v2] bcma: driver_chipcommon_pmu.c needs linux/export.h

From: Randy Dunlap <[email protected]>

bcma/driver_chipcommon_pmu.c needs to include <linux/export.h>
to fix these warnings:

drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: data definition has no type or storage class
drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: parameter names (without types) in function declaration
drivers/bcma/driver_chipcommon_pmu.c:36:1: warning: data definition has no type or storage class
drivers/bcma/driver_chipcommon_pmu.c:36:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
drivers/bcma/driver_chipcommon_pmu.c:36:1: warning: parameter names (without types) in function declaration
drivers/bcma/driver_chipcommon_pmu.c:45:1: warning: data definition has no type or storage class
drivers/bcma/driver_chipcommon_pmu.c:45:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
drivers/bcma/driver_chipcommon_pmu.c:45:1: warning: parameter names (without types) in function declaration
drivers/bcma/driver_chipcommon_pmu.c:54:1: warning: data definition has no type or storage class
drivers/bcma/driver_chipcommon_pmu.c:54:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
drivers/bcma/driver_chipcommon_pmu.c:54:1: warning: parameter names (without types) in function declaration

Signed-off-by: Randy Dunlap <[email protected]>
---
drivers/bcma/driver_chipcommon_pmu.c | 1 +
1 file changed, 1 insertion(+)

--- next-2011-0920.orig/drivers/bcma/driver_chipcommon_pmu.c
+++ next-2011-0920/drivers/bcma/driver_chipcommon_pmu.c
@@ -9,6 +9,7 @@
*/

#include "bcma_private.h"
+#include <linux/export.h>
#include <linux/bcma/bcma.h>

static u32 bcma_chipco_pll_read(struct bcma_drv_cc *cc, u32 offset)

2011-09-20 18:45:59

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH -next] bcma: needs export.h

2011/9/20 Randy Dunlap <[email protected]>:
> From: Randy Dunlap <[email protected]>
>
> bcma/driver_chipcommon_pmu.c needs to include <linux/export.h>,
> so add it to the headers that are included by bcma_private.h.

Please take a look at discussion in:
[PATCH -next] bcma: main.c needs to include <linux/slab.h>
thread (by Andrew).

I believe that according to the discussion, such a includes should be
done in .c files.

Andrew: can you comment? Am I right?

--
Rafał

2011-09-21 21:49:08

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH -next] bcma: main.c and driver_mips.c need linux/export.h

On 09/21/2011 02:42 PM, Larry Finger wrote:
> On 09/21/2011 04:07 PM, Randy Dunlap wrote:
>> From: Randy Dunlap<[email protected]>
>>
>> main.c and driver_mips.c use EXPORT_SYMBOL() etc.
>> so they should include<linux/export.h>.
>>
>> Signed-off-by: Randy Dunlap<[email protected]>
>
> From this commit message, it appears that every routine that uses EXPORT_SYMBOL() will need to include this header. I looked at modifying rtlwifi and friends to include this header, but found that include/linux/export.h does not exist in any of my source trees. From that I assume that the change will happen in 3.2.
>
> I have prepared a patch, but cannot use it at the moment. Is there somewhere that I should send it?

Hi Larry,

linux/export.h is only in linux-next. I think that you should just prepare
a linux-next patch for rtlwifi and then push it after Paul Gortmaker's
module.h-split git tree has been merged (it splits module.h into module.h
and export.h), or maybe you could ask Paul to merge your patch into his tree.

[I added Paul to the cc: list.]

--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

2011-09-20 20:43:19

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH -next] bcma: needs export.h

On 09/20/2011 11:45 AM, Rafał Miłecki wrote:
> 2011/9/20 Randy Dunlap <[email protected]>:
>> From: Randy Dunlap <[email protected]>
>>
>> bcma/driver_chipcommon_pmu.c needs to include <linux/export.h>,
>> so add it to the headers that are included by bcma_private.h.
>
> Please take a look at discussion in:
> [PATCH -next] bcma: main.c needs to include <linux/slab.h>
> thread (by Andrew).
>
> I believe that according to the discussion, such a includes should be
> done in .c files.
>
> Andrew: can you comment? Am I right?


Sure, I'll resubmit the patch.

Is there already a patch to remove <linux/delay.h> from bcma_private.h ?

bcma_private.h uses __init & __exit, so it should #include <linux/init.h> ...


--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

2011-09-20 22:40:41

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH -next] bcma: needs export.h

On Tue, 20 Sep 2011 20:45:57 +0200
Rafa__ Mi__ecki <[email protected]> wrote:

> 2011/9/20 Randy Dunlap <[email protected]>:
> > From: Randy Dunlap <[email protected]>
> >
> > bcma/driver_chipcommon_pmu.c needs to include <linux/export.h>,
> > so add it to the headers that are included by bcma_private.h.
>
> Please take a look at discussion in:
> [PATCH -next] bcma: main.c needs to include <linux/slab.h>
> thread (by Andrew).
>
> I believe that according to the discussion, such a includes should be
> done in .c files.
>
> Andrew: can you comment? Am I right?

Ordinarily, yes, it is preferable to include the needed .h files from
within the .c files. However quite a mumber of kernel subsystems do
take the #include "everything.h" approach.

However, drivers/bcma is a bit odd in that it has bcma_private.h which
includes delay.h (the everything.h approach) but most .c files
explicitly include other things, including export.h.

There's no real pattern here and yes, I agree that the minimal and more
typical approach is better.

--- a/drivers/bcma/driver_chipcommon_pmu.c~bcma-needs-exporth
+++ a/drivers/bcma/driver_chipcommon_pmu.c
@@ -10,6 +10,7 @@

#include "bcma_private.h"
#include <linux/bcma/bcma.h>
+#include <linux/export.h>

static u32 bcma_chipco_pll_read(struct bcma_drv_cc *cc, u32 offset)
{
_


2011-09-21 15:52:46

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH -next v2] bcma: driver_chipcommon_pmu.c needs linux/export.h

On 09/20/2011 11:45 PM, Rafał Miłecki wrote:
> W dniu 20 września 2011 22:51 użytkownik Randy Dunlap
> <[email protected]> napisał:
>> From: Randy Dunlap <[email protected]>
>>
>> bcma/driver_chipcommon_pmu.c needs to include <linux/export.h>
>> to fix these warnings:
>>
>> drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: data definition has no type or storage class
>> drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
>> drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: parameter names (without types) in function declaration
>
> Don't you get the same warning for core.c? Weird...

No, I don't. Stranger things have happened, I'm sure.

Feel free to add export.h to other files, or do you want me
to do that?


--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

2011-09-20 21:11:15

by Stephen Rothwell

[permalink] [raw]
Subject: Re: [PATCH -next v2] bcma: driver_chipcommon_pmu.c needs linux/export.h

Hi Randy,

On Tue, 20 Sep 2011 13:51:39 -0700 Randy Dunlap <[email protected]> wrote:
>
> From: Randy Dunlap <[email protected]>
>
> bcma/driver_chipcommon_pmu.c needs to include <linux/export.h>
> to fix these warnings:
>
> drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: data definition has no type or storage class
> drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
> drivers/bcma/driver_chipcommon_pmu.c:27:1: warning: parameter names (without types) in function declaration
> drivers/bcma/driver_chipcommon_pmu.c:36:1: warning: data definition has no type or storage class
> drivers/bcma/driver_chipcommon_pmu.c:36:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
> drivers/bcma/driver_chipcommon_pmu.c:36:1: warning: parameter names (without types) in function declaration
> drivers/bcma/driver_chipcommon_pmu.c:45:1: warning: data definition has no type or storage class
> drivers/bcma/driver_chipcommon_pmu.c:45:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
> drivers/bcma/driver_chipcommon_pmu.c:45:1: warning: parameter names (without types) in function declaration
> drivers/bcma/driver_chipcommon_pmu.c:54:1: warning: data definition has no type or storage class
> drivers/bcma/driver_chipcommon_pmu.c:54:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
> drivers/bcma/driver_chipcommon_pmu.c:54:1: warning: parameter names (without types) in function declaration
>
> Signed-off-by: Randy Dunlap <[email protected]>

I have added this to my collection of merge fixups for the moduleh tree
(since linux/export.h doesn't exist in Linus' tree, yet).

--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (1.78 kB)
(No filename) (490.00 B)
Download all attachments

2011-09-21 21:07:41

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH -next] bcma: main.c and driver_mips.c need linux/export.h

From: Randy Dunlap <[email protected]>

main.c and driver_mips.c use EXPORT_SYMBOL() etc.
so they should include <linux/export.h>.

Signed-off-by: Randy Dunlap <[email protected]>
---
drivers/bcma/driver_mips.c | 1 +
drivers/bcma/main.c | 1 +
2 files changed, 2 insertions(+)

--- next-2011-0921.orig/drivers/bcma/driver_mips.c
+++ next-2011-0921/drivers/bcma/driver_mips.c
@@ -14,6 +14,7 @@

#include <linux/bcma/bcma.h>

+#include <linux/export.h>
#include <linux/serial.h>
#include <linux/serial_core.h>
#include <linux/serial_reg.h>
--- next-2011-0921.orig/drivers/bcma/main.c
+++ next-2011-0921/drivers/bcma/main.c
@@ -7,6 +7,7 @@

#include "bcma_private.h"
#include <linux/module.h>
+#include <linux/export.h>
#include <linux/bcma/bcma.h>
#include <linux/slab.h>