linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MTD: Suppress warnings in inline_map_read()
@ 2010-04-09 22:45 Kevin Cernekee
  2010-04-10  9:26 ` David Woodhouse
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Cernekee @ 2010-04-09 22:45 UTC (permalink / raw)
  To: dwmw2; +Cc: linux-mtd, linux-kernel

With gcc 4.4.3 -O2 on MIPS32:

drivers/mtd/chips/cfi_util.c: In function 'cfi_qry_present':
include/linux/mtd/map.h:390: warning: 'r' may be used uninitialized in this function
include/linux/mtd/map.h:375: note: 'r' was declared here
include/linux/mtd/map.h:390: warning: 'r' may be used uninitialized in this function
include/linux/mtd/map.h:375: note: 'r' was declared here

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
 include/linux/mtd/map.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index b981b87..74f0277 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -372,7 +372,7 @@ static inline map_word map_word_ff(struct map_info *map)
 
 static inline map_word inline_map_read(struct map_info *map, unsigned long ofs)
 {
-	map_word r;
+	map_word r = { { 0 } };
 
 	if (map_bankwidth_is_1(map))
 		r.x[0] = __raw_readb(map->virt + ofs);
-- 
1.6.3.1

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

* Re: [PATCH] MTD: Suppress warnings in inline_map_read()
  2010-04-09 22:45 [PATCH] MTD: Suppress warnings in inline_map_read() Kevin Cernekee
@ 2010-04-10  9:26 ` David Woodhouse
  2010-04-10 18:18   ` [PATCHv2] " Kevin Cernekee
  0 siblings, 1 reply; 7+ messages in thread
From: David Woodhouse @ 2010-04-10  9:26 UTC (permalink / raw)
  To: Kevin Cernekee; +Cc: linux-mtd, linux-kernel

On Fri, 2010-04-09 at 15:45 -0700, Kevin Cernekee wrote:
> With gcc 4.4.3 -O2 on MIPS32:
> 
> drivers/mtd/chips/cfi_util.c: In function 'cfi_qry_present':
> include/linux/mtd/map.h:390: warning: 'r' may be used uninitialized in this function
> include/linux/mtd/map.h:375: note: 'r' was declared here
> include/linux/mtd/map.h:390: warning: 'r' may be used uninitialized in this function
> include/linux/mtd/map.h:375: note: 'r' was declared here
> 
> Signed-off-by: Kevin Cernekee <cernekee@gmail.com>

I suspect 'else BUG()' would be a better fix.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

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

* [PATCHv2] MTD: Suppress warnings in inline_map_read()
  2010-04-10  9:26 ` David Woodhouse
@ 2010-04-10 18:18   ` Kevin Cernekee
  2010-04-27  7:46     ` Artem Bityutskiy
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Cernekee @ 2010-04-10 18:18 UTC (permalink / raw)
  To: dwmw2; +Cc: linux-mtd, linux-kernel

With gcc 4.4.3 -O2 on MIPS32:

drivers/mtd/chips/cfi_util.c: In function 'cfi_qry_present':
include/linux/mtd/map.h:390: warning: 'r' may be used uninitialized in this function
include/linux/mtd/map.h:375: note: 'r' was declared here
include/linux/mtd/map.h:390: warning: 'r' may be used uninitialized in this function
include/linux/mtd/map.h:375: note: 'r' was declared here

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
 include/linux/mtd/map.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index b981b87..56a4592 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -386,6 +386,8 @@ static inline map_word inline_map_read(struct map_info *map, unsigned long ofs)
 #endif
 	else if (map_bankwidth_is_large(map))
 		memcpy_fromio(r.x, map->virt+ofs, map->bankwidth);
+	else
+		BUG();
 
 	return r;
 }
-- 
1.6.3.1

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

* Re: [PATCHv2] MTD: Suppress warnings in inline_map_read()
  2010-04-10 18:18   ` [PATCHv2] " Kevin Cernekee
@ 2010-04-27  7:46     ` Artem Bityutskiy
  2010-05-04 13:04       ` Artem Bityutskiy
  0 siblings, 1 reply; 7+ messages in thread
From: Artem Bityutskiy @ 2010-04-27  7:46 UTC (permalink / raw)
  To: Kevin Cernekee; +Cc: linux-mtd, dwmw2, linux-kernel

On Sat, 2010-04-10 at 11:18 -0700, Kevin Cernekee wrote:
> With gcc 4.4.3 -O2 on MIPS32:
> 
> drivers/mtd/chips/cfi_util.c: In function 'cfi_qry_present':
> include/linux/mtd/map.h:390: warning: 'r' may be used uninitialized in this function
> include/linux/mtd/map.h:375: note: 'r' was declared here
> include/linux/mtd/map.h:390: warning: 'r' may be used uninitialized in this function
> include/linux/mtd/map.h:375: note: 'r' was declared here
> 
> Signed-off-by: Kevin Cernekee <cernekee@gmail.com>

Pushed to l2-mtd-2.6 / dunno

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

* Re: [PATCHv2] MTD: Suppress warnings in inline_map_read()
  2010-04-27  7:46     ` Artem Bityutskiy
@ 2010-05-04 13:04       ` Artem Bityutskiy
  2010-05-04 20:06         ` Kevin Cernekee
  0 siblings, 1 reply; 7+ messages in thread
