Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;