lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20091117083541.69e1e403@nehalam>
Date:	Tue, 17 Nov 2009 08:35:41 -0800
From:	Stephen Hemminger <shemminger@...tta.com>
To:	Rasesh Mody <rmody@...cade.com>
Cc:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"Adapter Linux Open SRC Team" 
	<adapter_linux_open_src_team@...cade.COM>
Subject: Re: Subject: [PATCH 5/6] bna: Brocade 10Gb Ethernet device driver

On Tue, 17 Nov 2009 00:32:45 -0800
Rasesh Mody <rmody@...cade.com> 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.

-- 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists