Re: [Qemu-devel] [PATCH v2] bswap: Fix width of swap in leul_to_cpu

2013-02-12 Thread Richard Henderson
On 2013-02-12 04:33, Jay Foad wrote: The comment's wrong, isn't it? The reason we're not using HOST_LONG_BITS is because it's the wrong thing, not because of any include loops. Err, well, yes. But there *was* an include loop when we were using that symbol. Feel free to push a comment fix thr

Re: [Qemu-devel] [PATCH v2] bswap: Fix width of swap in leul_to_cpu

2013-02-12 Thread Andreas Färber
Am 12.02.2013 13:33, schrieb Jay Foad: >> +#if ULONG_MAX == UINT32_MAX >> +return le_bswap(v, 32); >> +#elif ULONG_MAX == UINT64_MAX >> +return le_bswap(v, 64); >> +#else >> +# error Unknown sizeof long >> +#endif > > Is there any reason this can't be simplified to something like: > >

Re: [Qemu-devel] [PATCH v2] bswap: Fix width of swap in leul_to_cpu

2013-02-12 Thread Jay Foad
> @@ -458,7 +458,15 @@ static inline void cpu_to_32wu(uint32_t *p, uint32_t v) > > static inline unsigned long leul_to_cpu(unsigned long v) > { > -return le_bswap(v, HOST_LONG_BITS); > +/* In order to break an include loop between here and > + qemu-common.h, don't rely on HOST_LONG_

Re: [Qemu-devel] [PATCH v2] bswap: Fix width of swap in leul_to_cpu

2013-02-06 Thread Anthony Liguori
Applied. Thanks. Regards, Anthony Liguori

Re: [Qemu-devel] [PATCH v2] bswap: Fix width of swap in leul_to_cpu

2013-02-02 Thread Andreas Färber
Am 01.02.2013 23:26, schrieb Richard Henderson: > The misnamed HOST_LONG_BITS is really HOST_POINTER_BITS. Here we're > explicitly using an unsigned long, rather than uintptr_t, so it is > more correct to select the swap size via ULONG_MAX. > > Signed-off-by: Richard Henderson Acked-by: Andreas

[Qemu-devel] [PATCH v2] bswap: Fix width of swap in leul_to_cpu

2013-02-01 Thread Richard Henderson
The misnamed HOST_LONG_BITS is really HOST_POINTER_BITS. Here we're explicitly using an unsigned long, rather than uintptr_t, so it is more correct to select the swap size via ULONG_MAX. Signed-off-by: Richard Henderson --- include/qemu/bswap.h | 12 ++-- 1 file changed, 10 insertions(+