diff mbox

[1/2] kbuild: two trivial fixes for check headers

Message ID 20090604080406.7005.27662.sendpatchset@localhost.localdomain (mailing list archive)
State New, archived
Headers show

Commit Message

Amerigo Wang June 4, 2009, 8:01 a.m. UTC
Remove a useless 'extern' in an exported header.
Fix a comment headers_check.pl.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Sam Ravnborg <sam@ravnborg.org>

------
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Amerigo Wang June 4, 2009, 9:23 a.m. UTC | #1
Sam Ravnborg wrote:
> On Thu, Jun 04, 2009 at 04:01:52AM -0400, Amerigo Wang wrote:
>   
>> Remove a useless 'extern' in an exported header.
>> Fix a comment headers_check.pl.
>>     
>
> These two patches has nothing in commom.
>   

They are both about kernel headers stuff.

>   
>> Signed-off-by: WANG Cong <amwang@redhat.com>
>> Cc: Sam Ravnborg <sam@ravnborg.org>
>>
>> ------
>> diff --git a/include/mtd/jffs2-user.h b/include/mtd/jffs2-user.h
>> index fa94b0e..10dc7ef 100644
>> --- a/include/mtd/jffs2-user.h
>> +++ b/include/mtd/jffs2-user.h
>> @@ -18,7 +18,7 @@
>>  #undef je32_to_cpu
>>  #undef jemode_to_cpu
>>  
>> -extern int target_endian;
>> +int target_endian;
>>     
>
> You now declare a global variable named target_endian each time you include this file - which is wrong.
>   
Why? 'make headers_check' complains about it.

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Amerigo Wang June 5, 2009, 2:05 a.m. UTC | #2
Sam Ravnborg wrote:
> Rightfully is does...
> But is think it is a prototype of a function.
>
> But think about it - it does not makes sense to have an
> extern declarationof a variable in an exported header.
> There is no way that userspace can access this variable
> from user-space and therefore the declaration of the variable
> needs to be moved to a kernel-only header file.
>
>   

Agree, then the script looks wrong. I will fix it.

> So if you touch this I would ask you not to consider a single line
> in jffs-user.h - but rather take a critiacal look at the whole
> file and fix any issues there is.
> And then to send it to the mtd people (dwmw2).
> I did not look at the file but just looking at yout patch
> the "undef jemode_to_cpu" looks fishy in an exported header.
>   

Hmm, after googling a bit, I got this patch:

http://patchwork.ozlabs.org/patch/26224/

So I won't touch this.

Thanks.


--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jaswinder Singh Rajput June 5, 2009, 2:23 a.m. UTC | #3
On Thu, 2009-06-04 at 12:39 +0200, Sam Ravnborg wrote:

> So if you touch this I would ask you not to consider a single line
> in jffs-user.h - but rather take a critiacal look at the whole
> file and fix any issues there is.
> And then to send it to the mtd people (dwmw2).
> I did not look at the file but just looking at yout patch
> the "undef jemode_to_cpu" looks fishy in an exported header.
> 

David already have patches to remove whole jffs-user.h file and AFAIK he
already queued it. So no point of touching this file.

Thanks,
--
JSR

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/mtd/jffs2-user.h b/include/mtd/jffs2-user.h
index fa94b0e..10dc7ef 100644
--- a/include/mtd/jffs2-user.h
+++ b/include/mtd/jffs2-user.h
@@ -18,7 +18,7 @@ 
 #undef je32_to_cpu
 #undef jemode_to_cpu
 
-extern int target_endian;
+int target_endian;
 
 #define t16(x) ({ __u16 __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_16(__b); })
 #define t32(x) ({ __u32 __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_32(__b); })
diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
index 56f90a4..ccdbace 100644
--- a/scripts/headers_check.pl
+++ b/scripts/headers_check.pl
@@ -2,7 +2,7 @@ 
 #
 # headers_check.pl execute a number of trivial consistency checks
 #
-# Usage: headers_check.pl dir [files...]
+# Usage: headers_check.pl dir arch [files...]
 # dir:   dir to look for included files
 # arch:  architecture
 # files: list of files to check