net/miiphy/serial: drop duplicate "NAMESIZE" define
A few subsystems are using the same define "NAMESIZE". This has been working so far because they define it to the same number. However, I want to change the size of eth_device's NAMESIZE, so rather than tweak the define names, simply drop references to it. Almost no one does, and the handful that do can easily be changed to a sizeof(). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
2b22460956
commit
f6add132f6
@ -221,7 +221,7 @@ void mv6436x_eth_initialize (bd_t * bis)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* must be less than NAMESIZE (16) */
|
/* must be less than sizeof(dev->name) */
|
||||||
sprintf (dev->name, "mv_enet%d", devnum);
|
sprintf (dev->name, "mv_enet%d", devnum);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -221,7 +221,7 @@ void mv6446x_eth_initialize (bd_t * bis)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* must be less than NAMESIZE (16) */
|
/* must be less than sizeof(dev->name) */
|
||||||
sprintf (dev->name, "mv_enet%d", devnum);
|
sprintf (dev->name, "mv_enet%d", devnum);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -221,7 +221,7 @@ void mv6436x_eth_initialize (bd_t * bis)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* must be less than NAMESIZE (16) */
|
/* must be less than sizeof(dev->name) */
|
||||||
sprintf (dev->name, "mv_enet%d", devnum);
|
sprintf (dev->name, "mv_enet%d", devnum);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -686,7 +686,7 @@ gt6426x_eth_initialize(bd_t *bis)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* must be less than NAMESIZE (16) */
|
/* must be less than sizeof(dev->name) */
|
||||||
sprintf(dev->name, "gal_enet%d", devnum);
|
sprintf(dev->name, "gal_enet%d", devnum);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -274,7 +274,7 @@ void mv6446x_eth_initialize (bd_t * bis)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* must be less than NAMESIZE (16) */
|
/* must be less than sizeof(dev->name) */
|
||||||
sprintf (dev->name, "mv_enet%d", devnum);
|
sprintf (dev->name, "mv_enet%d", devnum);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -715,7 +715,7 @@ int armada100_fec_register(unsigned long base_addr)
|
|||||||
/* Assign ARMADA100 Fast Ethernet Controller Base Address */
|
/* Assign ARMADA100 Fast Ethernet Controller Base Address */
|
||||||
darmdfec->regs = (void *)base_addr;
|
darmdfec->regs = (void *)base_addr;
|
||||||
|
|
||||||
/* must be less than NAMESIZE (16) */
|
/* must be less than sizeof(dev->name) */
|
||||||
strcpy(dev->name, "armd-fec0");
|
strcpy(dev->name, "armd-fec0");
|
||||||
|
|
||||||
dev->init = armdfec_init;
|
dev->init = armdfec_init;
|
||||||
|
@ -702,7 +702,7 @@ error1:
|
|||||||
|
|
||||||
dev = &dmvgbe->dev;
|
dev = &dmvgbe->dev;
|
||||||
|
|
||||||
/* must be less than NAMESIZE (16) */
|
/* must be less than sizeof(dev->name) */
|
||||||
sprintf(dev->name, "egiga%d", devnum);
|
sprintf(dev->name, "egiga%d", devnum);
|
||||||
|
|
||||||
switch (devnum) {
|
switch (devnum) {
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct fixed_phy_port {
|
struct fixed_phy_port {
|
||||||
char name[NAMESIZE]; /* ethernet port name */
|
char name[16]; /* ethernet port name */
|
||||||
unsigned int speed; /* specified speed 10,100 or 1000 */
|
unsigned int speed; /* specified speed 10,100 or 1000 */
|
||||||
unsigned int duplex; /* specified duplex FULL or HALF */
|
unsigned int duplex; /* specified duplex FULL or HALF */
|
||||||
};
|
};
|
||||||
|
@ -86,7 +86,7 @@ void mdio_list_devices(void);
|
|||||||
#define BB_MII_DEVNAME "bb_miiphy"
|
#define BB_MII_DEVNAME "bb_miiphy"
|
||||||
|
|
||||||
struct bb_miiphy_bus {
|
struct bb_miiphy_bus {
|
||||||
char name[NAMESIZE];
|
char name[16];
|
||||||
int (*init)(struct bb_miiphy_bus *bus);
|
int (*init)(struct bb_miiphy_bus *bus);
|
||||||
int (*mdio_active)(struct bb_miiphy_bus *bus);
|
int (*mdio_active)(struct bb_miiphy_bus *bus);
|
||||||
int (*mdio_tristate)(struct bb_miiphy_bus *bus);
|
int (*mdio_tristate)(struct bb_miiphy_bus *bus);
|
||||||
|
@ -67,8 +67,6 @@ typedef void rxhand_icmp_f(unsigned type, unsigned code, unsigned dport,
|
|||||||
*/
|
*/
|
||||||
typedef void thand_f(void);
|
typedef void thand_f(void);
|
||||||
|
|
||||||
#define NAMESIZE 16
|
|
||||||
|
|
||||||
enum eth_state_t {
|
enum eth_state_t {
|
||||||
ETH_STATE_INIT,
|
ETH_STATE_INIT,
|
||||||
ETH_STATE_PASSIVE,
|
ETH_STATE_PASSIVE,
|
||||||
@ -76,7 +74,7 @@ enum eth_state_t {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct eth_device {
|
struct eth_device {
|
||||||
char name[NAMESIZE];
|
char name[16];
|
||||||
unsigned char enetaddr[6];
|
unsigned char enetaddr[6];
|
||||||
int iobase;
|
int iobase;
|
||||||
int state;
|
int state;
|
||||||
|
@ -3,10 +3,9 @@
|
|||||||
|
|
||||||
#include <post.h>
|
#include <post.h>
|
||||||
|
|
||||||
#define NAMESIZE 16
|
|
||||||
|
|
||||||
struct serial_device {
|
struct serial_device {
|
||||||
char name[NAMESIZE];
|
/* enough bytes to match alignment of following func pointer */
|
||||||
|
char name[16];
|
||||||
|
|
||||||
int (*init) (void);
|
int (*init) (void);
|
||||||
int (*uninit) (void);
|
int (*uninit) (void);
|
||||||
|
@ -203,7 +203,7 @@ int eth_register(struct eth_device *dev)
|
|||||||
struct eth_device *d;
|
struct eth_device *d;
|
||||||
static int index = 0;
|
static int index = 0;
|
||||||
|
|
||||||
assert(strlen(dev->name) < NAMESIZE);
|
assert(strlen(dev->name) < sizeof(dev->name));
|
||||||
|
|
||||||
if (!eth_devices) {
|
if (!eth_devices) {
|
||||||
eth_current = eth_devices = dev;
|
eth_current = eth_devices = dev;
|
||||||
|
Loading…
Reference in New Issue
Block a user