X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fwireless%2Fipw2100.c;h=d51daf87450f4e81711dbbedb588f9dd70cce8bf;hb=02a93208edec0d655c9f18613d830dc6afeda7d4;hp=d0639a45cd2c4fbc083695b2ed4a6bf657e4f9f4;hpb=cb4aaf46c0283dd79ab2e8b8b165c0bf13ab6194;p=powerpc.git diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index d0639a45cd..d51daf8745 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c @@ -28,8 +28,8 @@ Portions of this file are based on the Host AP project, Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen - - Copyright (c) 2002-2003, Jouni Malinen + + Copyright (c) 2002-2003, Jouni Malinen Portions of ipw2100_mod_firmware_load, ipw2100_do_mod_firmware_load, and ipw2100_fw_load are loosely based on drivers/sound/sound_firmware.c @@ -2416,8 +2416,9 @@ static void isr_rx(struct ipw2100_priv *priv, int i, #ifdef IPW2100_RX_DEBUG /* Make a copy of the frame so we can dump it to the logs if * ieee80211_rx fails */ - memcpy(packet_data, packet->skb->data, - min_t(u32, status->frame_size, IPW_RX_NIC_BUFFER_LENGTH)); + skb_copy_from_linear_data(packet->skb, packet_data, + min_t(u32, status->frame_size, + IPW_RX_NIC_BUFFER_LENGTH)); #endif if (!ieee80211_rx(priv->ieee, packet->skb, stats)) { @@ -2888,7 +2889,7 @@ static int __ipw2100_tx_process(struct ipw2100_priv *priv) #ifdef CONFIG_IPW2100_DEBUG if (packet->info.c_struct.cmd->host_command_reg < - sizeof(command_types) / sizeof(*command_types)) + ARRAY_SIZE(command_types)) IPW_DEBUG_TX("Command '%s (%d)' processed: %d.\n", command_types[packet->info.c_struct.cmd-> host_command_reg], @@ -3736,7 +3737,7 @@ static ssize_t show_registers(struct device *d, struct device_attribute *attr, out += sprintf(out, "%30s [Address ] : Hex\n", "Register"); - for (i = 0; i < (sizeof(hw_data) / sizeof(*hw_data)); i++) { + for (i = 0; i < ARRAY_SIZE(hw_data); i++) { read_register(dev, hw_data[i].addr, &val); out += sprintf(out, "%30s [%08X] : %08X\n", hw_data[i].name, hw_data[i].addr, val); @@ -3757,7 +3758,7 @@ static ssize_t show_hardware(struct device *d, struct device_attribute *attr, out += sprintf(out, "%30s [Address ] : Hex\n", "NIC entry"); - for (i = 0; i < (sizeof(nic_data) / sizeof(*nic_data)); i++) { + for (i = 0; i < ARRAY_SIZE(nic_data); i++) { u8 tmp8; u16 tmp16; u32 tmp32; @@ -3894,13 +3895,11 @@ static ssize_t show_ordinals(struct device *d, struct device_attribute *attr, if (priv->status & STATUS_RF_KILL_MASK) return 0; - if (loop >= sizeof(ord_data) / sizeof(*ord_data)) + if (loop >= ARRAY_SIZE(ord_data)) loop = 0; /* sysfs provides us PAGE_SIZE buffer */ - while (len < PAGE_SIZE - 128 && - loop < (sizeof(ord_data) / sizeof(*ord_data))) { - + while (len < PAGE_SIZE - 128 && loop < ARRAY_SIZE(ord_data)) { val_len = sizeof(u32); if (ipw2100_get_ordinal(priv, ord_data[loop].index, &val, @@ -6589,7 +6588,7 @@ static const long ipw2100_rates_11b[] = { 11000000 }; -#define RATE_COUNT (sizeof(ipw2100_rates_11b) / sizeof(ipw2100_rates_11b[0])) +#define RATE_COUNT ARRAY_SIZE(ipw2100_rates_11b) static int ipw2100_wx_get_name(struct net_device *dev, struct iw_request_info *info,