On Mon, 2005-11-07 at 14:41 -0600, linas wrote: > > > > Also, "grep typedef include/linux/*" shows that many kernel device > > > drivers use this convention. > > > > They are wrong and should be fixed. > > What, precisely, is wrong? I can't seem to find it on google, but IIRC Linus stated that he didn't want any more structures defined with typedefs. If it is a structure, simple keep it one, and don't use typedef to get rid of "struct". This was for the simple reason, too many developers were passing structures by value instead of by reference, just because they were using a type that they didn't realize was a structure. And to make things worse, these structures started to get bigger. So in my every day programming, I switched to not typedef structures anymore, and I even found some places that I passed structures by value when it would have been much more efficient by reference. The only exceptions that I can see where you typedef a structure is for use with arch dependent types, like atomic_t. -- Steve - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: typedefs and structs
- From: linas <[email protected]>
- Re: typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- From: Neil Brown <[email protected]>
- Re: typedefs and structs
- References:
- [PATCH 0/42] PCI Error Recovery for PPC64 and misc device drivers
- From: Linas Vepstas <[email protected]>
- [PATCH 16/42]: PCI: PCI Error reporting callbacks
- From: Linas Vepstas <[email protected]>
- Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks
- From: Greg KH <[email protected]>
- Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks
- From: Paul Mackerras <[email protected]>
- Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks
- From: linas <[email protected]>
- Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks
- From: Greg KH <[email protected]>
- typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- From: linas <[email protected]>
- Re: typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- From: Greg KH <[email protected]>
- Re: typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- From: linas <[email protected]>
- Re: typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- From: Greg KH <[email protected]>
- Re: typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- From: linas <[email protected]>
- [PATCH 0/42] PCI Error Recovery for PPC64 and misc device drivers
- Prev by Date: Re: [PATCH 7/6] fat: Support a truncate() for expanding size
- Next by Date: Re: Database regression due to scheduler changes ?
- Previous by thread: Re: typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- Next by thread: Re: typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- Index(es):