Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;

+1 −1
Original line number Diff line number Diff line
@@ -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;

+1 −1
Original line number Diff line number Diff line
@@ -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;