From patchwork Sun Mar 4 12:12:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Winkler, Tomas" X-Patchwork-Id: 10257625 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1057160211 for ; Sun, 4 Mar 2018 12:15:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0200A28796 for ; Sun, 4 Mar 2018 12:15:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAFE9287A7; Sun, 4 Mar 2018 12:15:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C46328796 for ; Sun, 4 Mar 2018 12:15:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932275AbeCDMPn (ORCPT ); Sun, 4 Mar 2018 07:15:43 -0500 Received: from mga04.intel.com ([192.55.52.120]:9158 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932258AbeCDMPl (ORCPT ); Sun, 4 Mar 2018 07:15:41 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Mar 2018 04:15:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,422,1515484800"; d="scan'208";a="34508829" Received: from twinkler-lnx.jer.intel.com ([10.12.91.43]) by fmsmga004.fm.intel.com with ESMTP; 04 Mar 2018 04:15:39 -0800 From: Tomas Winkler To: Jarkko Sakkinen , Jason Gunthorpe Cc: Alexander Usyskin , linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Tomas Winkler Subject: [PATCH 3/3] tpm_crb: use __le64 annotated variable for response buffer address Date: Sun, 4 Mar 2018 14:12:05 +0200 Message-Id: <20180304121205.16934-3-tomas.winkler@intel.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180304121205.16934-1-tomas.winkler@intel.com> References: <20180304121205.16934-1-tomas.winkler@intel.com> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP This suppresses sparse warning drivers/char/tpm/tpm_crb.c:558:18: warning: cast to restricted __le64 Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm_crb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index acfcdc6f31af..29fecdea0b2d 100644 --- a/drivers/char/tpm/tpm_crb.c +++ b/drivers/char/tpm/tpm_crb.c @@ -489,6 +489,7 @@ static int crb_map_io(struct acpi_device *device, struct crb_priv *priv, u32 pa_high, pa_low; u64 cmd_pa; u32 cmd_size; + __le64 __rsp_pa; u64 rsp_pa; u32 rsp_size; int ret; @@ -554,8 +555,8 @@ static int crb_map_io(struct acpi_device *device, struct crb_priv *priv, goto out; } - memcpy_fromio(&rsp_pa, &priv->regs_t->ctrl_rsp_pa, 8); - rsp_pa = le64_to_cpu(rsp_pa); + memcpy_fromio(&__rsp_pa, &priv->regs_t->ctrl_rsp_pa, 8); + rsp_pa = le64_to_cpu(__rsp_pa); rsp_size = crb_fixup_cmd_size(dev, &io_res, rsp_pa, ioread32(&priv->regs_t->ctrl_rsp_size));