Skip to content

Commit

Permalink
mfd: smsc-ece1099: Improve a size determination in smsc_i2c_probe()
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Markus Elfring <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
  • Loading branch information
elfring authored and Lee Jones committed May 16, 2018
1 parent 4202151 commit 8349aeb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/mfd/smsc-ece1099.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ static int smsc_i2c_probe(struct i2c_client *i2c,
int devid, rev, venid_l, venid_h;
int ret;

smsc = devm_kzalloc(&i2c->dev, sizeof(struct smsc),
GFP_KERNEL);
smsc = devm_kzalloc(&i2c->dev, sizeof(*smsc), GFP_KERNEL);
if (!smsc)
return -ENOMEM;

Expand Down

0 comments on commit 8349aeb

Please sign in to comment.