Not only does it work in practice, it's used by most drivers and file systems
when they describe on-disk or dma structures. Currently the rules are:
- naturally align everything
- all struct sizes might be aligned to a multiple of four bytes
By now, I believe it is more likely that gcc would be fixed for a new
architecture that violates this assumption, so it's not worth it to go
around and "fix" those drivers.
As for using two arguments to readl, that would break the ®s->RegName
trick, unless people are happy with a global #define Regs ((struct foo *)0)
and read32(regs, &Regs->RegName); maybe it's best to just stop doing that
though.
Philipp Rumpf
-
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/