On 01/08/2014 06:34 PM, Alexander Graf wrote: >>> if (kvmppc_is_bigendian(vcpu)) { >>> /* Default endianness is "big endian". */ >>> is_bigendian = is_default_endian; >>> } else { >>> /* Default endianness is "little endian". */ >>> is_bigendian = !is_default_endian; >>> } >>> >>> and suddenly things become reasonably clear for everyone I'd hope. >> I think something like : >> >> + if (kvmppc_need_byteswap(vcpu)) >> + is_bigendian = !is_bigendian; >> + >> >> has a small footprint and is clear enough ? >> >> Thanks for the inputs, a (single) patch follows > > Not really. The argument means "use the normal endianness you would usually use for memory access". It doesn't mean little or big endian yet, as that's what we determine later. > > Keep in mind that gcc is really good at optimizing code like this, so please don't try to be smart with variable reusage or any of the likes. In assembly this will all look identical, but the C representation should be as self-documenting as possible. Arg. I should have waited a few minutes. No problem. I will resend with your "is_default_endian" proposal. Cheers, C. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html