提交 19fab6fe 编写于 作者: M Markus Elfring 提交者: 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: NMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册