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: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
parent
f56cad5fd6
commit
5f73f240a4
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user