mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] eccbuf is statically defined and always evaluate to true
@ 2007-10-19 17:26 Samuel Tardieu
  2007-10-19 18:17 ` Samuel Tardieu
  2007-10-19 19:06 ` Jörn Engel
  0 siblings, 2 replies; 4+ messages in thread
From: Samuel Tardieu @ 2007-10-19 17:26 UTC (permalink / raw)
  To: linux-mtd; +Cc: linux-kernel, trivial

---
 drivers/mtd/devices/doc2000.c     |    4 ++--
 drivers/mtd/devices/doc2001plus.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c
index c73e96b..e9ce241 100644
--- a/drivers/mtd/devices/doc2000.c
+++ b/drivers/mtd/devices/doc2000.c
@@ -632,7 +632,7 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len,
 			len = ((from | 0x1ff) + 1) - from;
 
 		/* The ECC will not be calculated correctly if less than 512 is read */
-		if (len != 0x200 && eccbuf)
+		if (len != 0x200)
 			printk(KERN_WARNING
 			       "ECC needs a full sector read (adr: %lx size %lx)\n",
 			       (long) from, (long) len);
@@ -896,7 +896,7 @@ static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,
 		/* Let the caller know we completed it */
 		*retlen += len;
 
-		if (eccbuf) {
+		{
 			unsigned char x[8];
 			size_t dummy;
 			int ret;
diff --git a/drivers/mtd/devices/doc2001plus.c b/drivers/mtd/devices/doc2001plus.c
index 2b30b58..83be346 100644
--- a/drivers/mtd/devices/doc2001plus.c
+++ b/drivers/mtd/devices/doc2001plus.c
@@ -748,7 +748,7 @@ static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,
 	WriteDOC(DoC_GetDataOffset(mtd, &fto), docptr, Mplus_FlashCmd);
 
 	/* On interleaved devices the flags for 2nd half 512 are before data */
-	if (eccbuf && before)
+	if (before)
 		fto -= 2;
 
 	/* issue the Serial Data In command to initial the Page Program process */
-- 
1.5.3.4


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

* Re: [PATCH] eccbuf is statically defined and always evaluate to true
  2007-10-19 17:26 [PATCH] eccbuf is statically defined and always evaluate to true Samuel Tardieu
@ 2007-10-19 18:17 ` Samuel Tardieu
  2007-10-19 19:06 ` Jörn Engel
  1 sibling, 0 replies; 4+ messages in thread
From: Samuel Tardieu @ 2007-10-19 18:17 UTC (permalink / raw)
  To: linux-mtd; +Cc: trivial, linux-kernel

Off course, there should be the required

  Signed-off-by: Samuel Tardieu <sam@rfc1149.net>

on this patch.

  Sam
-- 
Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/


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

* Re: [PATCH] eccbuf is statically defined and always evaluate to true
  2007-10-19 17:26 [PATCH] eccbuf is statically defined and always evaluate to true Samuel Tardieu
  2007-10-19 18:17 ` Samuel Tardieu
@ 2007-10-19 19:06 ` Jörn Engel
  2007-10-19 19:58   ` Samuel Tardieu
  1 sibling, 1 reply; 4+ messages in thread
From: Jörn Engel @ 2007-10-19 19:06 UTC (permalink / raw)
  To: Samuel Tardieu; +Cc: linux-mtd, trivial, linux-kernel

On Fri, 19 October 2007 19:26:35 +0200, Samuel Tardieu wrote:
> 
> ---
>  drivers/mtd/devices/doc2000.c     |    4 ++--
>  drivers/mtd/devices/doc2001plus.c |    2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)

Acked-by: Joern Engel <joern@logfs.org>

I assume you don't actually use this driver and just ran make
randconfig or allyesconfig or so..

Jörn

-- 
Science is like sex: sometimes something useful comes out,
but that is not the reason we are doing it.
-- Richard Feynman

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

* Re: [PATCH] eccbuf is statically defined and always evaluate to true
  2007-10-19 19:06 ` Jörn Engel
@ 2007-10-19 19:58   ` Samuel Tardieu
  0 siblings, 0 replies; 4+ messages in thread
From: Samuel Tardieu @ 2007-10-19 19:58 UTC (permalink / raw)
  To: Jörn Engel; +Cc: linux-mtd, trivial, linux-kernel

On 19/10, Jörn Engel wrote:

| I assume you don't actually use this driver and just ran make
| randconfig or allyesconfig or so..

I tried the latest svn tip of GCC and it looks like this warning is
quite recent (and I happened to have this driver enabled as a module
in my kernel):

drivers/mtd/devices/doc2000.c: In function ‘doc_read’:
drivers/mtd/devices/doc2000.c:635: warning: the address of ‘eccbuf’ will always evaluate as ‘true’
drivers/mtd/devices/doc2000.c: In function ‘doc_write’:
drivers/mtd/devices/doc2000.c:899: warning: the address of ‘eccbuf’ will always evaluate as ‘true’
drivers/mtd/devices/doc2001plus.c: In function ‘doc_write’:
drivers/mtd/devices/doc2001plus.c:751: warning: the address of ‘eccbuf’ will always evaluate as ‘true’


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

end of thread, other threads:[~2007-10-19 19:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-19 17:26 [PATCH] eccbuf is statically defined and always evaluate to true Samuel Tardieu
2007-10-19 18:17 ` Samuel Tardieu
2007-10-19 19:06 ` Jörn Engel
2007-10-19 19:58   ` Samuel Tardieu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®