Re: question about __v annotation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux