On Tue, Jan 05, 2010 at 12:42:03PM +0100, Bernd Petrovitsch wrote:
> So which is better (in the kernel and for this functions, macros or
> whatever they really maybe!)?
> a) #define readb(c) ((__u8)__raw_readb(__mem_pci(c)))
> which is more a rephrase of the above
> b) static inline __u8 readb(const void *c) { return
> __raw_readb(__mem_pci(c)); }
> Caveat emptor: Not compile-tested.
Neither is best, use the proper __iomem marking for the memory space,
and use the built-in kernel functions to read and write data to io
space, they are there for a reason, don't try to roll your own.
thanks,
greg k-h
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