Received: by 10.192.165.156 with SMTP id m28csp1579895imm; Tue, 17 Apr 2018 01:35:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx4803pFKiSFikFVjfwx9dD2+CQ4KOid4fCsMV1UViezLV/EFpqCr0bBfxWVsZGUzDZoy80zz X-Received: by 10.98.26.85 with SMTP id a82mr1167210pfa.21.1523954118330; Tue, 17 Apr 2018 01:35:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523954118; cv=none; d=google.com; s=arc-20160816; b=SLQUAb8+n5ODu+OInsiBtK0fMzmkWw01SAwXW8ZGYBHxwi4W4WJpQ2lWK/3V+vlyHf SsDdMqr1BreTdec6iqLxiB0J7R4hp9WfsUKILKtP65Pi5Se4+h7cdF5bdXO5f/+sworj HC7GUje/P9X49Ic9n1TXWKxb/Bz24TMH8tov8CHi+svGHd0o5qpUoXDAPPbjRBbIeNLa 2VU/YsokOQX+oaSxoh5XEk3O5/wHjPZvP/8Lt99qHgQmSsNG0U3PRf0sIMm/q1AE/uAj tjrc+G2zfEaIpY/1ovHP6APBjIvaYG3pjGQD8MOM+nIW9Ky863scwrKcAJ1Li4sACRr9 cZqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=6nvohFeaSE/ZOXKf1WhyEKsFtMRW1xOSWN4HKGUtMz0=; b=eIJs0VnbeAj5Nkt8CB1AkG+pTGiffW267DatN7Y83vYMNb/EMaVPAkV6f14ou7ZxWF vp2+/4zzi8VobMYdH90ggevn5TZR/pNGkEfBdvPaq3a2nCHa/1AZgaP/u80nykX5BXi7 etbvu0FsKEPjUG1mGTC8ucLbjPyLG2QlV144vztLvKoxOBU9wmFHOKAArUODpseixyrk /iis13xyATWpmzZmAKybhPdqt2aQ/LWB6/DYWtr/6/x+r5w9Nes4ro5Oh/oWYSYQOb9r uj/TBV0AkJtvcSuwUn74T6wUIdCkUHDGBRTd/HprMK9rT99nk2D6k7mATWY9GN7LvZo/ aMSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MrXQ6Ciu; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y20-v6si2579001pll.77.2018.04.17.01.35.03; Tue, 17 Apr 2018 01:35:18 -0700 (PDT) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=MrXQ6Ciu; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752665AbeDQIdG (ORCPT + 99 others); Tue, 17 Apr 2018 04:33:06 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:39213 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751238AbeDQIcp (ORCPT ); Tue, 17 Apr 2018 04:32:45 -0400 Received: by mail-it0-f68.google.com with SMTP id 85-v6so12511194iti.4 for ; Tue, 17 Apr 2018 01:32:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6nvohFeaSE/ZOXKf1WhyEKsFtMRW1xOSWN4HKGUtMz0=; b=MrXQ6CiuFwHzPfyF1xTB6t8pHevULTHA+/izoTSROViYJ7Z/y9TkYjtBzHWv/A53vI vRaDI82ftM7F9a3P8YaXvkEpS3EV5QANiyXx2EuA723Pffa2PbBSTTSzyEP2k4t+Majc OPCFoVlpLOFQZP9LWTF4Qx0lgNlgJB+A+kuYu53Ni4gpuAnmwn8Ww8+HbR9aX2PcGUK2 6iTpLT7bcgZd5wit0BcxHVuUvJUutS6koCCAT8+31gtwtchzfKXE+kz9Dy+arUxVWkXZ iVVthX8lPVjBZHKxZTLWF4MPk8B517WXbkcOSufcZDQ66Xwc3ZpbTylavxXF2ZRaJMnC bSDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6nvohFeaSE/ZOXKf1WhyEKsFtMRW1xOSWN4HKGUtMz0=; b=Iy/XfObEiBQjNX1zIDV50jTD428Sy+OVFr7UscIuQXNa+VvyIo9eYDYs5B8DZ18H+Y YtYBjhBrGD0YiEYE9ynqNv/lrp1sVbm0wuQbMcZ86LooUYoiAoyiH0N9981QbxQvDI1a vqbyH6zojAqL48NJfb6oqCT8JT6H5h5Fdj3wyc742/vH6bUwNBTIdJxFXAb2FXkmzJnd dRof+UicFZVoE9ASw58kI552edmmHnljw0QHgZZ96ZkF14EcbqN81BbTu6VK15mSdRDr vBEKHB4anBVCVrw5mfSDmyaCvhPSvM7a2IW/rpCmmt7f5xBzl80YhIa6t8tOC1kJAON9 hVPA== X-Gm-Message-State: ALQs6tDFyaiTtLW5FQTg/PKq8B7FnENOJDc0IGzlD3bRNqJX0zsAOPzO FzgA7iBDWzosjVUkBL1IP6Wkmbi3/x9MeTWi72ibPPMU X-Received: by 2002:a24:6b10:: with SMTP id v16-v6mr240597itc.13.1523953964610; Tue, 17 Apr 2018 01:32:44 -0700 (PDT) MIME-Version: 1.0 References: <20180412101350.210547-1-tweek@google.com> <20180412101350.210547-2-tweek@google.com> <20180417030202.GA30624@ziepe.ca> In-Reply-To: <20180417030202.GA30624@ziepe.ca> From: Thiebaud Weksteen Date: Tue, 17 Apr 2018 08:32:33 +0000 Message-ID: Subject: Re: [PATCH v2 1/4] tpm: Add explicit endianness cast To: jgg@ziepe.ca Cc: Jarkko Sakkinen , Nayna Jain , linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 17, 2018 at 5:02 AM Jason Gunthorpe wrote: > On Thu, Apr 12, 2018 at 12:13:47PM +0200, Thiebaud Weksteen wrote: > > Signed-off-by: Thiebaud Weksteen > > drivers/char/tpm/tpm_eventlog_of.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/char/tpm/tpm_eventlog_of.c b/drivers/char/tpm/tpm_eventlog_of.c > > index 96fd5646f866..d74568d58a66 100644 > > +++ b/drivers/char/tpm/tpm_eventlog_of.c > > @@ -56,8 +56,8 @@ int tpm_read_log_of(struct tpm_chip *chip) > > * but physical tpm needs the conversion. > > */ > > if (of_property_match_string(np, "compatible", "IBM,vtpm") < 0) { > > - size = be32_to_cpup(sizep); > > - base = be64_to_cpup(basep); > > + size = be32_to_cpup((__be32 *)sizep); > > + base = be64_to_cpup((__be64 *)basep); > Er, no.. change the definitions of sizep and basep to be __be > Jason Please read the comment before the condition. sizep and basep may contain either little endian or big endian and this block is used to adjust that. Let me know if there is a better way for handling this.