LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] ubi: fix sparse errors in ubi.h
@ 2008-02-14 21:53 Harvey Harrison
  2008-02-14 23:56 ` Ben Dooks
  2008-02-14 23:59 ` Adrian Bunk
  0 siblings, 2 replies; 4+ messages in thread
From: Harvey Harrison @ 2008-02-14 21:53 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML

In C, signed 1-bit bitfields can only take the values 0 and -1, only
0 and 1 are ever assigned in current code.  Make them unsigned
bitfields.

Fixes the (repeated) sparse errors:
drivers/mtd/ubi/ubi.h:220:15: error: dubious one-bit signed bitfield
drivers/mtd/ubi/ubi.h:221:17: error: dubious one-bit signed bitfield
drivers/mtd/ubi/ubi.h:222:18: error: dubious one-bit signed bitfield
drivers/mtd/ubi/ubi.h:223:16: error: dubious one-bit signed bitfield
drivers/mtd/ubi/ubi.h:224:20: error: dubious one-bit signed bitfield

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
Sorry, not sure who to CC on this.

 drivers/mtd/ubi/ubi.h |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 4577106..a548c1d 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -217,11 +217,11 @@ struct ubi_volume {
 	void *upd_buf;
 
 	int *eba_tbl;
-	int checked:1;
-	int corrupted:1;
-	int upd_marker:1;
-	int updating:1;
-	int changing_leb:1;
+	unsigned int checked:1;
+	unsigned int corrupted:1;
+	unsigned int upd_marker:1;
+	unsigned int updating:1;
+	unsigned int changing_leb:1;
 
 #ifdef CONFIG_MTD_UBI_GLUEBI
 	/*
-- 
1.5.4.1.1278.gc75be




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

* Re: [PATCH] ubi: fix sparse errors in ubi.h
  2008-02-14 21:53 [PATCH] ubi: fix sparse errors in ubi.h Harvey Harrison
@ 2008-02-14 23:56 ` Ben Dooks
  2008-02-15  4:58   ` Joe Perches
  2008-02-14 23:59 ` Adrian Bunk
  1 sibling, 1 reply; 4+ messages in thread
From: Ben Dooks @ 2008-02-14 23:56 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Andrew Morton, LKML

On Thu, Feb 14, 2008 at 01:53:15PM -0800, Harvey Harrison wrote:
> In C, signed 1-bit bitfields can only take the values 0 and -1, only
> 0 and 1 are ever assigned in current code.  Make them unsigned
> bitfields.
> 
> Fixes the (repeated) sparse errors:
> drivers/mtd/ubi/ubi.h:220:15: error: dubious one-bit signed bitfield
> drivers/mtd/ubi/ubi.h:221:17: error: dubious one-bit signed bitfield
> drivers/mtd/ubi/ubi.h:222:18: error: dubious one-bit signed bitfield
> drivers/mtd/ubi/ubi.h:223:16: error: dubious one-bit signed bitfield
> drivers/mtd/ubi/ubi.h:224:20: error: dubious one-bit signed bitfield
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---
> Sorry, not sure who to CC on this.

IIRC: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

-- 
Ben (ben@fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

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

* Re: [PATCH] ubi: fix sparse errors in ubi.h
  2008-02-14 21:53 [PATCH] ubi: fix sparse errors in ubi.h Harvey Harrison
  2008-02-14 23:56 ` Ben Dooks
@ 2008-02-14 23:59 ` Adrian Bunk
  1 sibling, 0 replies; 4+ messages in thread
From: Adrian Bunk @ 2008-02-14 23:59 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Andrew Morton, LKML

On Thu, Feb 14, 2008 at 01:53:15PM -0800, Harvey Harrison wrote:
> In C, signed 1-bit bitfields can only take the values 0 and -1, only
> 0 and 1 are ever assigned in current code.  Make them unsigned
> bitfields.
> 
> Fixes the (repeated) sparse errors:
> drivers/mtd/ubi/ubi.h:220:15: error: dubious one-bit signed bitfield
> drivers/mtd/ubi/ubi.h:221:17: error: dubious one-bit signed bitfield
> drivers/mtd/ubi/ubi.h:222:18: error: dubious one-bit signed bitfield
> drivers/mtd/ubi/ubi.h:223:16: error: dubious one-bit signed bitfield
> drivers/mtd/ubi/ubi.h:224:20: error: dubious one-bit signed bitfield
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---
> Sorry, not sure who to CC on this.
>...

$ grep UBI MAINTAINERS 
UNSORTED BLOCK IMAGES (UBI)
$ 

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: [PATCH] ubi: fix sparse errors in ubi.h
  2008-02-14 23:56 ` Ben Dooks
@ 2008-02-15  4:58   ` Joe Perches
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2008-02-15  4:58 UTC (permalink / raw)
  To: Ben Dooks; +Cc: Harvey Harrison, Andrew Morton, LKML

On Thu, 2008-02-14 at 23:56 +0000, Ben Dooks wrote:
> On Thu, Feb 14, 2008 at 01:53:15PM -0800, Harvey Harrison wrote:
> > In C, signed 1-bit bitfields can only take the values 0 and -1, only
> > 0 and 1 are ever assigned in current code.  Make them unsigned
> > bitfields.
> > 
> > Fixes the (repeated) sparse errors:
> > drivers/mtd/ubi/ubi.h:220:15: error: dubious one-bit signed bitfield
> > drivers/mtd/ubi/ubi.h:221:17: error: dubious one-bit signed bitfield
> > drivers/mtd/ubi/ubi.h:222:18: error: dubious one-bit signed bitfield
> > drivers/mtd/ubi/ubi.h:223:16: error: dubious one-bit signed bitfield
> > drivers/mtd/ubi/ubi.h:224:20: error: dubious one-bit signed bitfield
> > 
> > Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> > ---
> > Sorry, not sure who to CC on this.
> 
> IIRC: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

UNSORTED BLOCK IMAGES (UBI)
P:      Artem Bityutskiy
M:      dedekind@infradead.org
W:      http://www.linux-mtd.infradead.org/
L:      linux-mtd@lists.infradead.org
T:      git git://git.infradead.org/~dedekind/ubi-2.6.git
S:      Maintained
F:      drivers/mtd/ubi
F:      include/linux/mtd/ubi.h
F:      include/mtd/ubi-*



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

end of thread, other threads:[~2008-02-15  5:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-14 21:53 [PATCH] ubi: fix sparse errors in ubi.h Harvey Harrison
2008-02-14 23:56 ` Ben Dooks
2008-02-15  4:58   ` Joe Perches
2008-02-14 23:59 ` Adrian Bunk

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).