Received: by 10.223.185.116 with SMTP id b49csp6295047wrg; Wed, 28 Feb 2018 07:08:08 -0800 (PST) X-Google-Smtp-Source: AH8x225pqlAloFX+0Kj0x5foMbO1AW4tOAA1N0dtaGZZ2ngmWw7sUCsdrEaUxIEV17+9j+y550rq X-Received: by 2002:a17:902:8289:: with SMTP id y9-v6mr18236252pln.242.1519830488437; Wed, 28 Feb 2018 07:08:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519830488; cv=none; d=google.com; s=arc-20160816; b=sgfkEEAWglAEkuN89kzXWSHKDrJz8BHvqi+wLiUjNAerFO4lKxhuqQQBSwYHq/hBCY 7ecBvDviBqorrlsXA289PXoai4ouq169B/OyGmsAw8z3K9ZU5SPqKuFUV5JZUTZFUBWH WbxGR7MnM+yKoWTnKwBIqUBJEjLHlUQSZ+rEd0JWO3NDYmtin7Cb6/i/Np//0bpGOCBo 5MhFm/qNQ2HZtXQenVcq6FLipkJw+fxRToEBJPLcZP3zgHZPf0Lj3b5y0IUlCXH395tN qwF65rmA/1TrxO4NpX5x8QNsyMr9ZQL4sxCqfZfPCZlAmR3Y3DBdALLs0RSFgpT7WaVD l/lw== 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=sShHYocsU5D7qzvUUrudK1VBcyv6+kya8QubkxNqVmU=; b=L3VDy2uqshnpjoXjtHtS5IJocOEA8dBedAqyzhMO9v0c6OAliKJzVSCW99HjRx2iGg jla39NjxZY5C5o0HgNydkrPSV7CJpaK5npC7Un8v1Dmf4m7qGzIrwOejOVfp5Zg1E7Hx R1RMnyMGdrajchFDr/UwrhV/tzRlVmAPSDAzr4fZJ6mm+IIIE4mLqC4AgkLkJkqdJ+t/ YpX0TLRdu/2e9+gOPs+8L7p7iAtoO+4qhC/jjlKfGIw3x15G8BgHpDU1f9Sb2XRiaDul Jg0tuphUKQpO+QmxpsbnxgZq9l66Ct3Cy+yeCi/Q4geAeULi4K089tL0f2y7WIoDkBu/ o1eA== 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 d15-v6si1471486pln.186.2018.02.28.07.07.53; Wed, 28 Feb 2018 07:08:08 -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 S1752851AbeB1PGi (ORCPT + 99 others); Wed, 28 Feb 2018 10:06:38 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45202 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752250AbeB1PGg (ORCPT ); Wed, 28 Feb 2018 10:06:36 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 336048424D; Wed, 28 Feb 2018 15:06:35 +0000 (UTC) Received: from localhost (ovpn-112-57.ams2.redhat.com [10.36.112.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 736F11134CD2; Wed, 28 Feb 2018 15:06:29 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: linux-kernel@vger.kernel.org Cc: arnd@arndb.de, 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 v16 03/11] fw_cfg: fix sparse warning reading FW_CFG_ID Date: Wed, 28 Feb 2018 16:06:07 +0100 Message-Id: <20180228150615.17317-4-marcandre.lureau@redhat.com> In-Reply-To: <20180228150615.17317-1-marcandre.lureau@redhat.com> References: <20180228150615.17317-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.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 28 Feb 2018 15:06:35 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 28 Feb 2018 15:06:35 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 Use a restricted type for reading FW_CFG_ID, fixing sparse warning: drivers/firmware/qemu_fw_cfg.c:540:22: warning: cast to restricted __le32 Signed-off-by: Marc-André Lureau --- drivers/firmware/qemu_fw_cfg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c index 7978844f6b37..0eb155fdfb35 100644 --- a/drivers/firmware/qemu_fw_cfg.c +++ b/drivers/firmware/qemu_fw_cfg.c @@ -530,6 +530,7 @@ static inline void fw_cfg_kobj_cleanup(struct kobject *kobj) static int fw_cfg_sysfs_probe(struct platform_device *pdev) { int err; + __le32 rev; /* NOTE: If we supported multiple fw_cfg devices, we'd first create * a subdirectory named after e.g. pdev->id, then hang per-device @@ -555,8 +556,8 @@ static int fw_cfg_sysfs_probe(struct platform_device *pdev) goto err_probe; /* get revision number, add matching top-level attribute */ - fw_cfg_read_blob(FW_CFG_ID, &fw_cfg_rev, 0, sizeof(fw_cfg_rev)); - fw_cfg_rev = le32_to_cpu(fw_cfg_rev); + fw_cfg_read_blob(FW_CFG_ID, &rev, 0, sizeof(rev)); + fw_cfg_rev = le32_to_cpu(rev); err = sysfs_create_file(fw_cfg_top_ko, &fw_cfg_rev_attr.attr); if (err) goto err_rev; -- 2.16.1.73.g5832b7e9f2