drivers/net/: all drivers/net/ cleanup with ARRAY_SIZE
Signed-off-by: Denis Cheng <crquan@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
parent
10d024c1b2
commit
ff8ac60948
|
@ -246,7 +246,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
|
||||||
{0x00, NE_EN0_RSARHI},
|
{0x00, NE_EN0_RSARHI},
|
||||||
{E8390_RREAD+E8390_START, NE_CMD},
|
{E8390_RREAD+E8390_START, NE_CMD},
|
||||||
};
|
};
|
||||||
for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++) {
|
for (i = 0; i < ARRAY_SIZE(program_seq); i++) {
|
||||||
outb(program_seq[i].value, ioaddr + program_seq[i].offset);
|
outb(program_seq[i].value, ioaddr + program_seq[i].offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -414,7 +414,7 @@ static void am79c961_setmulticastlist (struct net_device *dev)
|
||||||
/*
|
/*
|
||||||
* Update the multicast hash table
|
* Update the multicast hash table
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < sizeof(multi_hash) / sizeof(multi_hash[0]); i++)
|
for (i = 0; i < ARRAY_SIZE(multi_hash); i++)
|
||||||
write_rreg(dev->base_addr, i + LADRL, multi_hash[i]);
|
write_rreg(dev->base_addr, i + LADRL, multi_hash[i]);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -263,7 +263,7 @@ struct lance_addr {
|
||||||
(highest byte stripped) */
|
(highest byte stripped) */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define N_LANCE_ADDR (sizeof(lance_addr_list)/sizeof(*lance_addr_list))
|
#define N_LANCE_ADDR ARRAY_SIZE(lance_addr_list)
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for the Lance */
|
/* Definitions for the Lance */
|
||||||
|
|
|
@ -603,7 +603,7 @@ static struct atl1_spi_flash_dev flash_table[] = {
|
||||||
|
|
||||||
static void atl1_init_flash_opcode(struct atl1_hw *hw)
|
static void atl1_init_flash_opcode(struct atl1_hw *hw)
|
||||||
{
|
{
|
||||||
if (hw->flash_vendor >= sizeof(flash_table) / sizeof(flash_table[0]))
|
if (hw->flash_vendor >= ARRAY_SIZE(flash_table))
|
||||||
hw->flash_vendor = 0; /* ATMEL */
|
hw->flash_vendor = 0; /* ATMEL */
|
||||||
|
|
||||||
/* Init OP table */
|
/* Init OP table */
|
||||||
|
|
|
@ -3492,7 +3492,7 @@ bnx2_init_nvram(struct bnx2 *bp)
|
||||||
/* Determine the selected interface. */
|
/* Determine the selected interface. */
|
||||||
val = REG_RD(bp, BNX2_NVM_CFG1);
|
val = REG_RD(bp, BNX2_NVM_CFG1);
|
||||||
|
|
||||||
entry_count = sizeof(flash_table) / sizeof(struct flash_spec);
|
entry_count = ARRAY_SIZE(flash_table);
|
||||||
|
|
||||||
if (val & 0x40000000) {
|
if (val & 0x40000000) {
|
||||||
|
|
||||||
|
|
|
@ -805,7 +805,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
|
||||||
i = cs8900_irq_map[0];
|
i = cs8900_irq_map[0];
|
||||||
#else
|
#else
|
||||||
/* Translate the IRQ using the IRQ mapping table. */
|
/* Translate the IRQ using the IRQ mapping table. */
|
||||||
if (i >= sizeof(cs8900_irq_map)/sizeof(cs8900_irq_map[0]))
|
if (i >= ARRAY_SIZE(cs8900_irq_map))
|
||||||
printk("\ncs89x0: invalid ISA interrupt number %d\n", i);
|
printk("\ncs89x0: invalid ISA interrupt number %d\n", i);
|
||||||
else
|
else
|
||||||
i = cs8900_irq_map[i];
|
i = cs8900_irq_map[i];
|
||||||
|
@ -1246,11 +1246,11 @@ write_irq(struct net_device *dev, int chip_type, int irq)
|
||||||
|
|
||||||
if (chip_type == CS8900) {
|
if (chip_type == CS8900) {
|
||||||
/* Search the mapping table for the corresponding IRQ pin. */
|
/* Search the mapping table for the corresponding IRQ pin. */
|
||||||
for (i = 0; i != sizeof(cs8900_irq_map)/sizeof(cs8900_irq_map[0]); i++)
|
for (i = 0; i != ARRAY_SIZE(cs8900_irq_map); i++)
|
||||||
if (cs8900_irq_map[i] == irq)
|
if (cs8900_irq_map[i] == irq)
|
||||||
break;
|
break;
|
||||||
/* Not found */
|
/* Not found */
|
||||||
if (i == sizeof(cs8900_irq_map)/sizeof(cs8900_irq_map[0]))
|
if (i == ARRAY_SIZE(cs8900_irq_map))
|
||||||
i = 3;
|
i = 3;
|
||||||
writereg(dev, PP_CS8900_ISAINT, i);
|
writereg(dev, PP_CS8900_ISAINT, i);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -106,8 +106,7 @@ static const struct e1000_stats e1000_gstrings_stats[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
#define E1000_QUEUE_STATS_LEN 0
|
#define E1000_QUEUE_STATS_LEN 0
|
||||||
#define E1000_GLOBAL_STATS_LEN \
|
#define E1000_GLOBAL_STATS_LEN ARRAY_SIZE(e1000_gstrings_stats)
|
||||||
sizeof(e1000_gstrings_stats) / sizeof(struct e1000_stats)
|
|
||||||
#define E1000_STATS_LEN (E1000_GLOBAL_STATS_LEN + E1000_QUEUE_STATS_LEN)
|
#define E1000_STATS_LEN (E1000_GLOBAL_STATS_LEN + E1000_QUEUE_STATS_LEN)
|
||||||
static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = {
|
static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = {
|
||||||
"Register test (offline)", "Eeprom test (offline)",
|
"Register test (offline)", "Eeprom test (offline)",
|
||||||
|
|
|
@ -308,12 +308,11 @@ int fec_mii_phy_id_detect(struct net_device *dev)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0, phy = phy_info; i < sizeof(phy_info) / sizeof(phy_info[0]);
|
for (i = 0, phy = phy_info; i < ARRAY_SIZE(phy_info); i++, phy++)
|
||||||
i++, phy++)
|
|
||||||
if (phy->id == (phy_hwid >> 4) || phy->id == 0)
|
if (phy->id == (phy_hwid >> 4) || phy->id == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (i >= sizeof(phy_info) / sizeof(phy_info[0])) {
|
if (i >= ARRAY_SIZE(phy_info)) {
|
||||||
printk(KERN_ERR DRV_MODULE_NAME
|
printk(KERN_ERR DRV_MODULE_NAME
|
||||||
": %s PHY id 0x%08x is not supported!\n",
|
": %s PHY id 0x%08x is not supported!\n",
|
||||||
dev->name, phy_hwid);
|
dev->name, phy_hwid);
|
||||||
|
|
|
@ -132,7 +132,7 @@ void emac_dbg_register(int idx, struct ocp_enet_private *dev)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
if (idx >= sizeof(__emacs) / sizeof(__emacs[0])) {
|
if (idx >= ARRAY_SIZE(__emacs)) {
|
||||||
printk(KERN_WARNING
|
printk(KERN_WARNING
|
||||||
"invalid index %d when registering EMAC for debugging\n",
|
"invalid index %d when registering EMAC for debugging\n",
|
||||||
idx);
|
idx);
|
||||||
|
@ -148,7 +148,7 @@ void mal_dbg_register(int idx, struct ibm_ocp_mal *mal)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
if (idx >= sizeof(__mals) / sizeof(__mals[0])) {
|
if (idx >= ARRAY_SIZE(__mals)) {
|
||||||
printk(KERN_WARNING
|
printk(KERN_WARNING
|
||||||
"invalid index %d when registering MAL for debugging\n",
|
"invalid index %d when registering MAL for debugging\n",
|
||||||
idx);
|
idx);
|
||||||
|
@ -167,11 +167,11 @@ void emac_dbg_dump_all(void)
|
||||||
|
|
||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
|
|
||||||
for (i = 0; i < sizeof(__mals) / sizeof(__mals[0]); ++i)
|
for (i = 0; i < ARRAY_SIZE(__mals); ++i)
|
||||||
if (__mals[i])
|
if (__mals[i])
|
||||||
emac_mal_dump(__mals[i]);
|
emac_mal_dump(__mals[i]);
|
||||||
|
|
||||||
for (i = 0; i < sizeof(__emacs) / sizeof(__emacs[0]); ++i)
|
for (i = 0; i < ARRAY_SIZE(__emacs); ++i)
|
||||||
if (__emacs[i])
|
if (__emacs[i])
|
||||||
emac_mac_dump(i, __emacs[i]);
|
emac_mac_dump(i, __emacs[i]);
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ static int actisys_reset(struct sir_dev *);
|
||||||
/* Note : the 220L doesn't support 38400, but we will fix that below */
|
/* Note : the 220L doesn't support 38400, but we will fix that below */
|
||||||
static unsigned baud_rates[] = { 9600, 19200, 57600, 115200, 38400 };
|
static unsigned baud_rates[] = { 9600, 19200, 57600, 115200, 38400 };
|
||||||
|
|
||||||
#define MAX_SPEEDS (sizeof(baud_rates)/sizeof(baud_rates[0]))
|
#define MAX_SPEEDS ARRAY_SIZE(baud_rates)
|
||||||
|
|
||||||
static struct dongle_driver act220l = {
|
static struct dongle_driver act220l = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
|
|
@ -94,8 +94,7 @@ static struct ixgb_stats ixgb_gstrings_stats[] = {
|
||||||
{"tx_csum_offload_errors", IXGB_STAT(hw_csum_tx_error)}
|
{"tx_csum_offload_errors", IXGB_STAT(hw_csum_tx_error)}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define IXGB_STATS_LEN \
|
#define IXGB_STATS_LEN ARRAY_SIZE(ixgb_gstrings_stats)
|
||||||
sizeof(ixgb_gstrings_stats) / sizeof(struct ixgb_stats)
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
||||||
|
|
|
@ -515,8 +515,6 @@ CLEAR_INT(void) {
|
||||||
outb(0, IOADDR+8);
|
outb(0, IOADDR+8);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SIZE(x) (sizeof(x)/sizeof((x)[0]))
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* selftest or dump */
|
/* selftest or dump */
|
||||||
static void
|
static void
|
||||||
|
@ -532,7 +530,7 @@ i596_port_do(struct net_device *dev, int portcmd, char *cmdname) {
|
||||||
mdelay(30); /* random, unmotivated */
|
mdelay(30); /* random, unmotivated */
|
||||||
|
|
||||||
printk("lp486e i82596 %s result:\n", cmdname);
|
printk("lp486e i82596 %s result:\n", cmdname);
|
||||||
for (m = SIZE(lp->dump.dump); m && lp->dump.dump[m-1] == 0; m--)
|
for (m = ARRAY_SIZE(lp->dump.dump); m && lp->dump.dump[m-1] == 0; m--)
|
||||||
;
|
;
|
||||||
for (i = 0; i < m; i++) {
|
for (i = 0; i < m; i++) {
|
||||||
printk(" %04x", lp->dump.dump[i]);
|
printk(" %04x", lp->dump.dump[i]);
|
||||||
|
|
|
@ -2680,8 +2680,7 @@ static const struct mv643xx_stats mv643xx_gstrings_stats[] = {
|
||||||
{ "late_collision", MV643XX_STAT(mib_counters.late_collision) },
|
{ "late_collision", MV643XX_STAT(mib_counters.late_collision) },
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MV643XX_STATS_LEN \
|
#define MV643XX_STATS_LEN ARRAY_SIZE(mv643xx_gstrings_stats)
|
||||||
sizeof(mv643xx_gstrings_stats) / sizeof(struct mv643xx_stats)
|
|
||||||
|
|
||||||
static void mv643xx_get_drvinfo(struct net_device *netdev,
|
static void mv643xx_get_drvinfo(struct net_device *netdev,
|
||||||
struct ethtool_drvinfo *drvinfo)
|
struct ethtool_drvinfo *drvinfo)
|
||||||
|
|
|
@ -257,7 +257,7 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
|
||||||
{E8390_RREAD+E8390_START, E8390_CMD},
|
{E8390_RREAD+E8390_START, E8390_CMD},
|
||||||
};
|
};
|
||||||
|
|
||||||
for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++)
|
for (i = 0; i < ARRAY_SIZE(program_seq); i++)
|
||||||
outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
|
outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -375,7 +375,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
|
||||||
{E8390_RREAD+E8390_START, E8390_CMD},
|
{E8390_RREAD+E8390_START, E8390_CMD},
|
||||||
};
|
};
|
||||||
|
|
||||||
for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++)
|
for (i = 0; i < ARRAY_SIZE(program_seq); i++)
|
||||||
outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
|
outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -430,7 +430,7 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
|
||||||
{E8390_RREAD+E8390_START, E8390_CMD},
|
{E8390_RREAD+E8390_START, E8390_CMD},
|
||||||
};
|
};
|
||||||
|
|
||||||
for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++)
|
for (i = 0; i < ARRAY_SIZE(program_seq); i++)
|
||||||
outb_p(program_seq[i].value, base_addr +
|
outb_p(program_seq[i].value, base_addr +
|
||||||
program_seq[i].offset);
|
program_seq[i].offset);
|
||||||
|
|
||||||
|
|
|
@ -307,7 +307,7 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
|
||||||
{0x00, EN0_RSARHI},
|
{0x00, EN0_RSARHI},
|
||||||
{E8390_RREAD+E8390_START, E8390_CMD},
|
{E8390_RREAD+E8390_START, E8390_CMD},
|
||||||
};
|
};
|
||||||
for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++)
|
for (i = 0; i < ARRAY_SIZE(program_seq); i++)
|
||||||
outb(program_seq[i].value, ioaddr + program_seq[i].offset);
|
outb(program_seq[i].value, ioaddr + program_seq[i].offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1119,7 +1119,7 @@ static const struct netxen_brdinfo netxen_boards[] = {
|
||||||
{NETXEN_BRDTYPE_P2_SB31_2G, 2, "Dual Gb"},
|
{NETXEN_BRDTYPE_P2_SB31_2G, 2, "Dual Gb"},
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(struct netxen_brdinfo))
|
#define NUM_SUPPORTED_BOARDS ARRAY_SIZE(netxen_boards)
|
||||||
|
|
||||||
static inline void get_brd_port_by_type(u32 type, int *ports)
|
static inline void get_brd_port_by_type(u32 type, int *ports)
|
||||||
{
|
{
|
||||||
|
|
|
@ -569,7 +569,7 @@ int netxen_is_flash_supported(struct netxen_adapter *adapter)
|
||||||
/* if the flash size less than 4Mb, make huge war cry and die */
|
/* if the flash size less than 4Mb, make huge war cry and die */
|
||||||
for (j = 1; j < 4; j++) {
|
for (j = 1; j < 4; j++) {
|
||||||
addr = j * NETXEN_NIC_WINDOW_MARGIN;
|
addr = j * NETXEN_NIC_WINDOW_MARGIN;
|
||||||
for (i = 0; i < (sizeof(locs) / sizeof(locs[0])); i++) {
|
for (i = 0; i < ARRAY_SIZE(locs); i++) {
|
||||||
if (netxen_rom_fast_read(adapter, locs[i], &val01) == 0
|
if (netxen_rom_fast_read(adapter, locs[i], &val01) == 0
|
||||||
&& netxen_rom_fast_read(adapter, (addr + locs[i]),
|
&& netxen_rom_fast_read(adapter, (addr + locs[i]),
|
||||||
&val02) == 0) {
|
&val02) == 0) {
|
||||||
|
|
|
@ -232,7 +232,7 @@ static int get_prom(struct pcmcia_device *link)
|
||||||
axnet_reset_8390(dev);
|
axnet_reset_8390(dev);
|
||||||
mdelay(10);
|
mdelay(10);
|
||||||
|
|
||||||
for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++)
|
for (i = 0; i < ARRAY_SIZE(program_seq); i++)
|
||||||
outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
|
outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
|
||||||
|
|
||||||
for (i = 0; i < 6; i += 2) {
|
for (i = 0; i < 6; i += 2) {
|
||||||
|
|
|
@ -207,7 +207,7 @@ static hw_info_t hw_info[] = {
|
||||||
{ /* PCMCIA Technology OEM */ 0x01c8, 0x00, 0xa0, 0x0c, 0 }
|
{ /* PCMCIA Technology OEM */ 0x01c8, 0x00, 0xa0, 0x0c, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NR_INFO (sizeof(hw_info)/sizeof(hw_info_t))
|
#define NR_INFO ARRAY_SIZE(hw_info)
|
||||||
|
|
||||||
static hw_info_t default_info = { 0, 0, 0, 0, 0 };
|
static hw_info_t default_info = { 0, 0, 0, 0, 0 };
|
||||||
static hw_info_t dl10019_info = { 0, 0, 0, 0, IS_DL10019|HAS_MII };
|
static hw_info_t dl10019_info = { 0, 0, 0, 0, IS_DL10019|HAS_MII };
|
||||||
|
@ -374,7 +374,7 @@ static hw_info_t *get_prom(struct pcmcia_device *link)
|
||||||
pcnet_reset_8390(dev);
|
pcnet_reset_8390(dev);
|
||||||
mdelay(10);
|
mdelay(10);
|
||||||
|
|
||||||
for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++)
|
for (i = 0; i < ARRAY_SIZE(program_seq); i++)
|
||||||
outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
|
outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
|
||||||
|
|
||||||
for (i = 0; i < 32; i++)
|
for (i = 0; i < 32; i++)
|
||||||
|
|
|
@ -204,7 +204,7 @@ static const struct phy_setting settings[] = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MAX_NUM_SETTINGS (sizeof(settings)/sizeof(struct phy_setting))
|
#define MAX_NUM_SETTINGS ARRAY_SIZE(settings)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* phy_find_setting - find a PHY settings array entry that matches speed & duplex
|
* phy_find_setting - find a PHY settings array entry that matches speed & duplex
|
||||||
|
|
|
@ -1654,7 +1654,7 @@ static const struct smt_pdef {
|
||||||
{ SMT_P4053, 0, SWAP_SMT_P4053 } ,
|
{ SMT_P4053, 0, SWAP_SMT_P4053 } ,
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
#define N_SMT_PLEN (sizeof(smt_pdef)/sizeof(smt_pdef[0]))
|
#define N_SMT_PLEN ARRAY_SIZE(smt_pdef)
|
||||||
|
|
||||||
int smt_check_para(struct s_smc *smc, struct smt_header *sm,
|
int smt_check_para(struct s_smc *smc, struct smt_header *sm,
|
||||||
const u_short list[])
|
const u_short list[])
|
||||||
|
|
|
@ -43,7 +43,7 @@ static void clear_reported(struct s_smc *smc);
|
||||||
static void smt_send_srf(struct s_smc *smc);
|
static void smt_send_srf(struct s_smc *smc);
|
||||||
static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index);
|
static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index);
|
||||||
|
|
||||||
#define MAX_EVCS (sizeof(smc->evcs)/sizeof(smc->evcs[0]))
|
#define MAX_EVCS ARRAY_SIZE(smc->evcs)
|
||||||
|
|
||||||
struct evc_init {
|
struct evc_init {
|
||||||
u_char code ;
|
u_char code ;
|
||||||
|
@ -67,7 +67,7 @@ static const struct evc_init evc_inits[] = {
|
||||||
{ SMT_EVENT_PORT_PATH_CHANGE, INDEX_PORT,NUMPHYS,SMT_P4053 } ,
|
{ SMT_EVENT_PORT_PATH_CHANGE, INDEX_PORT,NUMPHYS,SMT_P4053 } ,
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
#define MAX_INIT_EVC (sizeof(evc_inits)/sizeof(evc_inits[0]))
|
#define MAX_INIT_EVC ARRAY_SIZE(evc_inits)
|
||||||
|
|
||||||
void smt_init_evc(struct s_smc *smc)
|
void smt_init_evc(struct s_smc *smc)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3945,7 +3945,7 @@ create_packet(struct net_device *dev, char *frame, int len)
|
||||||
static int
|
static int
|
||||||
EISA_signature(char *name, struct device *device)
|
EISA_signature(char *name, struct device *device)
|
||||||
{
|
{
|
||||||
int i, status = 0, siglen = sizeof(de4x5_signatures)/sizeof(c_char *);
|
int i, status = 0, siglen = ARRAY_SIZE(de4x5_signatures);
|
||||||
struct eisa_device *edev;
|
struct eisa_device *edev;
|
||||||
|
|
||||||
*name = '\0';
|
*name = '\0';
|
||||||
|
@ -3966,7 +3966,7 @@ EISA_signature(char *name, struct device *device)
|
||||||
static int
|
static int
|
||||||
PCI_signature(char *name, struct de4x5_private *lp)
|
PCI_signature(char *name, struct de4x5_private *lp)
|
||||||
{
|
{
|
||||||
int i, status = 0, siglen = sizeof(de4x5_signatures)/sizeof(c_char *);
|
int i, status = 0, siglen = ARRAY_SIZE(de4x5_signatures);
|
||||||
|
|
||||||
if (lp->chipset == DC21040) {
|
if (lp->chipset == DC21040) {
|
||||||
strcpy(name, "DE434/5");
|
strcpy(name, "DE434/5");
|
||||||
|
@ -5072,7 +5072,7 @@ mii_get_phy(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct de4x5_private *lp = netdev_priv(dev);
|
struct de4x5_private *lp = netdev_priv(dev);
|
||||||
u_long iobase = dev->base_addr;
|
u_long iobase = dev->base_addr;
|
||||||
int i, j, k, n, limit=sizeof(phy_info)/sizeof(struct phy_table);
|
int i, j, k, n, limit=ARRAY_SIZE(phy_info);
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
lp->active = 0;
|
lp->active = 0;
|
||||||
|
|
|
@ -7578,9 +7578,9 @@ static const iw_handler airo_private_handler[] =
|
||||||
|
|
||||||
static const struct iw_handler_def airo_handler_def =
|
static const struct iw_handler_def airo_handler_def =
|
||||||
{
|
{
|
||||||
.num_standard = sizeof(airo_handler)/sizeof(iw_handler),
|
.num_standard = ARRAY_SIZE(airo_handler),
|
||||||
.num_private = sizeof(airo_private_handler)/sizeof(iw_handler),
|
.num_private = ARRAY_SIZE(airo_private_handler),
|
||||||
.num_private_args = sizeof(airo_private_args)/sizeof(struct iw_priv_args),
|
.num_private_args = ARRAY_SIZE(airo_private_args),
|
||||||
.standard = airo_handler,
|
.standard = airo_handler,
|
||||||
.private = airo_private_handler,
|
.private = airo_private_handler,
|
||||||
.private_args = airo_private_args,
|
.private_args = airo_private_args,
|
||||||
|
|
|
@ -3976,9 +3976,9 @@ static const iw_handler prism2_private_handler[] =
|
||||||
|
|
||||||
const struct iw_handler_def hostap_iw_handler_def =
|
const struct iw_handler_def hostap_iw_handler_def =
|
||||||
{
|
{
|
||||||
.num_standard = sizeof(prism2_handler) / sizeof(iw_handler),
|
.num_standard = ARRAY_SIZE(prism2_handler),
|
||||||
.num_private = sizeof(prism2_private_handler) / sizeof(iw_handler),
|
.num_private = ARRAY_SIZE(prism2_private_handler),
|
||||||
.num_private_args = sizeof(prism2_priv) / sizeof(struct iw_priv_args),
|
.num_private_args = ARRAY_SIZE(prism2_priv),
|
||||||
.standard = (iw_handler *) prism2_handler,
|
.standard = (iw_handler *) prism2_handler,
|
||||||
.private = (iw_handler *) prism2_private_handler,
|
.private = (iw_handler *) prism2_private_handler,
|
||||||
.private_args = (struct iw_priv_args *) prism2_priv,
|
.private_args = (struct iw_priv_args *) prism2_priv,
|
||||||
|
|
|
@ -8277,10 +8277,9 @@ static struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device *dev)
|
||||||
|
|
||||||
static struct iw_handler_def ipw2100_wx_handler_def = {
|
static struct iw_handler_def ipw2100_wx_handler_def = {
|
||||||
.standard = ipw2100_wx_handlers,
|
.standard = ipw2100_wx_handlers,
|
||||||
.num_standard = sizeof(ipw2100_wx_handlers) / sizeof(iw_handler),
|
.num_standard = ARRAY_SIZE(ipw2100_wx_handlers),
|
||||||
.num_private = sizeof(ipw2100_private_handler) / sizeof(iw_handler),
|
.num_private = ARRAY_SIZE(ipw2100_private_handler),
|
||||||
.num_private_args = sizeof(ipw2100_private_args) /
|
.num_private_args = ARRAY_SIZE(ipw2100_private_args),
|
||||||
sizeof(struct iw_priv_args),
|
|
||||||
.private = (iw_handler *) ipw2100_private_handler,
|
.private = (iw_handler *) ipw2100_private_handler,
|
||||||
.private_args = (struct iw_priv_args *)ipw2100_private_args,
|
.private_args = (struct iw_priv_args *)ipw2100_private_args,
|
||||||
.get_wireless_stats = ipw2100_wx_wireless_stats,
|
.get_wireless_stats = ipw2100_wx_wireless_stats,
|
||||||
|
|
|
@ -123,28 +123,28 @@ struct region_cfp_table {
|
||||||
static struct region_cfp_table region_cfp_table[] = {
|
static struct region_cfp_table region_cfp_table[] = {
|
||||||
{0x10, /*US FCC */
|
{0x10, /*US FCC */
|
||||||
channel_freq_power_US_BG,
|
channel_freq_power_US_BG,
|
||||||
sizeof(channel_freq_power_US_BG) / sizeof(struct chan_freq_power),
|
ARRAY_SIZE(channel_freq_power_US_BG),
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{0x20, /*CANADA IC */
|
{0x20, /*CANADA IC */
|
||||||
channel_freq_power_US_BG,
|
channel_freq_power_US_BG,
|
||||||
sizeof(channel_freq_power_US_BG) / sizeof(struct chan_freq_power),
|
ARRAY_SIZE(channel_freq_power_US_BG),
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{0x30, /*EU*/ channel_freq_power_EU_BG,
|
{0x30, /*EU*/ channel_freq_power_EU_BG,
|
||||||
sizeof(channel_freq_power_EU_BG) / sizeof(struct chan_freq_power),
|
ARRAY_SIZE(channel_freq_power_EU_BG),
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{0x31, /*SPAIN*/ channel_freq_power_SPN_BG,
|
{0x31, /*SPAIN*/ channel_freq_power_SPN_BG,
|
||||||
sizeof(channel_freq_power_SPN_BG) / sizeof(struct chan_freq_power),
|
ARRAY_SIZE(channel_freq_power_SPN_BG),
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{0x32, /*FRANCE*/ channel_freq_power_FR_BG,
|
{0x32, /*FRANCE*/ channel_freq_power_FR_BG,
|
||||||
sizeof(channel_freq_power_FR_BG) / sizeof(struct chan_freq_power),
|
ARRAY_SIZE(channel_freq_power_FR_BG),
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{0x40, /*JAPAN*/ channel_freq_power_JPN_BG,
|
{0x40, /*JAPAN*/ channel_freq_power_JPN_BG,
|
||||||
sizeof(channel_freq_power_JPN_BG) / sizeof(struct chan_freq_power),
|
ARRAY_SIZE(channel_freq_power_JPN_BG),
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
/*Add new region here */
|
/*Add new region here */
|
||||||
|
@ -1422,7 +1422,7 @@ struct chan_freq_power *libertas_get_region_cfp_table(u8 region, u8 band, int *c
|
||||||
|
|
||||||
lbs_deb_enter(LBS_DEB_MAIN);
|
lbs_deb_enter(LBS_DEB_MAIN);
|
||||||
|
|
||||||
end = sizeof(region_cfp_table)/sizeof(struct region_cfp_table);
|
end = ARRAY_SIZE(region_cfp_table);
|
||||||
|
|
||||||
for (i = 0; i < end ; i++) {
|
for (i = 0; i < end ; i++) {
|
||||||
lbs_deb_main("region_cfp_table[i].region=%d\n",
|
lbs_deb_main("region_cfp_table[i].region=%d\n",
|
||||||
|
|
|
@ -2149,13 +2149,13 @@ static const iw_handler mesh_wlan_handler[] = {
|
||||||
(iw_handler) NULL, /* SIOCSIWPMKSA */
|
(iw_handler) NULL, /* SIOCSIWPMKSA */
|
||||||
};
|
};
|
||||||
struct iw_handler_def libertas_handler_def = {
|
struct iw_handler_def libertas_handler_def = {
|
||||||
.num_standard = sizeof(wlan_handler) / sizeof(iw_handler),
|
.num_standard = ARRAY_SIZE(wlan_handler),
|
||||||
.standard = (iw_handler *) wlan_handler,
|
.standard = (iw_handler *) wlan_handler,
|
||||||
.get_wireless_stats = wlan_get_wireless_stats,
|
.get_wireless_stats = wlan_get_wireless_stats,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iw_handler_def mesh_handler_def = {
|
struct iw_handler_def mesh_handler_def = {
|
||||||
.num_standard = sizeof(mesh_wlan_handler) / sizeof(iw_handler),
|
.num_standard = ARRAY_SIZE(mesh_wlan_handler),
|
||||||
.standard = (iw_handler *) mesh_wlan_handler,
|
.standard = (iw_handler *) mesh_wlan_handler,
|
||||||
.get_wireless_stats = wlan_get_wireless_stats,
|
.get_wireless_stats = wlan_get_wireless_stats,
|
||||||
};
|
};
|
||||||
|
|
|
@ -709,9 +709,9 @@ static const iw_handler netwave_private_handler[] =
|
||||||
|
|
||||||
static const struct iw_handler_def netwave_handler_def =
|
static const struct iw_handler_def netwave_handler_def =
|
||||||
{
|
{
|
||||||
.num_standard = sizeof(netwave_handler)/sizeof(iw_handler),
|
.num_standard = ARRAY_SIZE(netwave_handler),
|
||||||
.num_private = sizeof(netwave_private_handler)/sizeof(iw_handler),
|
.num_private = ARRAY_SIZE(netwave_private_handler),
|
||||||
.num_private_args = sizeof(netwave_private_args)/sizeof(struct iw_priv_args),
|
.num_private_args = ARRAY_SIZE(netwave_private_args),
|
||||||
.standard = (iw_handler *) netwave_handler,
|
.standard = (iw_handler *) netwave_handler,
|
||||||
.private = (iw_handler *) netwave_private_handler,
|
.private = (iw_handler *) netwave_private_handler,
|
||||||
.private_args = (struct iw_priv_args *) netwave_private_args,
|
.private_args = (struct iw_priv_args *) netwave_private_args,
|
||||||
|
|
|
@ -3239,10 +3239,9 @@ static const iw_handler prism54_private_handler[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct iw_handler_def prism54_handler_def = {
|
const struct iw_handler_def prism54_handler_def = {
|
||||||
.num_standard = sizeof (prism54_handler) / sizeof (iw_handler),
|
.num_standard = ARRAY_SIZE(prism54_handler),
|
||||||
.num_private = sizeof (prism54_private_handler) / sizeof (iw_handler),
|
.num_private = ARRAY_SIZE(prism54_private_handler),
|
||||||
.num_private_args =
|
.num_private_args = ARRAY_SIZE(prism54_private_args),
|
||||||
sizeof (prism54_private_args) / sizeof (struct iw_priv_args),
|
|
||||||
.standard = (iw_handler *) prism54_handler,
|
.standard = (iw_handler *) prism54_handler,
|
||||||
.private = (iw_handler *) prism54_private_handler,
|
.private = (iw_handler *) prism54_private_handler,
|
||||||
.private_args = (struct iw_priv_args *) prism54_private_args,
|
.private_args = (struct iw_priv_args *) prism54_private_args,
|
||||||
|
|
|
@ -1567,9 +1567,9 @@ static const struct iw_priv_args ray_private_args[] = {
|
||||||
|
|
||||||
static const struct iw_handler_def ray_handler_def =
|
static const struct iw_handler_def ray_handler_def =
|
||||||
{
|
{
|
||||||
.num_standard = sizeof(ray_handler)/sizeof(iw_handler),
|
.num_standard = ARRAY_SIZE(ray_handler),
|
||||||
.num_private = sizeof(ray_private_handler)/sizeof(iw_handler),
|
.num_private = ARRAY_SIZE(ray_private_handler),
|
||||||
.num_private_args = sizeof(ray_private_args)/sizeof(struct iw_priv_args),
|
.num_private_args = ARRAY_SIZE(ray_private_args),
|
||||||
.standard = ray_handler,
|
.standard = ray_handler,
|
||||||
.private = ray_private_handler,
|
.private = ray_private_handler,
|
||||||
.private_args = ray_private_args,
|
.private_args = ray_private_args,
|
||||||
|
|
|
@ -2400,9 +2400,9 @@ static const struct iw_priv_args wavelan_private_args[] = {
|
||||||
|
|
||||||
static const struct iw_handler_def wavelan_handler_def =
|
static const struct iw_handler_def wavelan_handler_def =
|
||||||
{
|
{
|
||||||
.num_standard = sizeof(wavelan_handler)/sizeof(iw_handler),
|
.num_standard = ARRAY_SIZE(wavelan_handler),
|
||||||
.num_private = sizeof(wavelan_private_handler)/sizeof(iw_handler),
|
.num_private = ARRAY_SIZE(wavelan_private_handler),
|
||||||
.num_private_args = sizeof(wavelan_private_args)/sizeof(struct iw_priv_args),
|
.num_private_args = ARRAY_SIZE(wavelan_private_args),
|
||||||
.standard = wavelan_handler,
|
.standard = wavelan_handler,
|
||||||
.private = wavelan_private_handler,
|
.private = wavelan_private_handler,
|
||||||
.private_args = wavelan_private_args,
|
.private_args = wavelan_private_args,
|
||||||
|
|
|
@ -2719,9 +2719,9 @@ static const iw_handler wavelan_private_handler[] =
|
||||||
|
|
||||||
static const struct iw_handler_def wavelan_handler_def =
|
static const struct iw_handler_def wavelan_handler_def =
|
||||||
{
|
{
|
||||||
.num_standard = sizeof(wavelan_handler)/sizeof(iw_handler),
|
.num_standard = ARRAY_SIZE(wavelan_handler),
|
||||||
.num_private = sizeof(wavelan_private_handler)/sizeof(iw_handler),
|
.num_private = ARRAY_SIZE(wavelan_private_handler),
|
||||||
.num_private_args = sizeof(wavelan_private_args)/sizeof(struct iw_priv_args),
|
.num_private_args = ARRAY_SIZE(wavelan_private_args),
|
||||||
.standard = wavelan_handler,
|
.standard = wavelan_handler,
|
||||||
.private = wavelan_private_handler,
|
.private = wavelan_private_handler,
|
||||||
.private_args = wavelan_private_args,
|
.private_args = wavelan_private_args,
|
||||||
|
|
|
@ -1893,7 +1893,7 @@ static const iw_handler wl3501_handler[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct iw_handler_def wl3501_handler_def = {
|
static const struct iw_handler_def wl3501_handler_def = {
|
||||||
.num_standard = sizeof(wl3501_handler) / sizeof(iw_handler),
|
.num_standard = ARRAY_SIZE(wl3501_handler),
|
||||||
.standard = (iw_handler *)wl3501_handler,
|
.standard = (iw_handler *)wl3501_handler,
|
||||||
.get_wireless_stats = wl3501_get_wireless_stats,
|
.get_wireless_stats = wl3501_get_wireless_stats,
|
||||||
};
|
};
|
||||||
|
|
|
@ -190,7 +190,7 @@ static int __devinit zorro8390_init(struct net_device *dev,
|
||||||
{0x00, NE_EN0_RSARHI},
|
{0x00, NE_EN0_RSARHI},
|
||||||
{E8390_RREAD+E8390_START, NE_CMD},
|
{E8390_RREAD+E8390_START, NE_CMD},
|
||||||
};
|
};
|
||||||
for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++) {
|
for (i = 0; i < ARRAY_SIZE(program_seq); i++) {
|
||||||
z_writeb(program_seq[i].value, ioaddr + program_seq[i].offset);
|
z_writeb(program_seq[i].value, ioaddr + program_seq[i].offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue