Re: unsigned long ioremap()?

From: David S. Miller (davem@redhat.com)
Date: Fri May 04 2001 - 02:30:27 EST


Abramo Bagnara writes:
> it's perfectly fine to have:
>
> regs = (struct reg *) ioremap(addr, size);
> foo = readl((unsigned long)&regs->bar);
>

I don't see how one can find this valid compared to my preference of
just plain readl(&regs->bar); You're telling me it's nicer to have the
butt ugly cast there which serves no purpose?

One could argue btw that structure offsets are less error prone to
code than register offset defines out the wazoo.

I think your argument here is bogus.

Later,
David S. Miller
davem@redhat.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 07 2001 - 21:00:19 EST