Re: [PATCH v2 17/25] mtd: nand: remove useless mtd->priv = chip assignments

2015-12-02 Thread Boris Brezillon
Hi Brian,

On Tue, 1 Dec 2015 14:17:47 -0800
Brian Norris  wrote:

> 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 
> > ---
> > 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]

I fixed all the warnings/errors you pointed in patch 12 and 17 and
resent a v3 only for those patches to avoid annoying all recipients
again. Let me know if you want me to resend the whole patchset.

Best Regards,

Boris

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 17/25] mtd: nand: remove useless mtd->priv = chip assignments

2015-12-01 Thread Brian Norris
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 
> ---
> 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-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 17/25] mtd: nand: remove useless mtd->priv = chip assignments

2015-12-01 Thread Boris Brezillon
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 
---
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<
---
 drivers/mtd/nand/ams-delta.c   | 3 ---
 drivers/mtd/nand/atmel_nand.c  | 1 -
 drivers/mtd/nand/au1550nd.c| 1 -
 drivers/mtd/nand/bcm47xxnflash/main.c  | 1 -
 drivers/mtd/nand/bf5xx_nand.c  | 1 -
 drivers/mtd/nand/brcmnand/brcmnand.c   | 1 -
 drivers/mtd/nand/cafe_nand.c   | 1 -
 drivers/mtd/nand/cmx270_nand.c | 1 -
 drivers/mtd/nand/cs553x_nand.c | 1 -
 drivers/mtd/nand/davinci_nand.c| 1 -
 drivers/mtd/nand/denali.c  | 1 -
 drivers/mtd/nand/diskonchip.c  | 1 -
 drivers/mtd/nand/docg4.c   | 1 -
 drivers/mtd/nand/fsl_elbc_nand.c   | 1 -
 drivers/mtd/nand/fsl_ifc_nand.c| 1 -
 drivers/mtd/nand/fsl_upm.c | 1 -
 drivers/mtd/nand/fsmc_nand.c   | 1 -
 drivers/mtd/nand/gpio.c| 1 -
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 1 -
 drivers/mtd/nand/hisi504_nand.c| 1 -
 drivers/mtd/nand/jz4740_nand.c | 1 -
 drivers/mtd/nand/lpc32xx_mlc.c | 1 -
 drivers/mtd/nand/lpc32xx_slc.c | 1 -
 drivers/mtd/nand/mpc5121_nfc.c | 1 -
 drivers/mtd/nand/mxc_nand.c| 1 -
 drivers/mtd/nand/nandsim.c | 1 -
 drivers/mtd/nand/ndfc.c| 1 -
 drivers/mtd/nand/nuc900_nand.c | 1 -
 drivers/mtd/nand/omap2.c   | 1 -
 drivers/mtd/nand/orion_nand.c  | 1 -
 drivers/mtd/nand/pasemi_nand.c | 1 -
 drivers/mtd/nand/plat_nand.c   | 1 -
 drivers/mtd/nand/pxa3xx_nand.c | 1 -
 drivers/mtd/nand/r852.c| 1 -
 drivers/mtd/nand/s3c2410.c | 1 -
 drivers/mtd/nand/sh_flctl.c| 1 -
 drivers/mtd/nand/sharpsl.c | 1 -
 drivers/mtd/nand/socrates_nand.c   | 1 -
 drivers/mtd/nand/sunxi_nand.c  | 1 -
 drivers/mtd/nand/tmio_nand.c   | 1 -
 drivers/mtd/nand/txx9ndfmc.c   | 2 --
 drivers/mtd/nand/vf610_nfc.c   | 1 -
 42 files changed, 45 deletions(-)

diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c
index 0f638c6..1a18938 100644
--- a/drivers/mtd/nand/ams-delta.c
+++ b/drivers/mtd/nand/ams-delta.c
@@ -193,9 +193,6 @@ static int ams_delta_init(struct platform_device *pdev)
ams_delta_mtd = nand_to_mtd(this);
ams_delta_mtd->owner = THIS_MODULE;
 
-   /* Link the private data with the MTD structure */
-   ams_delta_mtd->priv = this;
-
/*
 * Don't try to request the memory region from here,
 * it should have been already requested from the
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 9ba2831..18c4e14 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -2128,7 +2128,6 @@ static int atmel_nand_probe(struct platform_device *pdev)
}
 
nand_chip->priv = host; /* link the private data structures */
-   mtd->priv = nand_chip;
mtd->dev.parent = >dev;
 
/* Set address of NAND IO lines */
diff --git a/drivers/mtd/nand/au1550nd.c b/drivers/mtd/nand/au1550nd.c
index 280e5b6..341ea49 100644
--- a/drivers/mtd/nand/au1550nd.c
+++ b/drivers/mtd/nand/au1550nd.c
@@ -441,7 +441,6 @@ static int au1550nd_probe(struct platform_device *pdev)
 
this = >chip;
mtd = nand_to_mtd(this);
-   mtd->priv = this;
mtd->dev.parent = >dev;
 
/* figure out which CS# r->start belongs to */
diff --git a/drivers/mtd/nand/bcm47xxnflash/main.c 
b/drivers/mtd/nand/bcm47xxnflash/main.c
index 4711ca2b..0f0a798 100644
--- a/drivers/mtd/nand/bcm47xxnflash/main.c
+++ b/drivers/mtd/nand/bcm47xxnflash/main.c
@@ -37,7 +37,6 @@ static int bcm47xxnflash_probe(struct platform_device *pdev)
b47n->nand_chip.priv = b47n;
mtd = nand_to_mtd(>nand_chip);
mtd->dev.parent = >dev;
-   mtd->priv = >nand_chip; /* Required */
b47n->cc = container_of(nflash, struct bcma_drv_cc, nflash);
 
if (b47n->cc->core->bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) {
diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c
index 928d599..9514e13 100644
--- a/drivers/mtd/nand/bf5xx_nand.c
+++ b/drivers/mtd/nand/bf5xx_nand.c
@@ -782,7 +782,6 @@ static int bf5xx_nand_probe(struct platform_device *pdev)
chip->chip_delay   = 0;
 
/* initialise mtd info data struct */
-   mtd->priv   = chip;
mtd->dev.parent = >dev;
 
/* initialise the hardware */
diff --git a/drivers/mtd/nand/brcmnand/brcmnand.c 
b/drivers/mtd/nand/brcmnand/brcmnand.c