[U-Boot] [PATCH v7 01/10] nds32: add header files support for nds32

Macpaul Lin macpaul at gmail.com
Mon Apr 11 04:05:40 CEST 2011


Hi Wolfgang,

>>> I did check typedefs one by one by myself in hand and eye checking.
>>> If some thing is not suitable for using "typedefs" please let me know.
>>
>> Please don't add any new typedef's.
>>
>
> I think we still have to discuss about the typedef's.
> What does the "new" typedef means?
>
> According to the checkpatch result, "typedef" warning exists in 4 files.
> arch/nds32/include/asm/posix_types.h
> arch/nds32/include/asm/types.h
> arch/nds32/include/asm/global_data.h
> arch/nds32/include/asm/u-boot.h.
>

I've found the origin purpose of adding typedef check to checkpatch.pl
from the author "apw".
Please refer to url
"http://lkml.indiana.edu/hypermail/linux/kernel/0801.0/0354.html"
I quote his words as below.

Andy Whitcroft (apw said..)
"It is checkpatch's role to point out things which are likely to be
wrong. There will always be exceptions. Lines which are much more
readable if they spill over 80 characters, typedefs which do make sense.
atomic_t's for example. This may well be a valid use of them. Note
that this is mentioned as a WARNING not an ERROR. As is stated in the
patch submission notes, you are meant to be comfortable with everything
which checkpatch is still reporting.

checkpatch is a style _guide_, not the be all and end all. It is meant
to carry a preferred style to try and maintain some consistency kernel
wide."

There is also a section of the coding style which related to "typedef" in Linux
Kernel's Documents.

Please also refer to "Chapter 5, typedef" in "Documentation/CodingStyle".

Hope this information is helping other patch submitters. Thanks.

-- 
Best regards,
Macpaul Lin


More information about the U-Boot mailing list