Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1693643pxb; Mon, 12 Apr 2021 04:36:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrsxpVya/ECrYmlsRlE5RSC926mL1st1pSpvm1LG6k+ZdslvRHaJxeg0VMaCD2Qo/zkkxw X-Received: by 2002:a05:6402:394:: with SMTP id o20mr29489868edv.10.1618227411558; Mon, 12 Apr 2021 04:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618227411; cv=none; d=google.com; s=arc-20160816; b=zR/ZFwfWesYD086RR5EwmzwiBu8TnGJ6me97mnsIvQYjbYzK6AwC4oNyXjz2ch7Rb2 OWROEkRM4WriHzNKRkVYvyaTLUqYroLBhDdkNtAFoZ5a481dROZYtvnmBOZhED4OggoI XKcv+aVi3CM1DF9/koTqUqyLivsSpsrRB8RA4zTtMiszcqhEUuZ9knah8pEGEycJZDSy aHwaRV11tLYITFlA3o8NdAGNcfMBQMH2CD5dMDBWKoF9zgLjn9Cj4gryGTs4dWrR5/QM aABgO8PZ2ibKKxV32ASyzKsh3f/mWyPxBvYVFlSZiKkJqJLNXibEczPh/gH/N9qFqRms TGEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=7LmWGOlzVKaXi3YWysvs+RAXvJwhBqGBT0ZzvP6DjmE=; b=oX0thfVQmUEKg9i64rcMfXBxYmAKri06yszSXMTlWV5OvLWXKADpxtYisiuPCsGSuW a7BzV9jDJ7tjd2TpXHL0hGPJAsRVnHt2fazlqvrfirHjC9MYTAb/b4NL0BqNB/kBF6LP N45WSG4cBolkOWh1NfPuNvpO4dV2DYFJOCuKnTf9+iM2XEbUYqskIQaCpCg9BZvdYM0p 4433lsKiDqTN+93Gy2/Z+kAHqG5Sn1qvbVFRSAyuOnjId+PqpDMBXbi52MDLOREvcay9 ION2oNEVpw5EAYR/XMIf3DAXBnARuuDeI4IvDEBAQ4sylm6Ag/cM/Bu2tkLUFCXiVMNw HA9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=bme.hu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r21si7456177ejc.339.2021.04.12.04.36.28; Mon, 12 Apr 2021 04:36:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=bme.hu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240483AbhDLLfc (ORCPT + 99 others); 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?q?Bence=20Cs=C3=B3k=C3=A1s?= To: CC: =?UTF-8?q?Bence=20Cs=C3=B3k=C3=A1s?= , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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]; }; -- 2.31.0