i2c: cp2615: Fix 'assignment to __be16' warning
Subsystems (2)
Bence Csókás
maintainerPATCH v2 1/1 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]>
--- drivers/i2c/busses/i2c-cp2615.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-cp2615.c +1 -1
@@ -85,7 +85,7 @@ static int cp2615_init_iop_msg(struct cp2615_iop_msg *ret, enum cp2615_iop_msg_tif (!ret)return -EINVAL ; - ret->preamble =0x2A2A ; + ret->preamble =htons (0x2A2AU ); ret->length =htons (data_len +6 ); ret->msg =htons (msg);if (data && data_len)
Signature · 1 line
2.42.0
Wolfram Sang
AppliedQuoted 5 lines · Bence Csókás
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 callhtons()explicitly.Signed-off-by Bence Csókás <[email protected]>
Applied to for-current, thanks!