From: Artem Bityutskiy @ 2010-05-04 13:04 UTC (permalink / raw)
  To: Kevin Cernekee; +Cc: linux-mtd, dwmw2, linux-kernel

On Tue, 2010-04-27 at 10:46 +0300, Artem Bityutskiy wrote:
> On Sat, 2010-04-10 at 11:18 -0700, Kevin Cernekee wrote:
> > With gcc 4.4.3 -O2 on MIPS32:
> > 
> > drivers/mtd/chips/cfi_util.c: In function 'cfi_qry_present':
> > include/linux/mtd/map.h:390: warning: 'r' may be used uninitialized in this function
> > include/linux/mtd/map.h:375: note: 'r' was declared here
> > include/linux/mtd/map.h:390: warning: 'r' may be used uninitialized in this function
> > include/linux/mtd/map.h:375: note: 'r' was declared here
> > 
> > Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
> 
> Pushed to l2-mtd-2.6 / dunno

Removed from my tree because this breaks compilation:

[dedekind@eru l2-mtd-2.6]$ make  ARCH=arm O=/home/dedekind/tmp/l2-mtd-2.6-arm/
  Using /home/dedekind/git/l2-mtd-2.6 as source for kernel
  GEN     /home/dedekind/tmp/l2-mtd-2.6-arm/Makefile
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[2]: `include/generated/mach-types.h' is up to date.
  CALL    /home/dedekind/git/l2-mtd-2.6/scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CC [M]  drivers/mtd/lpddr/lpddr_cmds.o
In file included from /home/dedekind/git/l2-mtd-2.6/include/linux/mtd/qinfo.h:4,
                 from /home/dedekind/git/l2-mtd-2.6/include/linux/mtd/pfow.h:7,
                 from /home/dedekind/git/l2-mtd-2.6/drivers/mtd/lpddr/lpddr_cmds.c:27:
/home/dedekind/git/l2-mtd-2.6/include/linux/mtd/map.h: In function 'inline_map_read':
/home/dedekind/git/l2-mtd-2.6/include/linux/mtd/map.h:390: error: implicit declaration of function 'BUG'
make[4]: *** [drivers/mtd/lpddr/lpddr_cmds.o] Error 1
make[3]: *** [drivers/mtd/lpddr] Error 2
make[2]: *** [drivers/mtd] Error 2
make[1]: *** [drivers] Error 2
make: *** [sub-make] Error 2
[dedekind@eru l2-mtd-2.6]$ git revert ae60e258dda8a9c575fcbd68f05ca034ad043a36^C
[dedekind@eru l2-mtd-2.6]$ git log 

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

* Re: [PATCHv2] MTD: Suppress warnings in inline_map_read()
  2010-05-04 13:04       ` Artem Bityutskiy
@ 2010-05-04 20:06         ` Kevin Cernekee
  2010-05-05 12:11           ` Artem Bityutskiy
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Cernekee @ 2010-05-04 20:06 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd, dwmw2, linux-kernel

On Tue, May 4, 2010 at 6:04 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> /home/dedekind/git/l2-mtd-2.6/include/linux/mtd/map.h: In function 'inline_map_read':
> /home/dedekind/git/l2-mtd-2.6/include/linux/mtd/map.h:390: error: implicit declaration of function 'BUG'

I did test my patch, but it didn't generate any warnings or errors on MIPS...

Could you please apply this patch and retry:

http://lists.infradead.org/pipermail/linux-mtd/2010-May/029904.html

<linux/bug.h> should probably be added anyway since there are two
other BUG statements in that file.

Thanks.

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

* Re: [PATCHv2] MTD: Suppress warnings in inline_map_read()
  2010-05-04 20:06         ` Kevin Cernekee
@ 2010-05-05 12:11           ` Artem Bityutskiy
  0 siblings, 0 replies; 7+ messages in thread
From: Artem Bityutskiy @ 2010-05-05 12:11 UTC (permalink / raw)
  To: Kevin Cernekee; +Cc: linux-mtd, dwmw2, linux-kernel

On Tue, 2010-05-04 at 13:06 -0700, Kevin Cernekee wrote:
> On Tue, May 4, 2010 at 6:04 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> > /home/dedekind/git/l2-mtd-2.6/include/linux/mtd/map.h: In function 'inline_map_read':
> > /home/dedekind/git/l2-mtd-2.6/include/linux/mtd/map.h:390: error: implicit declaration of function 'BUG'
> 
> I did test my patch, but it didn't generate any warnings or errors on MIPS...
> 
> Could you please apply this patch and retry:
> 
> http://lists.infradead.org/pipermail/linux-mtd/2010-May/029904.html
> 
> <linux/bug.h> should probably be added anyway since there are two
> other BUG statements in that file.

Pushed this patch and the '[PATCH] mtd: map.h: add missing bug.h
include' one back to l2-mtd-2.6 / dunno.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

end of thread, other threads:[~2010-05-05 12:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-09 22:45 [PATCH] MTD: Suppress warnings in inline_map_read() Kevin Cernekee
2010-04-10  9:26 ` David Woodhouse
2010-04-10 18:18   ` [PATCHv2] " Kevin Cernekee
2010-04-27  7:46     ` Artem Bityutskiy
2010-05-04 13:04       ` Artem Bityutskiy
2010-05-04 20:06         ` Kevin Cernekee
2010-05-05 12:11           ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).