Skip to content

Commit bdba49c

Browse files
bence98wsakernel
authored andcommitted
i2c: cp2615: Fix 'assignment to __be16' warning
While the preamble field _is_ technically big-endian, its value is always 0x2A2A, which is the same in either endianness. However, to avoid generating a warning, we should still call `htons()` explicitly. Signed-off-by: Bence Csókás <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent cc9c542 commit bdba49c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-cp2615.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static int cp2615_init_iop_msg(struct cp2615_iop_msg *ret, enum cp2615_iop_msg_t
8585
if (!ret)
8686
return -EINVAL;
8787

88-
ret->preamble = 0x2A2A;
88+
ret->preamble = htons(0x2A2AU);
8989
ret->length = htons(data_len + 6);
9090
ret->msg = htons(msg);
9191
if (data && data_len)

0 commit comments

Comments
 (0)