[media] i2c: Improve a size determination

Replace the specification of a data structure by pointer dereferences
as the parameter for the operator "sizeof" to make size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

[mchehab@s-opensource.com: merged similar patches]
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Markus Elfring 2017-09-02 11:09:35 -03:00 committed by Mauro Carvalho Chehab
parent 0fd5843589
commit 19fab6fe67
3 changed files with 3 additions and 3 deletions

View File

@ -1097,7 +1097,7 @@ static int ov2640_probe(struct i2c_client *client,
return -EIO;
}
priv = devm_kzalloc(&client->dev, sizeof(struct ov2640_priv), GFP_KERNEL);
priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;

View File

@ -675,7 +675,7 @@ static int ov9640_probe(struct i2c_client *client,
return -EINVAL;
}
priv = devm_kzalloc(&client->dev, sizeof(struct ov9640_priv), GFP_KERNEL);
priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;

View File

@ -935,7 +935,7 @@ static int ov9740_probe(struct i2c_client *client,
return -EINVAL;
}
priv = devm_kzalloc(&client->dev, sizeof(struct ov9740_priv), GFP_KERNEL);
priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;