megaraid_sas : Endianness related bug fixes and code optimization
Quoted 10 lines
-----Original Message-----
From: Christoph Hellwig [mailto:[email protected]]
Sent: Thursday, January 08, 2015 4:09 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/8]megaraid_sas: Endianness related bug fixes and code optimization
Quoted 12 lines
Review
Quoted 10 lines
(quoted diff) +2
-7-#if defined(__BIG_ENDIAN_BITFIELD) - u32 MessageAddress1:24; /* bits 31:8*/ - u32 RequestFlags:8; -#else u32 RequestFlags:8; - u32 MessageAddress1:24; /* bits 31:8*/ -#endif - u32 MessageAddress2; /* bits 61:32 */ + u32 MessageAddress1:24; + u32 MessageAddress2;Doesn't this break architectures that set
__BIG_ENDIAN_BITFIELD?
Earlier code create the req_desc in machine format and later we convert it into LE format (as FW wants the data In LE format). Now with this change we just simplify code, which will first convert req_desc to LE format and set the MessageAddres1 and RequestFlags in LE format. Eventually this will pass same address/flag frame as earlier code does, but giving some readability.
We have tested this on PPC and this works fine. Actually, this MFA frame will be fired only at driver load time(for firmware initialization), so if this setting is not appropriate FW init will fail. We do not refer MFIAIo anywhere else.
Thanks,
Sumit