Re: unsigned long ioremap()?

Abramo Bagnara
2001-05-03T08:40:32Z

Jeff Garzik wrote:
>
> Abramo Bagnara wrote:
> > "David S. Miller" wrote:
> > > There is a school of thought which believes that:
> > >
> > > struct xdev_regs {
> > > u32 reg1;
> > > u32 reg2;
> > > };
> > >
> > > val = readl(&regs->reg2);
> > >
> > > is cleaner than:
> > >
> > > #define REG1 0x00
> > > #define REG2 0x04
> > >
> > > val = readl(regs + REG2);
>
> > The problem I see is that with the former solution nothing prevents from
> > to do:
> >
> > regs->reg2 = 13;
>
> Why should there be something to prevent that?
>
> If a programmer does that to an ioremapped area, that is a bug. Pure
> and simple.
>
> We do not need extra mechanisms simply to guard against programmers
> doing the wrong thing all the time.
>
> > That's indeed the reason to change ioremap prototype for 2.5.
>
> Say what??
>

Please give a look
http://www.uwsg.indiana.edu/hypermail/linux/kernel/0008.1/0338.html
http://www.uwsg.indiana.edu/hypermail/linux/kernel/0008.1/0407.html

This was something that already got a wide consent.

--
Abramo Bagnara mailto:abramo@alsa-project.org

Opera Unica Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy

ALSA project http://www.alsa-project.org
It sounds good!