Linux-mtd Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/2] mtd: remove some set but not used variables
@ 2019-09-03  2:52 zhengbin
  2019-09-03  2:52 ` [PATCH 1/2] mtd: spear_smi: remove set but not used variable 'flash_info' zhengbin
  2019-09-03  2:52 ` [PATCH 2/2] mtd: pmc551: remove set but not used variable 'soff_lo' zhengbin
  0 siblings, 2 replies; 4+ messages in thread
From: zhengbin @ 2019-09-03  2:52 UTC (permalink / raw)
  To: dwmw2, computersforpeace, marek.vasut, miquel.raynal, richard,
	vigneshr, linux-mtd
  Cc: zhengbin13

zhengbin (2):
  mtd: spear_smi: remove set but not used variable 'flash_info'
  mtd: pmc551: remove set but not used variable 'soff_lo'

 drivers/mtd/devices/pmc551.c    | 9 +++------
 drivers/mtd/devices/spear_smi.c | 3 ---
 2 files changed, 3 insertions(+), 9 deletions(-)

--
2.7.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] mtd: spear_smi: remove set but not used variable 'flash_info'
  2019-09-03  2:52 [PATCH 0/2] mtd: remove some set but not used variables zhengbin
@ 2019-09-03  2:52 ` zhengbin
  2019-10-08 17:25   ` Miquel Raynal
  2019-09-03  2:52 ` [PATCH 2/2] mtd: pmc551: remove set but not used variable 'soff_lo' zhengbin
  1 sibling, 1 reply; 4+ messages in thread
From: zhengbin @ 2019-09-03  2:52 UTC (permalink / raw)
  To: dwmw2, computersforpeace, marek.vasut, miquel.raynal, richard,
	vigneshr, linux-mtd
  Cc: zhengbin13

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/mtd/devices/spear_smi.c: In function spear_smi_probe_config_dt:
drivers/mtd/devices/spear_smi.c:780:32: warning: variable flash_info set but not used [-Wunused-but-set-variable]

It is not used since commit 6551ab5d30d6 ("mtd:
add device-tree support to spear_smi")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/mtd/devices/spear_smi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c
index 986f81d..a148158 100644
--- a/drivers/mtd/devices/spear_smi.c
+++ b/drivers/mtd/devices/spear_smi.c
@@ -777,9 +777,6 @@ static int spear_smi_probe_config_dt(struct platform_device *pdev,

 	/* Fill structs for each subnode (flash device) */
 	while ((pp = of_get_next_child(np, pp))) {
-		struct spear_smi_flash_info *flash_info;
-
-		flash_info = &pdata->board_flash_info[i];
 		pdata->np[i] = pp;

 		/* Read base-addr and size from DT */
--
2.7.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] mtd: pmc551: remove set but not used variable 'soff_lo'
  2019-09-03  2:52 [PATCH 0/2] mtd: remove some set but not used variables zhengbin
  2019-09-03  2:52 ` [PATCH 1/2] mtd: spear_smi: remove set but not used variable 'flash_info' zhengbin
