media: drivers: improve a size determination

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

This issue was detected by using the Coccinelle software.

[mchehab@s-opensoure.com: merge similar patches into one]

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
This commit is contained in:
Markus Elfring
2017-08-28 05:55:16 -04:00
committed by Mauro Carvalho Chehab
parent d303b7c5b2
commit 2d3da59ff1
17 changed files with 23 additions and 26 deletions

View File

@@ -381,7 +381,7 @@ static int sp2_probe(struct i2c_client *client,
dev_dbg(&client->dev, "\n");
s = kzalloc(sizeof(struct sp2), GFP_KERNEL);
s = kzalloc(sizeof(*s), GFP_KERNEL);
if (!s) {
ret = -ENOMEM;
goto err;