[U-Boot] [PATCH 1/4] net/miiphy/serial: drop duplicate "NAMESIZE" define

Mike Frysinger vapier at gentoo.org
Fri Nov 11 23:47:41 CET 2011


On Friday 11 November 2011 17:07:46 Andy Fleming wrote:
> On Thu, Nov 10, 2011 at 6:11 PM, Mike Frysinger <vapier at gentoo.org> 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 


More information about the U-Boot mailing list