UPSTREAM: pinctrl: rockchip: Improve a size determination in rockchip_pinctrl_probe()

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.

This issue was detected by using the Coccinelle software.

Change-Id: Ic9e944a36fb8ed01a71c60922c949c00e6ecda48
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 283b7ac92b)
This commit is contained in:
Markus Elfring
2017-12-23 22:07:30 +01:00
committed by Tao Huang
parent e9db9f694e
commit 3598d8ec98

View File

@@ -3482,7 +3482,7 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
return -ENODEV;
}
info = devm_kzalloc(dev, sizeof(struct rockchip_pinctrl), GFP_KERNEL);
info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;