From 19fab6fe67d815eb90095e21e3273a1fbe0c8fd9 Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Sat, 2 Sep 2017 11:09:35 -0300 Subject: [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 Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/ov2640.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/i2c/ov2640.c') diff --git a/drivers/media/i2c/ov2640.c b/drivers/media/i2c/ov2640.c index c0d0c50f1d02..cc3882c1e10e 100644 --- a/drivers/media/i2c/ov2640.c +++ b/drivers/media/i2c/ov2640.c @@ -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; -- cgit v1.2.3