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:

committed by
Mauro Carvalho Chehab

parent
d303b7c5b2
commit
2d3da59ff1
@@ -3467,7 +3467,7 @@ static int adv7842_probe(struct i2c_client *client,
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
state = devm_kzalloc(&client->dev, sizeof(struct adv7842_state), GFP_KERNEL);
|
||||
state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL);
|
||||
if (!state)
|
||||
return -ENOMEM;
|
||||
|
||||
|
Reference in New Issue
Block a user