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