summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-12-20 14:38:53 +0300
committerLinus Walleij <linus.walleij@linaro.org>2017-12-21 12:22:41 +0300
commitce8b8d70d4d8d6351be44a467a2b61096dfc7a47 (patch)
treefc6bf743a9e7aa667773c51309182b00b999f93d /drivers/pinctrl
parent419517f15df3a5ebaf5d05acfbc74be3f8377641 (diff)
downloadlinux-ce8b8d70d4d8d6351be44a467a2b61096dfc7a47.tar.xz
pinctrl: adi2: Improve a size determination in two functions
Replace the specification of data structures by variable references 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: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/pinctrl-adi2.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/pinctrl/pinctrl-adi2.c b/drivers/pinctrl/pinctrl-adi2.c
index aefaf5855089..094a451db2a2 100644
--- a/drivers/pinctrl/pinctrl-adi2.c
+++ b/drivers/pinctrl/pinctrl-adi2.c
@@ -827,9 +827,8 @@ static int adi_gpio_pint_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct resource *res;
- struct gpio_pint *pint;
+ struct gpio_pint *pint = devm_kzalloc(dev, sizeof(*pint), GFP_KERNEL);
- pint = devm_kzalloc(dev, sizeof(struct gpio_pint), GFP_KERNEL);
if (!pint)
return -ENOMEM;
@@ -943,7 +942,7 @@ static int adi_gpio_probe(struct platform_device *pdev)
if (!pdata)
return -EINVAL;
- port = devm_kzalloc(dev, sizeof(struct gpio_port), GFP_KERNEL);
+ port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
if (!port)
return -ENOMEM;