hwrng: mxc-rnga - Use the preferred format for kzalloc
authorFabio Estevam <fabio.estevam@freescale.com>
Sat, 12 Sep 2015 23:19:53 +0000 (20:19 -0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 21 Sep 2015 14:00:39 +0000 (22:00 +0800)
According to Documentation/CodingStyle:

"The preferred form for passing a size of a struct is the following:

p = kmalloc(sizeof(*p), ...);"

,so do as suggested.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/mxc-rnga.c

index ed2e3ef9f347952140368fbb0e1da1167ccb18bb..467362262651e61f836258d9783a7672a857c8a0 100644 (file)
@@ -145,8 +145,7 @@ static int __init mxc_rnga_probe(struct platform_device *pdev)
        struct resource *res;
        struct mxc_rng *mxc_rng;
 
-       mxc_rng = devm_kzalloc(&pdev->dev, sizeof(struct mxc_rng),
-                                       GFP_KERNEL);
+       mxc_rng = devm_kzalloc(&pdev->dev, sizeof(*mxc_rng), GFP_KERNEL);
        if (!mxc_rng)
                return -ENOMEM;