Received: by 10.192.165.156 with SMTP id m28csp91419imm; Tue, 17 Apr 2018 07:03:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx48OM36CvjgFzSMAv/ixWMY9HFt+V1J57wDN7iHqDB16nb3hMnF18J6olUHz6wEBLotxlIjp X-Received: by 2002:a17:902:7249:: with SMTP id c9-v6mr2176123pll.217.1523973823617; Tue, 17 Apr 2018 07:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523973823; cv=none; d=google.com; s=arc-20160816; b=Zq9xAiAtje15Zf4staWLCRd90bFwJXtzTPt8VJp81AP1V/eN/3IOeRGVudHFQc+eu4 7piGVvnzsKFa32HQFuKJyrQ9TZZ9UhTIm3ak1orEjGU25ajh1yDxdfHVCwfvM2Ro77qC MNB6yUvVi81UmjI0/zNw8ATR3DQ1BOnhVt6TXGy+llhEdNfe7Fi6dK3RD/iSHiD5LDiJ DQND2TAnQUBc5rDup0wp7XQ1v/CDbpbddOACjdy0e/AdedE5Uv4RGyXTl5Pm6IEXuMEj cVgmItNZk6ojtwD+Wf8sJTTZ1ftei2ZkhxEZ6Xk8HBTPlg+O+reGygweJHxRhpnwB9Xn 08vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=0UvVK+iVpBQRQLuhhOhyqils3ZHDDmAmvF7/UCT3300=; b=XrbInosl1+PhkqTHQ1hKj+f444fJp+SK0LoFzC6J9pshnw9C/SRYo+5h7gL6zBHxye wM9aI5E9ORDMbAn6TvCkan2GKsWaAiUvq3/VeCT+yi1xCTfmlio7XfXbTX9OjJDbjVwE 4TPeOPCF99gz6ssmC+yveQjlcFftYa12AoibHehia4bGYd3wj9rYNlzQcWJz1G0jFnVl dQdTxeMi7tstBE0JgDPy11CuIE47aw75Kg+CeG/ScHPEW+/l2ekTUi7RgkJgYAHG7hHt jhasTW9ibBiY8OPfbdSJHT/r1F06iSww4kdspJfRTS4tw5XCzvh3wVOnkxXMLmT/Kmh+ W9HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=kqaW/3Un; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q24si12562078pff.13.2018.04.17.07.03.06; Tue, 17 Apr 2018 07:03:43 -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=@ziepe.ca header.s=google header.b=kqaW/3Un; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753894AbeDQOAT (ORCPT + 99 others); Tue, 17 Apr 2018 10:00:19 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:42615 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753575AbeDQOAR (ORCPT ); Tue, 17 Apr 2018 10:00:17 -0400 Received: by mail-pg0-f67.google.com with SMTP id e12so5446774pgn.9 for ; Tue, 17 Apr 2018 07:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0UvVK+iVpBQRQLuhhOhyqils3ZHDDmAmvF7/UCT3300=; b=kqaW/3UnRobNRDPih+GHR4jUFysarrRlRys9C2lYAcwh7DY53U92B/CJ7nvyOKuxi/ qD7m6YAkPGOXd+T9YFxw4hMxQuCz9RMw5AS1fai4F0bQHT4ZWz2P+hv683wB916VGOnp SSNHPUYN8QaOh3UCQ+aP0MmmXtF8R6FvRrPp6Ex5TwYusS7ZNozFjMZDSzhXuLw3n7d8 vjZEoW732jzELMUk+V8A2pUmf17V6e6dUTjIL5zy163LdQ0p2paNdfwdScq82k04ezqo fQjSSLW21DA4QcQJzokAo/cWwDzWIU1MmIy1aUciCeNtfbnhXHQi/KuDeUvPJur9wxhA f0NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=0UvVK+iVpBQRQLuhhOhyqils3ZHDDmAmvF7/UCT3300=; b=oQjIRfLanCjb8HNogZDsgkpTRI6FAQA1ox+YpJnk3V5CkkHO83Uaa1YfBt/R4Ew3QU +Idt7Et/DgCuOlUB+nAB1oyajW6UrttYBJYcuiHfo27ajMRsmzfxq3ASSYJUjKTkKNSd dlAhhoabLCPMG0C4Vz/lXtqBMnXYcVaeGrKY56J9R8vVtB0TZmLZma3/283iUEEh8nWY H09vldCOTOE5a3ktF2Yg/iMo99av1acWmy/nKQhYmC1mNHV3VY4Z1rGarHC02dCMg7ah ja4VxpAvdU8t2SPfpCermAlb8PkxQu+CBM6/1NZdRfbBVYhS9f3gpZ+y9lO0hQElrjJv 2u/g== X-Gm-Message-State: ALQs6tCL1E9X+WjRfCbVzKa74XlehNaPuQaXGgrSr6pRIWi9m0sK4omX rESPHcd8w3MV9RCkfV6zp5EVdw== X-Received: by 10.99.124.21 with SMTP id x21mr1880332pgc.209.1523973616504; Tue, 17 Apr 2018 07:00:16 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id 125sm25824453pff.158.2018.04.17.07.00.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Apr 2018 07:00:14 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1f8R9Z-0000bX-5z; Tue, 17 Apr 2018 08:00:13 -0600 Date: Tue, 17 Apr 2018 08:00:13 -0600 From: Jason Gunthorpe To: Thiebaud Weksteen Cc: Jarkko Sakkinen , Nayna Jain , linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/4] tpm: Add explicit endianness cast Message-ID: <20180417140013.GA2029@ziepe.ca> References: <20180412101350.210547-1-tweek@google.com> <20180412101350.210547-2-tweek@google.com> <20180417030202.GA30624@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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 08:32:33AM +0000, Thiebaud Weksteen wrote: > 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. Well a cast like that will throw sparse warnings, you need __force at least Jason