Commit 5f73f240 authored by Martin Blumenstingl's avatar Martin Blumenstingl Committed by Miquel Raynal

mtd: rawnand: meson: use struct_size macro

Use the recently introduced struct_size macro instead of open-coding
it's logic.
No functional changes.
Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: default avatarLiang Yang <liang.yang@amlogic.com>
Acked-by: default avatarLiang Yang <liang.yang@amlogic.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent f56cad5f
......@@ -1242,8 +1242,7 @@ meson_nfc_nand_chip_init(struct device *dev,
return -EINVAL;
}
meson_chip = devm_kzalloc(dev,
sizeof(*meson_chip) + (nsels * sizeof(u8)),
meson_chip = devm_kzalloc(dev, struct_size(meson_chip, sels, nsels),
GFP_KERNEL);
if (!meson_chip)
return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment