]> git.karo-electronics.de Git - linux-beck.git/blobdiff - drivers/net/wireless/ipw2x00/ipw2100.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[linux-beck.git] / drivers / net / wireless / ipw2x00 / ipw2100.c
index 7f0d98b885bc9248f0958de8c77eafdb942f6d85..16bbfa3189a59cb65998318c8dc06b90995ee6c5 100644 (file)
@@ -174,7 +174,7 @@ that only one external action is invoked at a time.
 #define DRV_DESCRIPTION        "Intel(R) PRO/Wireless 2100 Network Driver"
 #define DRV_COPYRIGHT  "Copyright(c) 2003-2006 Intel Corporation"
 
-struct pm_qos_request_list ipw2100_pm_qos_req;
+static struct pm_qos_request_list ipw2100_pm_qos_req;
 
 /* Debugging stuff */
 #ifdef CONFIG_IPW2100_DEBUG
@@ -1924,6 +1924,10 @@ static int ipw2100_net_init(struct net_device *dev)
                bg_band->channels =
                        kzalloc(geo->bg_channels *
                                sizeof(struct ieee80211_channel), GFP_KERNEL);
+               if (!bg_band->channels) {
+                       ipw2100_down(priv);
+                       return -ENOMEM;
+               }
                /* translate geo->bg to bg_band.channels */
                for (i = 0; i < geo->bg_channels; i++) {
                        bg_band->channels[i].band = IEEE80211_BAND_2GHZ;
@@ -3467,10 +3471,8 @@ static int ipw2100_msg_allocate(struct ipw2100_priv *priv)
        dma_addr_t p;
 
        priv->msg_buffers =
-           (struct ipw2100_tx_packet *)kmalloc(IPW_COMMAND_POOL_SIZE *
-                                               sizeof(struct
-                                                      ipw2100_tx_packet),
-                                               GFP_KERNEL);
+           kmalloc(IPW_COMMAND_POOL_SIZE * sizeof(struct ipw2100_tx_packet),
+                   GFP_KERNEL);
        if (!priv->msg_buffers) {
                printk(KERN_ERR DRV_NAME ": %s: PCI alloc failed for msg "
                       "buffers.\n", priv->net_dev->name);
@@ -4499,10 +4501,8 @@ static int ipw2100_tx_allocate(struct ipw2100_priv *priv)
        }
 
        priv->tx_buffers =
-           (struct ipw2100_tx_packet *)kmalloc(TX_PENDED_QUEUE_LENGTH *
-                                               sizeof(struct
-                                                      ipw2100_tx_packet),
-                                               GFP_ATOMIC);
+           kmalloc(TX_PENDED_QUEUE_LENGTH * sizeof(struct ipw2100_tx_packet),
+                   GFP_ATOMIC);
        if (!priv->tx_buffers) {
                printk(KERN_ERR DRV_NAME
                       ": %s: alloc failed form tx buffers.\n",
@@ -4651,9 +4651,9 @@ static int ipw2100_rx_allocate(struct ipw2100_priv *priv)
        /*
         * allocate packets
         */
-       priv->rx_buffers = (struct ipw2100_rx_packet *)
-           kmalloc(RX_QUEUE_LENGTH * sizeof(struct ipw2100_rx_packet),
-                   GFP_KERNEL);
+       priv->rx_buffers = kmalloc(RX_QUEUE_LENGTH *
+                                  sizeof(struct ipw2100_rx_packet),
+                                  GFP_KERNEL);
        if (!priv->rx_buffers) {
                IPW_DEBUG_INFO("can't allocate rx packet buffer table\n");
 
@@ -5233,7 +5233,7 @@ struct security_info_params {
        u8 auth_mode;
        u8 replay_counters_number;
        u8 unicast_using_group;
-} __attribute__ ((packed));
+} __packed;
 
 static int ipw2100_set_security_information(struct ipw2100_priv *priv,
                                            int auth_mode,
@@ -8475,7 +8475,7 @@ struct ipw2100_fw_header {
        short mode;
        unsigned int fw_size;
        unsigned int uc_size;
-} __attribute__ ((packed));
+} __packed;
 
 static int ipw2100_mod_firmware_load(struct ipw2100_fw *fw)
 {