Unfortunately a typedef alone won't even issue a warning for code which
uses the "sane type" directly.
IMO nice would be a really opaque cookie, s.t. readl is passed the
cookie _and_ offset. That also leaves the way open for lots of
different implementation methods for readl et al., including debugging
checks, range and I/O tracing. (E.g. I've seen drivers access ports
outside their allocated range, due to typos).
Many drivers use a struct to define the offsets in their I/O or iomem
space. E.g. acenic.c: readl(®s->CpuCtrl). We know that's not
portable in the sense that struct layout is not guaranteed. However,
provided all the fields are suitably padded & aligned, it works in
practice. (So far..)
Those drivers will compile with the simplest void * -> unsigned long
change, but it will be lots of work to get rid of all the warnings.
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/