Re: Probable endianess problem in TLAN driver

From: Riley Williams (rhw@MemAlpha.CX)
Date: Sat Jun 09 2001 - 17:58:55 EST


Hi David.

On Sat, 9 Jun 2001, David S. Miller wrote:

> Adrian Cox writes:

>>> +#if defined(__powerpc__)
>>> +#define inw(addr) le32_to_cpu(inw(addr))
>>> +#define inl(addr) le32_to_cpu(inl(addr))
>>> +#define outw(val, addr) outw(cpu_to_le32(val), addr)
>>> +#define outl(val, addr) outl(cpu_to_le32(val), addr)
>>> +#endif

>> On ppc the inw, inl, outw, and outl functions already byteswap,
>> so by adding the extra byteswap you're now passing unswapped
>> data to the chip.

> Yes, and this is true for every architecture.

> All of {in,out}{b,w,l}() and {read/write}{b,w,l}() swap to/from
> bus endianness for you.

Even if that wasn't true, aren't the above all self-recursive
definitions that would prevent anything calling them from compiling?

Best wishes from Riley.

-
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 : Fri Jun 15 2001 - 21:00:11 EST