[PATCH] ARM26: Use ARRAY_SIZE macro when appropriate
[sfrench/cifs-2.6.git] / arch / arm26 / kernel / ecard.c
index 047d0a408b9deb25c10a9db2d32c144353ccf193..e2bcefc91cc30fe2001e01b6481003659cc64ddc 100644 (file)
@@ -215,7 +215,7 @@ int ecard_readchunk(struct in_chunk_dir *cd, ecard_t *ec, int id, int num)
                }
                if (c_id(&excd) == 0x80) { /* loader */
                        if (!ec->loader) {
-                               ec->loader = (loader_t)kmalloc(c_len(&excd),
+                               ec->loader = kmalloc(c_len(&excd),
                                                               GFP_KERNEL);
                                if (ec->loader)
                                        ecard_readbytes(ec->loader, ec,
@@ -620,12 +620,10 @@ ecard_probe(int slot, card_type_t type)
        struct ex_ecid cid;
        int i, rc = -ENOMEM;
 
-       ec = kmalloc(sizeof(ecard_t), GFP_KERNEL);
+       ec = kzalloc(sizeof(ecard_t), GFP_KERNEL);
        if (!ec)
                goto nomem;
 
-       memset(ec, 0, sizeof(ecard_t));
-
        ec->slot_no     = slot;
        ec->type        = type;
        ec->irq         = NO_IRQ;
@@ -667,7 +665,7 @@ ecard_probe(int slot, card_type_t type)
                ec->fiqmask = 4;
        }
 
-       for (i = 0; i < sizeof(blacklist) / sizeof(*blacklist); i++)
+       for (i = 0; i < ARRAY_SIZE(blacklist); i++)
                if (blacklist[i].manufacturer == ec->cid.manufacturer &&
                    blacklist[i].product == ec->cid.product) {
                        ec->card_desc = blacklist[i].type;