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

Macpaul Lin macpaul at gmail.com
Fri Apr 8 09:58:09 CEST 2011


Hi Wolfgang,

>> > Checkpatch complains a lot about "do not add new typedefs".
>>
>> Indeed, but this seems is special for Linux Kernel,
>
> Not really.  This is Linux CodingStyle policy, which we usually adapt.
>
>> I've checked some of the "typedefs" from other architecture code in u-boot.
>
> This does not mean much.  Yes, there are tons of typedef's in U-Boot,
> but this is old code that has not been cleaned up yet.  At least we
> now try not to add to that pool.
>
>> 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.

File arch/nds32/include/asm/posix_types.h  and arch/nds32/include/asm/types.h
come from the Linux kernel. Which is usually used for posix
compatibility for Linux Kernel.
Which should be "old" features for posix and compatibility.
However, you cannot say for a new architecture to support posix and
other compatibility as
"new" typedef.
I've checked the latest kernel (2.6.38.1), arm, mips, avr32, powerpc
consist these posix_types.h and types.h with "typedef".

It looks the kernel is not going to fix the "old" typedef for
posix_types.h and types.h

I think they say "please do not add any new typedef" might mean to
those typedef
used in drivers or protocols.

In the other 2 files arch/nds32/include/asm/global_data.h and
arch/nds32/include/asm/u-boot.h,
typedef was used for
#449: FILE: arch/nds32/include/asm/global_data.h:46:
+typedef        struct global_data {
+} gd_t;
#1505: FILE: arch/nds32/include/asm/u-boot.h:41:
+typedef struct bd_info {
+} bd_t;

I don't know if you have any idea of fixing it in u-boot.

If you have an explicit way to fix it, for example,
"we must declare bd_t in each function before we use it",
I'll very glad to do it for fixing up the coding style.
Otherwise I'm afraid of the fixing "typedef" here in these 2 file might lead
function or other problem in u-boot build with nds32.

Thanks.

-- 
Best regards,
Macpaul Lin


More information about the U-Boot mailing list