From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: Subject: [PATCH 5/6] bna: Brocade 10Gb Ethernet device driver Date: Tue, 17 Nov 2009 08:35:41 -0800 Message-ID: <20091117083541.69e1e403@nehalam> References: <200911130346.nAD3kquT001065@blc-10-10.brocade.com> <20091112210751.06e2d3c6@nehalam> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "netdev@vger.kernel.org" , "Adapter Linux Open SRC Team" To: Rasesh Mody Return-path: Received: from mail.vyatta.com ([76.74.103.46]:34772 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751876AbZKQQgC (ORCPT ); Tue, 17 Nov 2009 11:36:02 -0500 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 17 Nov 2009 00:32:45 -0800 Rasesh Mody 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. --