Received: by 10.223.185.116 with SMTP id b49csp807539wrg; Fri, 16 Feb 2018 07:30:45 -0800 (PST) X-Google-Smtp-Source: AH8x225St1496pHJ7OJE8jt039pbvXkWxC75Z1Nd2JFgBmLzuD6egUFzV+d8rgfNCSV6SecllyvF X-Received: by 10.99.66.65 with SMTP id p62mr2509731pga.378.1518795045631; Fri, 16 Feb 2018 07:30:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518795045; cv=none; d=google.com; s=arc-20160816; b=LRw3zaFqNcvl81JZMRF8bFGZnGPuZyFED+eongp478LVjVo7cbDPLg78LdNYdgEPZq uuDJylH5RMSD9i66cL8BQTphLPDJbULHYjgBWGAYF8YcwU5qfzKXTY6mBbyQ42GGSbj3 iuw3bc5MkPpjQ8CpooeRwq5e+wb5wYcmjL8tRXvsMvjbL4dTzoGf7n8dcGAz2Fj7x28z xo/32vu14HQAZ/HKM6X0AkKgQIuwoFI41pugw3DYVMGHgixnWV8snxWrec4n6ctsVbaX PAqMgbTsTidqcoF6Gbq/gJjxKpDYl9NrqWpD+W1qfcjql06vKTGq2FRpaRAb0rSu9WZ2 +WFw== 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=JRXfYH5XsdAyLx+avvfJI58Z7b4y5GzuGdozkNAyQto=; b=zl1y5f33i6ZP2h6cSBrZ/54QVlZr9nPhBDopF7A7LKObQe23aP5/cDXOgxtt4HHpbC 6tQG0U9AquG4qVOcxUm4IJgTmEGMg4KuNJaVHU8cUZS4BXUmOGx2gV6mMsciGh9wbIaW 5j6/hn7ovSnoxHdTqZvtarQWFHU/vzdIPLpsXMK1m6hCTKHSFWtymXdHO4tfnkJiTFJ0 i3HnAhYpo2TKQyzDdtuNIy8F8YVxSfkLNaI97mjGuY6PRan2HakGADmzQY6DYfY3Xq0a Hz60ZJMM5BEdAT+8eTXgzVmTM8RBq/dI9k1Px6T1U+w/sbweRqiLc3zisojnSxZgYMdj XQAA== 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 z1si1206378pgb.461.2018.02.16.07.30.30; Fri, 16 Feb 2018 07:30:45 -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 S1167421AbeBOVfF (ORCPT + 99 others); Thu, 15 Feb 2018 16:35:05 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54022 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1163332AbeBOVdj (ORCPT ); Thu, 15 Feb 2018 16:33:39 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 174438182D27; Thu, 15 Feb 2018 21:33:39 +0000 (UTC) Received: from localhost (ovpn-112-19.ams2.redhat.com [10.36.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id B8D412024CA7; Thu, 15 Feb 2018 21:33:38 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: linux-kernel@vger.kernel.org Cc: slp@redhat.com, bhe@redhat.com, mst@redhat.com, somlo@cmu.edu, xiaolong.ye@intel.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v15 05/11] fw_cfg: fix sparse warning reading FW_CFG_ID Date: Thu, 15 Feb 2018 22:33:06 +0100 Message-Id: <20180215213312.29234-6-marcandre.lureau@redhat.com> In-Reply-To: <20180215213312.29234-1-marcandre.lureau@redhat.com> References: <20180215213312.29234-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.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 15 Feb 2018 21:33:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 15 Feb 2018 21:33:39 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.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 6ee12c9e079a..71672cb8c427 100644 --- a/drivers/firmware/qemu_fw_cfg.c +++ b/drivers/firmware/qemu_fw_cfg.c @@ -512,6 +512,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 @@ -537,8 +538,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