mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-25 19:07:46 +00:00
mfd: abx500-core: Improve two size determinations in abx500_register_ops()
Replace the specification of two data structures by pointer dereferences 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 <elfring@users.sourceforge.net> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
parent
a5e20bfa25
commit
5053e3a338
@ -37,14 +37,12 @@ int abx500_register_ops(struct device *dev, struct abx500_ops *ops)
|
||||
{
|
||||
struct abx500_device_entry *dev_entry;
|
||||
|
||||
dev_entry = devm_kzalloc(dev,
|
||||
sizeof(struct abx500_device_entry),
|
||||
GFP_KERNEL);
|
||||
dev_entry = devm_kzalloc(dev, sizeof(*dev_entry), GFP_KERNEL);
|
||||
if (!dev_entry)
|
||||
return -ENOMEM;
|
||||
|
||||
dev_entry->dev = dev;
|
||||
memcpy(&dev_entry->ops, ops, sizeof(struct abx500_ops));
|
||||
memcpy(&dev_entry->ops, ops, sizeof(*ops));
|
||||
|
||||
list_add_tail(&dev_entry->list, &abx500_list);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user