Re: [PATCH v2 17/25] mtd: nand: remove useless mtd->priv = chip assignments
From: Brian Norris
Date: Tue Dec 01 2015 - 17:17:56 EST
On Tue, Dec 01, 2015 at 12:03:14PM +0100, Boris Brezillon wrote:
> mtd_to_nand() now uses the container_of() approach to transform an
> mtd_info pointer into a nand_chip one. Drop useless mtd->priv
> assignments from NAND controller drivers.
>
> Signed-off-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxxxxxxx>
> ---
> Patch generated with the following coccinelle script:
>
> ---8<----
> virtual patch
>
> @@
> struct mtd_info m;
> struct mtd_info *mp;
> struct nand_chip *c;
> @@
> (
> -(m).priv = c;
> |
> -(mp)->priv = c;
> |
> -(mp)->priv = (void *)c;
> )
> ---8<----
> ---
...
> diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
> index 3f29734..ed4184c 100644
> --- a/drivers/mtd/nand/s3c2410.c
> +++ b/drivers/mtd/nand/s3c2410.c
> @@ -834,7 +834,6 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,
> chip->IO_ADDR_R = chip->IO_ADDR_W;
>
> nmtd->info = info;
> - mtd->priv = chip;
After this one, we have:
drivers/mtd/nand/s3c2410.c: In function âs3c2410_nand_init_chipâ:
drivers/mtd/nand/s3c2410.c:791:19: warning: unused variable âmtdâ [-Wunused-variable]
> nmtd->set = set;
>
> #ifdef CONFIG_MTD_NAND_S3C2410_HWECC
Brian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/