summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>2019-04-12 00:00:53 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2019-04-18 08:54:06 +0200
commit5f73f240a4ffe49f596314312f1d3731d011e195 (patch)
tree43c9c744f3cf635bc50d62d367bc3ad18b746d94 /drivers/mtd
parentf56cad5fd6cd876d0cab9d13d9df7bebf6fddf59 (diff)
downloadlinux-5f73f240a4ffe49f596314312f1d3731d011e195.tar.bz2
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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/raw/meson_nand.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
index cb0b03e36a35..c1a6af57dab5 100644
--- a/drivers/mtd/nand/raw/meson_nand.c
+++ b/drivers/mtd/nand/raw/meson_nand.c
@@ -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;