浏览代码

usb: chipidea: udc: Use the preferred form for passing a size of a struct

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>
Fabio Estevam 9 年之前
父节点
当前提交
e74e837248
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/usb/chipidea/udc.c

+ 1 - 1
drivers/usb/chipidea/udc.c

@@ -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;