From patchwork Mon Apr 12 11:53:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmVuY2UgQ3PDs2vDoXM=?= X-Patchwork-Id: 419681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4A46C433B4 for ; Mon, 12 Apr 2021 11:35:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F05461287 for ; Mon, 12 Apr 2021 11:35:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240007AbhDLLfc (ORCPT ); Mon, 12 Apr 2021 07:35:32 -0400 Received: from mail.sch.bme.hu ([152.66.249.140]:22854 "EHLO mail.sch.bme.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237565AbhDLLfb (ORCPT ); Mon, 12 Apr 2021 07:35:31 -0400 Received: from Exchange2016-1.sch.bme.hu (152.66.249.140) by Exchange2016-1.sch.bme.hu (152.66.249.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2176.2; Mon, 12 Apr 2021 13:35:11 +0200 Received: from Cognitio.sch.bme.hu (152.66.211.220) by Exchange2016-1.sch.bme.hu (152.66.249.140) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 12 Apr 2021 13:35:11 +0200 From: =?utf-8?b?QmVuY2UgQ3PDs2vDoXM=?= To: CC: =?utf-8?b?QmVuY2UgQ3PDs2vDoXM=?= , Subject: [PATCH] Fix 'assignment to __be16' warning Date: Mon, 12 Apr 2021 11:53:02 +0000 Message-ID: <20210412115302.95686-1-bence98@sch.bme.hu> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 --- 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]; };