Merge branch 'for-2.6.22' of git://git.kernel.dk/data/git/linux-2.6-block
[powerpc.git] / drivers / net / wireless / ipw2100.c
index d0639a4..d51daf8 100644 (file)
@@ -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
-    <jkmaline@cc.hut.fi>
-  Copyright (c) 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
+    <j@w1.fi>
+  Copyright (c) 2002-2003, Jouni Malinen <j@w1.fi>
 
   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,