Commit 19fab6fe authored by Markus Elfring's avatar Markus Elfring Committed by Mauro Carvalho Chehab

[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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 0fd58435
...@@ -1097,7 +1097,7 @@ static int ov2640_probe(struct i2c_client *client, ...@@ -1097,7 +1097,7 @@ static int ov2640_probe(struct i2c_client *client,
return -EIO; return -EIO;
} }
priv = devm_kzalloc(&client->dev, sizeof(struct ov2640_priv), GFP_KERNEL); priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
......
...@@ -675,7 +675,7 @@ static int ov9640_probe(struct i2c_client *client, ...@@ -675,7 +675,7 @@ static int ov9640_probe(struct i2c_client *client,
return -EINVAL; return -EINVAL;
} }
priv = devm_kzalloc(&client->dev, sizeof(struct ov9640_priv), GFP_KERNEL); priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
......
...@@ -935,7 +935,7 @@ static int ov9740_probe(struct i2c_client *client, ...@@ -935,7 +935,7 @@ static int ov9740_probe(struct i2c_client *client,
return -EINVAL; return -EINVAL;
} }
priv = devm_kzalloc(&client->dev, sizeof(struct ov9740_priv), GFP_KERNEL); priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment