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

Andy Fleming afleming at gmail.com
Fri Nov 11 23:07:46 CET 2011


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.

Andy


More information about the U-Boot mailing list