<font size=2 face="sans-serif">Hi Jeremy,</font><br><font size=2 face="sans-serif">Thanks. </font><br><font size=2 face="sans-serif">(I missed Cyril's mail.) </font><br><font size=2 face="sans-serif">I'd use the conversion function to change
my commit.</font><br><br><font size=3 color=#424282 face="Calibri">Regards,</font><br><br><font size=3 color=#424282 face="Calibri">William Li ( Li Nan, Àîéª
) </font><br><font size=3 color=#424282 face="Calibri"> </font><br><br><font size=3 color=#424282 face="Calibri">Firmware Engineering Professional</font><br><font size=3 color=#424282 face="Calibri">OpenPower AE Team | IBM System
& Technology Lab</font><br><font size=3 color=#424282 face="Calibri">Mobile: +86-186-1081 6605</font><br><br><font size=3 color=#424282 face="Calibri">Beijing, China</font><br><br><br><br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">Jeremy Kerr <jk@ozlabs.org></font><br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">OpenBMC Patches <openbmc-patches@stwcx.xyz>,
openbmc@lists.ozlabs.org</font><br><font size=1 color=#5f5f5f face="sans-serif">Cc:
</font><font size=1 face="sans-serif">Nan KX Li/China/IBM@IBMCN</font><br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">05/26/2016 10:27</font><br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">Re: [PATCH openpower-host-ipmi-oem
v2] Fix endianness issue5</font><br><hr noshade><br><br><br><tt><font size=2>Hi Nan,<br><br>You seem to have a minor typo in the commit title there.<br><br>> -
// TODO: Issue 5: This is not endian-safe.<br>> -
short *recid = (short*) &reqptr->selrecordls;<br>> -
short *offset = (short*) &reqptr->offsetls;<br>> +<br>> +
unsigned short recid = ((unsigned short) reqptr->selrecordms)
<< 8 + reqptr->selrecordls;<br>> +
unsigned short offset = ((unsigned short) reqptr->offsetms) <<
8 + reqptr->offsetls;<br><br>That won't do the endian conversion correctly. Can you use one of the<br>existing endian conversion functions?<br><br>The le16toh() function is probably what you want here, from endian.h.<br><br>Also, be careful of the change from 'short' to 'unsigned short'.<br><br>Regards,<br><br><br>Jeremy<br><br></font></tt><br><BR>