[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <effed7e2-114d-75c3-186e-7f53b96f210d@amlogic.com>
Date: Mon, 15 Apr 2019 14:01:11 +0800
From: Liang Yang <liang.yang@...ogic.com>
To: Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
<linux-amlogic@...ts.infradead.org>,
<linux-mtd@...ts.infradead.org>, <richard@....at>,
<miquel.raynal@...tlin.com>
CC: <linux-arm-kernel@...ts.infradead.org>, <marek.vasut@...il.com>,
<linux-kernel@...r.kernel.org>, <computersforpeace@...il.com>,
<dwmw2@...radead.org>, <bbrezillon@...nel.org>,
<jianxin.pan@...ogic.com>
Subject: Re: [PATCH 1/4] mtd: rawnand: meson: use struct_size macro
Hello Martin and Miquel,
On 2019/4/12 6:00, Martin Blumenstingl wrote:
> Use the recently introduced struct_size macro instead of open-coding
> it's logic.
> No functional changes.
>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
> ---
> drivers/mtd/nand/raw/meson_nand.c | 3 +--
> 1 file changed, 1 insertion(+), 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);
Tested-by:Liang Yang <liang.yang@...ogic.com>
Acked-by: Liang Yang <liang.yang@...ogic.com>
> if (!meson_chip)
> return -ENOMEM;
>
Powered by blists - more mailing lists