From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Fri, 11 Nov 2011 17:47:41 -0500 Subject: [U-Boot] [PATCH 1/4] net/miiphy/serial: drop duplicate "NAMESIZE" define In-Reply-To: References: <1320970267-22297-1-git-send-email-vapier@gentoo.org> Message-ID: <201111111747.42924.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Friday 11 November 2011 17:07:46 Andy Fleming wrote: > On Thu, Nov 10, 2011 at 6:11 PM, Mike Frysinger wrote: > > diff --git a/include/net.h b/include/net.h > > index ad9afbf..b4acd8f 100644 > > --- a/include/net.h > > +++ b/include/net.h > > @@ -66,8 +66,6 @@ typedef void rxhand_icmp_f(unsigned type, unsigned > > code, unsigned dport, */ > > typedef void thand_f(void); > > > > -#define NAMESIZE 16 > > - > > enum eth_state_t { > > ETH_STATE_INIT, > > ETH_STATE_PASSIVE, > > @@ -75,7 +73,7 @@ enum eth_state_t { > > }; > > > > struct eth_device { > > - char name[NAMESIZE]; > > + char name[16]; > > I like all of the earlier NAMESIZE->sizeof changes, but I'm not as > comfortable with changing the various name declarations. Seems like we > might want named constants for them, just so any dependencies can be > clearly-documented. For instance, in Linux the MDIO bus specifiers are > designed to be bigger than the MDIO device name, and the size > declarations reflect this. sounds like something that can easily be expressed with: BUILD_BUG_ON(sizeof(dev->name) < sizeof(mii->name)); -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20111111/5b759da0/attachment.pgp