diff options
author | Martin Blumenstingl <martin.blumenstingl@googlemail.com> | 2019-04-12 00:00:53 +0200 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2019-04-18 08:54:06 +0200 |
commit | 5f73f240a4ffe49f596314312f1d3731d011e195 (patch) | |
tree | 43c9c744f3cf635bc50d62d367bc3ad18b746d94 /drivers/mtd/nand | |
parent | f56cad5fd6cd876d0cab9d13d9df7bebf6fddf59 (diff) | |
download | lwn-5f73f240a4ffe49f596314312f1d3731d011e195.tar.gz lwn-5f73f240a4ffe49f596314312f1d3731d011e195.zip |
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/nand')
-rw-r--r-- | drivers/mtd/nand/raw/meson_nand.c | 3 |
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; |