ATM-nicstar: Improve another size determination in get_scq()
authorMarkus Elfring <elfring@users.sourceforge.net>
Sat, 10 Sep 2016 06:18:10 +0000 (08:18 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Sep 2016 04:45:24 +0000 (21:45 -0700)
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/atm/nicstar.c

index 50dec1349e14859d452ec71e397533eff495f290..96062e10c8eb6ee797839f70cb37473b456ba3a7 100644 (file)
@@ -862,7 +862,7 @@ static scq_info *get_scq(ns_dev *card, int size, u32 scd)
        if (size != VBR_SCQSIZE && size != CBR_SCQSIZE)
                return NULL;
 
-       scq = kmalloc(sizeof(scq_info), GFP_KERNEL);
+       scq = kmalloc(sizeof(*scq), GFP_KERNEL);
        if (!scq)
                return NULL;
         scq->org = dma_alloc_coherent(&card->pcidev->dev,