Subject: Re: Subject: [PATCH 5/6] bna: Brocade 10Gb Ethernet device driver

From: Stephen Hemminger <[email-masked]>
Date: Tue, 17 Nov 2009 08:35:41 -0800

On Tue, 17 Nov 2009 00:32:45 -0800
Rasesh Mody <[email-masked]> wrote:

> > +
> > +#define wwn_t u64
> > +#define lun_t u64
> 
> "No need for obfuscation, at least use a typedef."
> 
> Hi Stephen,
> 
> When using a typedef in place of #define for wwn_t we are getting check-patch warning. Is it advisable to use a typedef?
> 
> - Rasesh

People disagree but my opinion on typedef's is they are ok as long as:
  * a structure or integral type (ie not a pointer)
  * encapsulates some semantic meaning (be32, spin_lock, irq_return)
  * used in several places
  * not just a data structure

The other option is just do a global replace.

What you were doing with #define is a weaker form of typedef. Which
is worse.

--