From patchwork Fri Jul 15 01:07:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Pronin X-Patchwork-Id: 9230963 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 290B460572 for ; Fri, 15 Jul 2016 01:07:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19F192830A for ; Fri, 15 Jul 2016 01:07:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E19028327; Fri, 15 Jul 2016 01:07:32 +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 lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7B3F12830A for ; Fri, 15 Jul 2016 01:07:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bNrbF-0001dc-6z; Fri, 15 Jul 2016 01:07:29 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bNrbE-0001dX-NW for tpmdd-devel@lists.sourceforge.net; Fri, 15 Jul 2016 01:07:28 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of chromium.org designates 209.85.192.171 as permitted sender) client-ip=209.85.192.171; envelope-from=apronin@chromium.org; helo=mail-pf0-f171.google.com; Received: from mail-pf0-f171.google.com ([209.85.192.171]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) id 1bNrbD-00045z-UQ for tpmdd-devel@lists.sourceforge.net; Fri, 15 Jul 2016 01:07:28 +0000 Received: by mail-pf0-f171.google.com with SMTP id p64so1626551pfb.1 for ; Thu, 14 Jul 2016 18:07:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GmWAB5oTS9rSURpL09peVV9GyXxFz+IsWmS6yWASOvY=; b=ZeYDW4UZOrzGT96y4p+GdKheLB3kl7WRVHM9tRhuH61F900inmAFTFvTvpclzziM4j ApH6g7nG2jIZ0WNNm3T8hloHlSLTPcrcw8S+eIpi0ZYf2AAWlx+trTtVGyQAOoijjfvO RS6QJCPkfx5/4OETf4wLOzjIXP/HfjIKojwgR74ILZi9BWEaekq3T849wRHz9ig7O5F+ ksY15UHTdZY3Mfebi7KWvy5pUf9cyQ1m6R+OmARQ7AFOL9jWvJdqCO6fOWlxqS2tQdDg EnUhhGPIiQa3KwtWvzNdahS1LwgWMuZgBg7Zjjqh80zTPDduDgz36kJlzf/relKPJp3s TkSQ== X-Gm-Message-State: ALyK8tKBDDits2duJcIO6aG2t6FFRwB+b3gMQPgWH4ZguQ735/Plxm9zKy8pzHdoP9+OJb8Y X-Received: by 10.98.85.5 with SMTP id j5mr17033969pfb.81.1468544842362; Thu, 14 Jul 2016 18:07:22 -0700 (PDT) Received: from apronin0.mtv.corp.google.com ([172.22.64.136]) by smtp.gmail.com with ESMTPSA id b90sm7104269pfc.29.2016.07.14.18.07.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jul 2016 18:07:22 -0700 (PDT) From: Andrey Pronin To: Jarkko Sakkinen Date: Thu, 14 Jul 2016 18:07:18 -0700 Message-Id: <1468544838-9990-3-git-send-email-apronin@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1468544838-9990-1-git-send-email-apronin@chromium.org> References: <1468544838-9990-1-git-send-email-apronin@chromium.org> X-Headers-End: 1bNrbD-00045z-UQ Cc: dianders@chromium.org, linux-kernel@vger.kernel.org, smbarber@chromium.org, tpmdd-devel@lists.sourceforge.net, groeck@chromium.org Subject: [tpmdd-devel] [PATCH 2/2] tpm: fix byte-order for the value read by tpm2_get_tpm_pt X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: tpmdd-devel-bounces@lists.sourceforge.net X-Virus-Scanned: ClamAV using ClamSMTP Change-Id: I7d71cd379b1a3b7659d20a1b6008216762596590 Signed-off-by: Andrey Pronin Reviewed-by: Jason Gunthorpe Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/tpm2-cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c index a1673dc..a88b31e 100644 --- a/drivers/char/tpm/tpm2-cmd.c +++ b/drivers/char/tpm/tpm2-cmd.c @@ -703,7 +703,7 @@ ssize_t tpm2_get_tpm_pt(struct tpm_chip *chip, u32 property_id, u32 *value, rc = tpm_transmit_cmd(chip, &cmd, sizeof(cmd), desc); if (!rc) - *value = cmd.params.get_tpm_pt_out.value; + *value = be32_to_cpu(cmd.params.get_tpm_pt_out.value); return rc; }