On Sat, May 08, 2021 at 12:29:15AM +0200, Heiner Kallweit wrote: > + > + if (len == 4) { > + put_unaligned_le32(val, buf); > + } else { > + cpu_to_le32s(&val); > + memcpy(buf, (u8 *)&val + skip, len); cpu_to_le32s is a horrible API that breaks endianess annotations. Is the intent of this code to only put 16 bits in? Why not something like: switch (len) { case 4: put_unaligned_le32(val, buf); break; case 2: put_unaligned_le16(val, buf + 2); break; case 1: buf[3] = val; break; }