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

Wolfgang Denk wd at denx.de
Sat Apr 30 01:09:25 CEST 2011


Dear Macpaul Lin,

In message <BANLkTi=haZVW17eNWYCmYf3McrGmbm-4Xw at mail.gmail.com> you wrote:
> 
> I think we still have to discuss about the typedef's.
> What does the "new" typedef means?

It means adding any new code to U-Boot which includes "typedef"s.

> 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.

So these files should be fixed in Linux, too, because it is the Linux
checkpatch tool which throws this warning.

I don't think this affects POSIX compatibility. Which typedef's are
required by POSIX?

> 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".

Maybe this is old code that was added before checkpatch existed?

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

Eventually they would not add these files as is any more today.

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

I mean all of them.

> 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;

Ouch. You got me there... :-(

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

Well, the fix is basicly straightforward - replace all ocurrences of
gd_t and bd_t in the U-Boot code.  But this is a bigger issue and more
work than I dare to push on you.  I'm grinding my teeth, but I will
accept these.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If ignorance is bliss, why aren't there more happy people?


More information about the U-Boot mailing list