Received: by 10.192.165.148 with SMTP id m20csp362305imm; Fri, 20 Apr 2018 07:59:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/VLKzLtDsr27lq0CuzqpJb33KdhvOfTOBDNBH2141M7jqyJA36cwFfwd7WbOqcbRAHICLV X-Received: by 10.98.170.1 with SMTP id e1mr1054151pff.153.1524236388573; Fri, 20 Apr 2018 07:59:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524236388; cv=none; d=google.com; s=arc-20160816; b=MkAr14hJ2drTP0SJRMlebXbBqJi+5SD5/HjtumPqKSUjoHp0pOJWMMJ7eMAA6Cec1J NcgEa+ygob0bpNawLxbUJ1c/6Hvrq/Uc8gy2S2gcQ2xwx0cud/2iIWtZfV/uHsWNwnbU V003WbwXdIBMqTG0u7Rtti/gdPxn2QsA1v0K+gDuzFd9btINaipuKvQlku6vO6GYuOHK IlyVuT40i/Ba4iDueQjuWJngrzvzGFx0pc6hJiVChEMhMdIioQA7SSOWwIaBq6IeCMND SEuJTie07OY1oHFGBK5jPKa1NazhAuqAogCF3/d3fdAfEH2umO352O7VYHKNJnOS6ptl 07DQ== 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=vVOzxH9VSvCryLRM7VIbU1orUFtD+aKYif282tptR48=; b=P4+rCyZFf4r7TKi/flSCPO00PAqEiwhQeCbQoN/OUgq4NcjXmy4lRNlyvkfZjE4i3A vFTg8/o7y0AdQ2V5EhTLXoFAMYSjGoPEUs4fK8/rN3kBjJhayWzXbdmcAmnXtuTMHSHh JSXW5DTWV5r34Qh8OMOlRedsXoDmJrQ94/pPq7hLnZfa6z74iftkU+si+svu4jJ7QbY6 /yEMhSnDZiUZxpuYXqIW/jsqAnVRJBToxHyui6rG6PlM+yeTiXzTJutAW1EErewSUoBh 1CJqsO/xjzGsL4z6dRAg3yFi0X+NJN2oFP3l1zfCRH9M8DYWXBN2CkGwSpTGCH6AK9fH oeBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=fQwVAa+q; 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 w16-v6si5000359plp.232.2018.04.20.07.59.33; Fri, 20 Apr 2018 07:59:48 -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=fQwVAa+q; 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 S1755566AbeDTO5p (ORCPT + 99 others); Fri, 20 Apr 2018 10:57:45 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:40624 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755297AbeDTO5n (ORCPT ); Fri, 20 Apr 2018 10:57:43 -0400 Received: by mail-pl0-f65.google.com with SMTP id t22-v6so5404810plo.7 for ; Fri, 20 Apr 2018 07:57:43 -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=vVOzxH9VSvCryLRM7VIbU1orUFtD+aKYif282tptR48=; b=fQwVAa+qRRSUth7osmsZjKaCvbCwk6NLSF06RF2f+ONBH5gXOJCnAB9gDqUQ6veJC1 5mxErdZBvdMlq/Jp0DtvbnQcrhMJeWIrpEsVwLAEPid9kVdMSqTi8jONb1v78G2QWBs3 +SeeFrtrpoGnu+AfRW3LcwUrBWQLhnjVyXPhk56QVdCksPuV3oPMqy7TeDZVm1DIAwoc cnJvBf83VhISbClhDlT6/TrUhxFfb9N2niFNuU9d+S2gkSC4YIUJFPJ101IWhsa+P2Zb tkhwFFERZOZujW72OpTYLnTnPJD7I24axszid3yCTNsCVaRxPp9y3yO1/6HEf0i0Pln2 R37Q== 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=vVOzxH9VSvCryLRM7VIbU1orUFtD+aKYif282tptR48=; b=m/RAO/pMtaEGt4UtAd7hpraf17LrpaV3rLj0LbmSWsO4/OXRiGeAXCHFha5RqwxwRS TGrCTQSt5f1j4eHfZKJW0+dXOEtaI91C0xWvsdO8dtHA8ksmOch2O931SXC5Yz45cu14 LpWX4BFQv2yf+Ok565hF9zfpezwQ5rUlI6gs2B+i9Tk16mVKBM2i1EQgLKQVvIoz/Ser s0bqVWUlc6ETeggZpO8WrZa0esgxUz4qMrbi0VzqlwnGQDlOWfe0PuYyKn/kCZ0A1HVS UvDHcSWMz8voc2PWP3RBVOOPIxb0IkwSleGbSgKMBo7OEGIG+Xj+Tnh32YacXTG7lV1s oKoA== X-Gm-Message-State: ALQs6tBsnCxJrzRZ6N0ZF+Otrn4s5gGqqoyX37q3TJCTo+sIq9zti0LV oGz2iNehc6I/gfHKCHiX/fV4tqvoBeM= X-Received: by 2002:a17:902:5801:: with SMTP id m1-v6mr10728340pli.325.1524236262710; Fri, 20 Apr 2018 07:57:42 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id g64sm16226430pfd.75.2018.04.20.07.57.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Apr 2018 07:57:42 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1f9XTo-00089K-Tx; Fri, 20 Apr 2018 08:57:40 -0600 Date: Fri, 20 Apr 2018 08:57:40 -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: <20180420145740.GC30433@ziepe.ca> References: <20180412101350.210547-1-tweek@google.com> <20180412101350.210547-2-tweek@google.com> <20180417030202.GA30624@ziepe.ca> <20180417140013.GA2029@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 Thu, Apr 19, 2018 at 01:09:12PM +0000, Thiebaud Weksteen wrote: > On Tue, Apr 17, 2018 at 4:00 PM Jason Gunthorpe wrote: > > > 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 > > I don't think so. Since the variable is only defined as u32*, no specific > warning is generated. I've used `make C=2 drivers/char/tpm/` with this > patch applied and no new warning is being triggered. I'm surprised to hear you say that.. Sparse is supposed to require force on all cast that change the annotation, and there are many examples in the kernel that have force in that case. Jason