]> err.no Git - linux-2.6/blobdiff - drivers/net/wireless/prism54/oid_mgt.c
Merge branch 'linus' into xen-64bit
[linux-2.6] / drivers / net / wireless / prism54 / oid_mgt.c
index eea2f04c8c6d4149b7a85b50f5f5390358eb8d66..57a4ac34bed6cd2eefcb9034ae5a85ec75bfc642 100644 (file)
@@ -1,4 +1,4 @@
-/*   
+/*
  *  Copyright (C) 2003,2004 Aurelien Alleaume <slts@free.fr>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -16,6 +16,8 @@
  *
  */
 
+#include <linux/kernel.h>
+
 #include "prismcompat.h"
 #include "islpci_dev.h"
 #include "islpci_mgt.h"
@@ -235,22 +237,18 @@ mgt_init(islpci_private *priv)
 {
        int i;
 
-       priv->mib = kmalloc(OID_NUM_LAST * sizeof (void *), GFP_KERNEL);
+       priv->mib = kcalloc(OID_NUM_LAST, sizeof (void *), GFP_KERNEL);
        if (!priv->mib)
                return -ENOMEM;
 
-       memset(priv->mib, 0, OID_NUM_LAST * sizeof (void *));
-
        /* Alloc the cache */
        for (i = 0; i < OID_NUM_LAST; i++) {
                if (isl_oid[i].flags & OID_FLAG_CACHED) {
-                       priv->mib[i] = kmalloc(isl_oid[i].size *
+                       priv->mib[i] = kzalloc(isl_oid[i].size *
                                               (isl_oid[i].range + 1),
                                               GFP_KERNEL);
                        if (!priv->mib[i])
                                return -ENOMEM;
-                       memset(priv->mib[i], 0,
-                              isl_oid[i].size * (isl_oid[i].range + 1));
                } else
                        priv->mib[i] = NULL;
        }
@@ -332,7 +330,7 @@ mgt_le_to_cpu(int type, void *data)
        case OID_TYPE_ATTACH:{
                        struct obj_attachment *attach = data;
                        attach->id = le16_to_cpu(attach->id);
-                       attach->size = le16_to_cpu(attach->size);
+                       attach->size = le16_to_cpu(attach->size);
                        break;
        }
        case OID_TYPE_SSID:
@@ -401,7 +399,7 @@ mgt_cpu_to_le(int type, void *data)
        case OID_TYPE_ATTACH:{
                        struct obj_attachment *attach = data;
                        attach->id = cpu_to_le16(attach->id);
-                       attach->size = cpu_to_le16(attach->size);
+                       attach->size = cpu_to_le16(attach->size);
                        break;
        }
        case OID_TYPE_SSID:
@@ -503,7 +501,7 @@ mgt_set_varlen(islpci_private *priv, enum oid_num_t n, void *data, int extra_len
                }
                if (ret || response_op == PIMFOR_OP_ERROR)
                        ret = -EIO;
-       } else 
+       } else
                ret = -EIO;
 
        /* re-set given data to what it was */
@@ -694,7 +692,7 @@ mgt_update_addr(islpci_private *priv)
        return ret;
 }
 
-#define VEC_SIZE(a) (sizeof(a)/sizeof(a[0]))
+#define VEC_SIZE(a) ARRAY_SIZE(a)
 
 int
 mgt_commit(islpci_private *priv)
@@ -727,7 +725,7 @@ mgt_commit(islpci_private *priv)
  * MEDIUMLIMIT,BEACONPERIOD,DTIMPERIOD,ATIMWINDOW,LISTENINTERVAL
  * FREQUENCY,EXTENDEDRATES.
  *
- * The way to do this is to set ESSID. Note though that they may get 
+ * The way to do this is to set ESSID. Note though that they may get
  * unlatch before though by setting another OID. */
 #if 0
 void