mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* sparse warnings
@ 2010-11-15 14:20 Belisko Marek
  2010-11-17  9:11 ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Belisko Marek @ 2010-11-15 14:20 UTC (permalink / raw)
  To: barebox

Hi,

barebox compilation with C=1 produce a lot of sparse warnings.
Mainly concerning __iomem problems with readb() and similar functions.

Make it sense to take care or just could be omitted?

thanks,

marek

-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
icq: 290551086
web: http://open-nandra.com

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: sparse warnings
  2010-11-15 14:20 sparse warnings Belisko Marek
@ 2010-11-17  9:11 ` Sascha Hauer
  2010-11-18  9:36   ` Belisko Marek
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2010-11-17  9:11 UTC (permalink / raw)
  To: Belisko Marek; +Cc: barebox

Hi Marek,

On Mon, Nov 15, 2010 at 03:20:47PM +0100, Belisko Marek wrote:
> Hi,
> 
> barebox compilation with C=1 produce a lot of sparse warnings.
> Mainly concerning __iomem problems with readb() and similar functions.
> 
> Make it sense to take care or just could be omitted?

I think it makes sense to work on this. Then we can see the useful
warnings buried under the __iomem warnings.

I had the idea of adding a

#define IOMEM(addr)        ((void __force __iomem *)(addr))

and use it where appropriate.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: sparse warnings
  2010-11-17  9:11 ` Sascha Hauer
@ 2010-11-18  9:36   ` Belisko Marek
  2010-11-18 10:01     ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Belisko Marek @ 2010-11-18  9:36 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hi,

On Wed, Nov 17, 2010 at 10:11 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> Hi Marek,
>
> On Mon, Nov 15, 2010 at 03:20:47PM +0100, Belisko Marek wrote:
>> Hi,
>>
>> barebox compilation with C=1 produce a lot of sparse warnings.
>> Mainly concerning __iomem problems with readb() and similar functions.
>>
>> Make it sense to take care or just could be omitted?
>
> I think it makes sense to work on this. Then we can see the useful
> warnings buried under the __iomem warnings.
>
> I had the idea of adding a
>
> #define IOMEM(addr)        ((void __force __iomem *)(addr))
>
> and use it where appropriate.
Maybe stupid question but couldn't be __iomem mechanism removed completely?
Do we need to check for different address_space? In my opinion it
makes no sense in
barebox.
>
> Sascha
>
> --
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
>

thanks,

marek

-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
icq: 290551086
web: http://open-nandra.com

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: sparse warnings
  2010-11-18  9:36   ` Belisko Marek
@ 2010-11-18 10:01     ` Sascha Hauer
  2010-11-18 10:22       ` Uwe Kleine-König
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2010-11-18 10:01 UTC (permalink / raw)
  To: Belisko Marek; +Cc: barebox

On Thu, Nov 18, 2010 at 10:36:51AM +0100, Belisko Marek wrote:
> Hi,
> 
> On Wed, Nov 17, 2010 at 10:11 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> > Hi Marek,
> >
> > On Mon, Nov 15, 2010 at 03:20:47PM +0100, Belisko Marek wrote:
> >> Hi,
> >>
> >> barebox compilation with C=1 produce a lot of sparse warnings.
> >> Mainly concerning __iomem problems with readb() and similar functions.
> >>
> >> Make it sense to take care or just could be omitted?
> >
> > I think it makes sense to work on this. Then we can see the useful
> > warnings buried under the __iomem warnings.
> >
> > I had the idea of adding a
> >
> > #define IOMEM(addr)        ((void __force __iomem *)(addr))
> >
> > and use it where appropriate.
> Maybe stupid question but couldn't be __iomem mechanism removed completely?
> Do we need to check for different address_space? In my opinion it
> makes no sense in
> barebox.

I have a better feeling letting it in. There may be no different address
spaces on Arm, but there are for exmample on x86.
You can simply do a #define __iomem in include/linux/compiler.h to
silence these kinds of warnings temporarily if you are not interested.
I agree that at least on Arm these warnings will not reveal any real
bugs.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: sparse warnings
  2010-11-18 10:01     ` Sascha Hauer
@ 2010-11-18 10:22       ` Uwe Kleine-König
  0 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2010-11-18 10:22 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On Thu, Nov 18, 2010 at 11:01:33AM +0100, Sascha Hauer wrote:
> On Thu, Nov 18, 2010 at 10:36:51AM +0100, Belisko Marek wrote:
> > Hi,
> > 
> > On Wed, Nov 17, 2010 at 10:11 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> > > Hi Marek,
> > >
> > > On Mon, Nov 15, 2010 at 03:20:47PM +0100, Belisko Marek wrote:
> > >> Hi,
> > >>
> > >> barebox compilation with C=1 produce a lot of sparse warnings.
> > >> Mainly concerning __iomem problems with readb() and similar functions.
> > >>
> > >> Make it sense to take care or just could be omitted?
> > >
> > > I think it makes sense to work on this. Then we can see the useful
> > > warnings buried under the __iomem warnings.
> > >
> > > I had the idea of adding a
> > >
> > > #define IOMEM(addr)        ((void __force __iomem *)(addr))
> > >
> > > and use it where appropriate.
> > Maybe stupid question but couldn't be __iomem mechanism removed completely?
> > Do we need to check for different address_space? In my opinion it
> > makes no sense in
> > barebox.
> 
> I have a better feeling letting it in. There may be no different address
> spaces on Arm, but there are for exmample on x86.
> You can simply do a #define __iomem in include/linux/compiler.h to
> silence these kinds of warnings temporarily if you are not interested.
> I agree that at least on Arm these warnings will not reveal any real
> bugs.
I can imagine you to get hard to find bugs if you interpret a pointer to
registers as normal pointer without volatile.  Something like:

	unsigned long *register = 0xabcdef04;
	while (*register & SOME_FLAG)
		/* nothing */

This might generate code that corresponds to

	if (*register & SOME_FLAG)
		while(1);

So I feel for letting it in, too.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2010-11-18 10:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-15 14:20 sparse warnings Belisko Marek
2010-11-17  9:11 ` Sascha Hauer
2010-11-18  9:36   ` Belisko Marek
2010-11-18 10:01     ` Sascha Hauer
2010-11-18 10:22       ` Uwe Kleine-König

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