Received: by 10.223.185.116 with SMTP id b49csp743718wrg; Wed, 14 Feb 2018 06:24:06 -0800 (PST) X-Google-Smtp-Source: AH8x2260zotAenNwdPeOqhOn8DsQ1W8u3Ee4ZNvYONjfbBXNgP0NiQuUzIMMDkJa2Hn24OKTVR84 X-Received: by 2002:a17:902:66e6:: with SMTP id e93-v6mr4578881plk.173.1518618246133; Wed, 14 Feb 2018 06:24:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518618246; cv=none; d=google.com; s=arc-20160816; b=KY0CjMwrSUPy6MgCfT5YtL1aJLko/8D5vUrmqRFG542Ubwg7qTssHvUw//R8MslnE+ 0xDcp73EQ+knuANddS9Nv1HAf1Sg7eaQ5XQbF+meSO0ySeyrEh5PKJYk/Q+uN7gKzk2I sYTxWAOATGT7jTLU3APoRHFvpiQist4u1lZ0KjE7OVYBWR+BaHI/y11UF41/gugwnBw9 apVg6MF+cD5+QSnwSu0NtnquFdbj2wbBQYZVZotKBvRrkAT5QxTswlWRCTRhMZB52znf I6shtmGr0J+nWdZzG73+58CnOohxPGGGqGPcNg47vXcizEmKbizD9UQOq/07yYwGB15u CVVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=TIQNYqKlxAU9zRlOG7SEB2my5B3uC0G9FNMFNMH3t9s=; b=id4B3UmsCpRswjCcSGK915EUJT+XvQ9xJATcsZdvfnXPjn66PKK28ewJ+5RxGiuCGM Kx9/GEp4kFeGWU58ddI8n/uJlV8p7Lr7gBjZKaFat1YfQQnDkxpMjUEqqrOqrGlQoYZ8 nhlMnDt4VhIhD+61WsSo9Sg2x/oX74B6ZBoOZyV4w+UE/24f5UTTKwAppfYLmUf0P4dh HPrLLpzqklZP1QKBOASlKQxrg+D0U7D28TR9L/gdasr9wV78CTN/C9/pjdEbMUbs0OXu AHm8ftPRt9NiPakFvL9VMs1vAUGB1c/o/J1w2hTLpUnvYI77dSuipKap9gY5WTA2tN86 cNHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c3-v6si1001965pld.174.2018.02.14.06.23.51; Wed, 14 Feb 2018 06:24:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030730AbeBNOVQ (ORCPT + 99 others); Wed, 14 Feb 2018 09:21:16 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36124 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030578AbeBNOS5 (ORCPT ); Wed, 14 Feb 2018 09:18:57 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 816F140201A0; Wed, 14 Feb 2018 14:18:56 +0000 (UTC) Received: from localhost (ovpn-112-21.ams2.redhat.com [10.36.112.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21A7321411B6; Wed, 14 Feb 2018 14:18:56 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: linux-kernel@vger.kernel.org Cc: bhe@redhat.com, slp@redhat.com, mst@redhat.com, somlo@cmu.edu, xiaolong.ye@intel.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v14 3/9] fw_cfg: fix sparse warnings in fw_cfg_sel_endianness() Date: Wed, 14 Feb 2018 15:18:44 +0100 Message-Id: <20180214141850.4017-4-marcandre.lureau@redhat.com> In-Reply-To: <20180214141850.4017-1-marcandre.lureau@redhat.com> References: <20180214141850.4017-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 14 Feb 2018 14:18:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 14 Feb 2018 14:18:56 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'marcandre.lureau@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function is used for both LE & BE target type, use __force casting. Fixes: $ make C=1 CF=-D__CHECK_ENDIAN__ drivers/firmware/qemu_fw_cfg.o drivers/firmware/qemu_fw_cfg.c:55:33: warning: restricted __be16 degrades to integer drivers/firmware/qemu_fw_cfg.c:55:52: warning: restricted __le16 degrades to integer Signed-off-by: Marc-André Lureau --- drivers/firmware/qemu_fw_cfg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c index 90f467232777..85e693287d87 100644 --- a/drivers/firmware/qemu_fw_cfg.c +++ b/drivers/firmware/qemu_fw_cfg.c @@ -52,7 +52,9 @@ static DEFINE_MUTEX(fw_cfg_dev_lock); /* pick appropriate endianness for selector key */ static inline u16 fw_cfg_sel_endianness(u16 key) { - return fw_cfg_is_mmio ? cpu_to_be16(key) : cpu_to_le16(key); + return fw_cfg_is_mmio ? + (u16 __force)cpu_to_be16(key) : + (u16 __force)cpu_to_le16(key); } /* read chunk of given fw_cfg blob (caller responsible for sanity-check) */ -- 2.16.1.73.g5832b7e9f2