@ 2019-09-03  2:52 ` zhengbin
  1 sibling, 0 replies; 4+ messages in thread
From: zhengbin @ 2019-09-03  2:52 UTC (permalink / raw)
  To: dwmw2, computersforpeace, marek.vasut, miquel.raynal, richard,
	vigneshr, linux-mtd
  Cc: zhengbin13

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/mtd/devices/pmc551.c: In function pmc551_erase:
drivers/mtd/devices/pmc551.c:142:15: warning: variable soff_lo set but not used [-Wunused-but-set-variable]
drivers/mtd/devices/pmc551.c: In function pmc551_read:
drivers/mtd/devices/pmc551.c:232:15: warning: variable soff_lo set but not used [-Wunused-but-set-variable]
drivers/mtd/devices/pmc551.c: In function pmc551_write:
drivers/mtd/devices/pmc551.c:289:15: warning: variable soff_lo set but not used [-Wunused-but-set-variable]

It is not used since commit cdf0a7d16980 ("[MTD]
pmc551 whitespace cleanup")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/mtd/devices/pmc551.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c
index 3b89ab2..6597fc2 100644
--- a/drivers/mtd/devices/pmc551.c
+++ b/drivers/mtd/devices/pmc551.c
@@ -135,7 +135,7 @@ static int pmc551_point(struct mtd_info *mtd, loff_t from, size_t len,
 static int pmc551_erase(struct mtd_info *mtd, struct erase_info *instr)
 {
 	struct mypriv *priv = mtd->priv;
-	u32 soff_hi, soff_lo;	/* start address offset hi/lo */
+	u32 soff_hi;		/* start address offset hi */
 	u32 eoff_hi, eoff_lo;	/* end address offset hi/lo */
 	unsigned long end;
 	u_char *ptr;
@@ -150,7 +150,6 @@ static int pmc551_erase(struct mtd_info *mtd, struct erase_info *instr)
 	eoff_hi = end & ~(priv->asize - 1);
 	soff_hi = instr->addr & ~(priv->asize - 1);
 	eoff_lo = end & (priv->asize - 1);
-	soff_lo = instr->addr & (priv->asize - 1);

 	pmc551_point(mtd, instr->addr, instr->len, &retlen,
 		     (void **)&ptr, NULL);
@@ -225,7 +224,7 @@ static int pmc551_read(struct mtd_info *mtd, loff_t from, size_t len,
 			size_t * retlen, u_char * buf)
 {
 	struct mypriv *priv = mtd->priv;
-	u32 soff_hi, soff_lo;	/* start address offset hi/lo */
+	u32 soff_hi;		/* start address offset hi */
 	u32 eoff_hi, eoff_lo;	/* end address offset hi/lo */
 	unsigned long end;
 	u_char *ptr;
@@ -239,7 +238,6 @@ static int pmc551_read(struct mtd_info *mtd, loff_t from, size_t len,
 	end = from + len - 1;
 	soff_hi = from & ~(priv->asize - 1);
 	eoff_hi = end & ~(priv->asize - 1);
-	soff_lo = from & (priv->asize - 1);
 	eoff_lo = end & (priv->asize - 1);

 	pmc551_point(mtd, from, len, retlen, (void **)&ptr, NULL);
@@ -282,7 +280,7 @@ static int pmc551_write(struct mtd_info *mtd, loff_t to, size_t len,
 			size_t * retlen, const u_char * buf)
 {
 	struct mypriv *priv = mtd->priv;
-	u32 soff_hi, soff_lo;	/* start address offset hi/lo */
+	u32 soff_hi;		/* start address offset hi */
 	u32 eoff_hi, eoff_lo;	/* end address offset hi/lo */
 	unsigned long end;
 	u_char *ptr;
@@ -296,7 +294,6 @@ static int pmc551_write(struct mtd_info *mtd, loff_t to, size_t len,
 	end = to + len - 1;
 	soff_hi = to & ~(priv->asize - 1);
 	eoff_hi = end & ~(priv->asize - 1);
-	soff_lo = to & (priv->asize - 1);
 	eoff_lo = end & (priv->asize - 1);

 	pmc551_point(mtd, to, len, retlen, (void **)&ptr, NULL);
--
2.7.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] mtd: spear_smi: remove set but not used variable 'flash_info'
  2019-09-03  2:52 ` [PATCH 1/2] mtd: spear_smi: remove set but not used variable 'flash_info' zhengbin
@ 2019-10-08 17:25   ` Miquel Raynal
  0 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2019-10-08 17:25 UTC (permalink / raw)
  To: zhengbin, dwmw2, computersforpeace, marek.vasut, miquel.raynal,
	richard, vigneshr, linux-mtd

On Tue, 2019-09-03 at 02:52:29 UTC, zhengbin wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/mtd/devices/spear_smi.c: In function spear_smi_probe_config_dt:
> drivers/mtd/devices/spear_smi.c:780:32: warning: variable flash_info set but not used [-Wunused-but-set-variable]
> 
> It is not used since commit 6551ab5d30d6 ("mtd:
> add device-tree support to spear_smi")
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03  2:52 [PATCH 0/2] mtd: remove some set but not used variables zhengbin
2019-09-03  2:52 ` [PATCH 1/2] mtd: spear_smi: remove set but not used variable 'flash_info' zhengbin
2019-10-08 17:25   ` Miquel Raynal
2019-09-03  2:52 ` [PATCH 2/2] mtd: pmc551: remove set but not used variable 'soff_lo' zhengbin

Linux-mtd Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mtd/0 linux-mtd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mtd linux-mtd/ https://lore.kernel.org/linux-mtd \
		linux-mtd@lists.infradead.org linux-mtd@archiver.kernel.org
	public-inbox-index linux-mtd

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mtd


AGPL code for this site: git clone https://public-inbox.org/ public-inbox