16 Oct
2015
16 Oct
'15
1:20 p.m.
On Fri, 16 Oct 2015, Takashi Iwai wrote:
unsigned int length; u32 packet_length = cpu_to_le32((u32)length);
No, other way round: the problem is that packet_length is declared as u32 while it should be __le32. The length variable must be CPU endian, of course, as you apply C arithmetic.
So the cast shouldn't be necessary then, i.e. just simply:
unsigned int length; __le32 packet_length = cpu_to_le32(length);
?
It makes sense to me (although that doesn't necessarily make it right. :-) )
/Ricard
--
Ricard Wolf Wanderlöf ricardw(at)axis.com
Axis Communications AB, Lund, Sweden www.axis.com
Phone +46 46 272 2016 Fax +46 46 13 61 30