From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752521AbcGODLA (ORCPT ); Thu, 14 Jul 2016 23:11:00 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:38102 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752481AbcGODK7 (ORCPT ); Thu, 14 Jul 2016 23:10:59 -0400 Date: Thu, 14 Jul 2016 21:10:46 -0600 From: Jason Gunthorpe To: Andrey Pronin Cc: Jarkko Sakkinen , Peter Huewe , Marcel Selhorst , tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, groeck@chromium.org, smbarber@chromium.org, dianders@chromium.org Subject: Re: [PATCH 2/2] tpm: fix byte-order for the value read by tpm2_get_tpm_pt Message-ID: <20160715031046.GC9347@obsidianresearch.com> References: <1468544838-9990-1-git-send-email-apronin@chromium.org> <1468544838-9990-3-git-send-email-apronin@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468544838-9990-3-git-send-email-apronin@chromium.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.151 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 14, 2016 at 06:07:18PM -0700, Andrey Pronin wrote: > Change-Id: I7d71cd379b1a3b7659d20a1b6008216762596590 > Signed-off-by: Andrey Pronin > 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 > +++ 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); Huh. Jarkko: Are you running sparse on the tpm stuff? The annotations look right here, sparse should have complained on this? Andrey, did sparse complain here or is there something more serious wrong as well?? Reviewed-by: Jason Gunthorpe Jason