aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAhmed S. Darwish <darwish.07@gmail.com>2007-02-05 11:56:22 -0500
committerJohn W. Linville <linville@tuxdriver.com>2007-02-14 15:45:04 -0500
commit22d574324939d62f625095913dd3df526ecaa0c8 (patch)
treedca8da3a21ff1ca68c19b43fd09e4762665ad1fe /drivers
parent6e6812d6df5fc502878b94a08ecf1a5f3fcfb030 (diff)
[PATCH] ipw2100: Use ARRAY_SIZE macro when appropriate
A patch to use ARRAY_SIZE macro already defined in kernel.h. Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ipw2100.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index d0639a45cd2c..ad6e4a428355 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -2888,7 +2888,7 @@ static int __ipw2100_tx_process(struct ipw2100_priv *priv)
2888 2888
2889#ifdef CONFIG_IPW2100_DEBUG 2889#ifdef CONFIG_IPW2100_DEBUG
2890 if (packet->info.c_struct.cmd->host_command_reg < 2890 if (packet->info.c_struct.cmd->host_command_reg <
2891 sizeof(command_types) / sizeof(*command_types)) 2891 ARRAY_SIZE(command_types))
2892 IPW_DEBUG_TX("Command '%s (%d)' processed: %d.\n", 2892 IPW_DEBUG_TX("Command '%s (%d)' processed: %d.\n",
2893 command_types[packet->info.c_struct.cmd-> 2893 command_types[packet->info.c_struct.cmd->
2894 host_command_reg], 2894 host_command_reg],
@@ -3736,7 +3736,7 @@ static ssize_t show_registers(struct device *d, struct device_attribute *attr,
3736 3736
3737 out += sprintf(out, "%30s [Address ] : Hex\n", "Register"); 3737 out += sprintf(out, "%30s [Address ] : Hex\n", "Register");
3738 3738
3739 for (i = 0; i < (sizeof(hw_data) / sizeof(*hw_data)); i++) { 3739 for (i = 0; i < ARRAY_SIZE(hw_data); i++) {
3740 read_register(dev, hw_data[i].addr, &val); 3740 read_register(dev, hw_data[i].addr, &val);
3741 out += sprintf(out, "%30s [%08X] : %08X\n", 3741 out += sprintf(out, "%30s [%08X] : %08X\n",
3742 hw_data[i].name, hw_data[i].addr, val); 3742 hw_data[i].name, hw_data[i].addr, val);
@@ -3757,7 +3757,7 @@ static ssize_t show_hardware(struct device *d, struct device_attribute *attr,
3757 3757
3758 out += sprintf(out, "%30s [Address ] : Hex\n", "NIC entry"); 3758 out += sprintf(out, "%30s [Address ] : Hex\n", "NIC entry");
3759 3759
3760 for (i = 0; i < (sizeof(nic_data) / sizeof(*nic_data)); i++) { 3760 for (i = 0; i < ARRAY_SIZE(nic_data); i++) {
3761 u8 tmp8; 3761 u8 tmp8;
3762 u16 tmp16; 3762 u16 tmp16;
3763 u32 tmp32; 3763 u32 tmp32;
@@ -3894,13 +3894,11 @@ static ssize_t show_ordinals(struct device *d, struct device_attribute *attr,
3894 if (priv->status & STATUS_RF_KILL_MASK) 3894 if (priv->status & STATUS_RF_KILL_MASK)
3895 return 0; 3895 return 0;
3896 3896
3897 if (loop >= sizeof(ord_data) / sizeof(*ord_data)) 3897 if (loop >= ARRAY_SIZE(ord_data))
3898 loop = 0; 3898 loop = 0;
3899 3899
3900 /* sysfs provides us PAGE_SIZE buffer */ 3900 /* sysfs provides us PAGE_SIZE buffer */
3901 while (len < PAGE_SIZE - 128 && 3901 while (len < PAGE_SIZE - 128 && loop < ARRAY_SIZE(ord_data)) {
3902 loop < (sizeof(ord_data) / sizeof(*ord_data))) {
3903
3904 val_len = sizeof(u32); 3902 val_len = sizeof(u32);
3905 3903
3906 if (ipw2100_get_ordinal(priv, ord_data[loop].index, &val, 3904 if (ipw2100_get_ordinal(priv, ord_data[loop].index, &val,
@@ -6589,7 +6587,7 @@ static const long ipw2100_rates_11b[] = {
6589 11000000 6587 11000000
6590}; 6588};
6591 6589
6592#define RATE_COUNT (sizeof(ipw2100_rates_11b) / sizeof(ipw2100_rates_11b[0])) 6590#define RATE_COUNT ARRAY_SIZE(ipw2100_rates_11b)
6593 6591
6594static int ipw2100_wx_get_name(struct net_device *dev, 6592static int ipw2100_wx_get_name(struct net_device *dev,
6595 struct iw_request_info *info, 6593 struct iw_request_info *info,