lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210412115302.95686-1-bence98@sch.bme.hu>
Date:   Mon, 12 Apr 2021 11:53:02 +0000
From:   Bence Csókás <bence98@....bme.hu>
To:     <linux-i2c@...r.kernel.org>
CC:     Bence Csókás <bence98@....bme.hu>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH] 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, therefore it should be u16 instead.

Signed-off-by: Bence Csókás <bence98@....bme.hu>

---
 drivers/i2c/busses/i2c-cp2615.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-cp2615.c b/drivers/i2c/busses/i2c-cp2615.c
index 78cfecd1ea76..2824f4ba7131 100644
--- a/drivers/i2c/busses/i2c-cp2615.c
+++ b/drivers/i2c/busses/i2c-cp2615.c
@@ -38,7 +38,9 @@ enum cp2615_iop_msg_type {
 };
 
 struct __packed cp2615_iop_msg {
-	__be16 preamble, length, msg;
+	/* always 0x2A2A, which is the same in either endianness */
+	u16 preamble;
+	__be16 length, msg;
 	u8 data[MAX_IOP_PAYLOAD_SIZE];
 };
 
-- 
2.31.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