Received: by 10.223.185.116 with SMTP id b49csp741094wrg; Wed, 14 Feb 2018 06:21:47 -0800 (PST) X-Google-Smtp-Source: AH8x226fhDuh+qPdz9GnQNIPHTAGJ7dMQYwHZ6oYFurNrn5uTh4pU6KtUhLHAHxJ0BfDxMH0Wp5v X-Received: by 2002:a17:902:6946:: with SMTP id k6-v6mr4673830plt.205.1518618107624; Wed, 14 Feb 2018 06:21:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518618107; cv=none; d=google.com; s=arc-20160816; b=gyiC0ptbgRCgAcdmp5INRwUYZFm6Fu/57YIDC6oFF1aOBSU1WZLR+3M0L3GswEENoN k7adxQfvIKBfYPpHd38AccNng275fMkRPTI4vDGil/Lb9NDxbdpXKD4vK/gOBVpDZjJS 7rpesZL23PG+UM2M/7QHi6NiJA2jl8p69ahOp+Vo3ZEEbcFBZCiD0ywT1CfOHzECj/FA /wtS/sKd9IhpkAiiMcjJdP+YPFpfa7wPaduETX60QWRPFgyWyVq9FSS+LmEKZ4JCSckH kKL85TEEx2of1tkGAj+Hmy24i6wLZUAs7LsVBqI26hOUGqnmnLA2GVSWgW/ePaM3yWTK ueEQ== 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=gHG4CjgTv/Kbv5fi2kQWOBY8oWQ3/1lXN+PjG+fVXso=; b=zGdFOEUYDwlxFB4TNJgSpKAcSeVGCIXuBrRAEdB6tMRdJwdDjo3SxOFRROW18Mzmn1 BZRLIg0QvibFAkhczReBKsqYQcAPf/CTfQ97MYBmL8x2woG+vJUxBAJJHY0r//s9vHxX 9VbvTuJqM3/drhkF4Y68CjJL2Wm8W8oASjTUhUWiEjXNWXXZM8crXAQNwqWnzFKJHaOU m4HUDvLckXK9dxf+jRisS3XYAiB1sx+JbbYqykUOgQdrL2+2VT1l7IylIAzpxC3O00Rv cs8N93eFsu5D4sbwNZLXYuK0nm9t9HO7MElrMCf5LUKMSunvgf3vouF1xY57LWzuX9CA 3Nmg== 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 d12-v6si2299399plr.442.2018.02.14.06.21.32; Wed, 14 Feb 2018 06:21:47 -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 S1030686AbeBNOTM (ORCPT + 99 others); Wed, 14 Feb 2018 09:19:12 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36140 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030288AbeBNOTK (ORCPT ); Wed, 14 Feb 2018 09:19:10 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3349240201A0; Wed, 14 Feb 2018 14:19:10 +0000 (UTC) Received: from localhost (ovpn-112-21.ams2.redhat.com [10.36.112.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0225AAE7A1; Wed, 14 Feb 2018 14:19:04 +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 5/9] fw_cfg: fix sparse warning reading FW_CFG_ID Date: Wed, 14 Feb 2018 15:18:46 +0100 Message-Id: <20180214141850.4017-6-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.79 on 10.11.54.5 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:19:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 14 Feb 2018 14:19:10 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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 8ad19086e5c5..4c4813409447 100644 --- a/drivers/firmware/qemu_fw_cfg.c +++ b/drivers/firmware/qemu_fw_cfg.c @@ -511,6 +511,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 @@ -536,8 +537,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