axonram: Improve a size determination in axon_ram_probe()
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 3 Aug 2017 18:00:16 +0000 (20:00 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 1 Sep 2017 06:42:56 +0000 (16:42 +1000)
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: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/sysdev/axonram.c

index 89736bb..ae359d7 100644 (file)
@@ -191,7 +191,7 @@ static int axon_ram_probe(struct platform_device *device)
        dev_info(&device->dev, "Found memory controller on %pOF\n",
                        device->dev.of_node);
 
-       bank = kzalloc(sizeof(struct axon_ram_bank), GFP_KERNEL);
+       bank = kzalloc(sizeof(*bank), GFP_KERNEL);
        if (bank == NULL) {
                rc = -ENOMEM;
                goto failed;