usb: chipidea: udc: Use the preferred form for passing a size of a struct
authorFabio Estevam <fabio.estevam@nxp.com>
Thu, 8 Sep 2016 12:34:32 +0000 (09:34 -0300)
committerPeter Chen <peter.chen@nxp.com>
Wed, 14 Sep 2016 02:58:13 +0000 (10:58 +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 to improve readability.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
drivers/usb/chipidea/udc.c

index 22534a1622d94b123956525d3a80a19a6ee13b23..661f43fe0f9e9e8f9d9be29eaed5bb1307b8df54 100644 (file)
@@ -1993,7 +1993,7 @@ int ci_hdrc_gadget_init(struct ci_hdrc *ci)
        if (!hw_read(ci, CAP_DCCPARAMS, DCCPARAMS_DC))
                return -ENXIO;
 
-       rdrv = devm_kzalloc(ci->dev, sizeof(struct ci_role_driver), GFP_KERNEL);
+       rdrv = devm_kzalloc(ci->dev, sizeof(*rdrv), GFP_KERNEL);
        if (!rdrv)
                return -ENOMEM;