Received: by 10.192.165.156 with SMTP id m28csp699629imm; Thu, 19 Apr 2018 06:12:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+5MsMXFvvwtFvMEssOvQwcZnY+AbmMULvvfH4Q1qUmEnnE/sNoJKFXrJtlPSTnnJ9cvIHC X-Received: by 2002:a17:902:5992:: with SMTP id p18-v6mr6296737pli.49.1524143539538; Thu, 19 Apr 2018 06:12:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524143539; cv=none; d=google.com; s=arc-20160816; b=zCMOuZc2Haug/ynFLqPxy2n7lNf3nCeKVwMcw/J9oOO9WPWNLNyLBsoyp65RY0cgBJ Yc8R+KTOWTot+3JNIFLJz/ey8hQC9a3ZO2NXV4E7le+57G9QDJjTAzjSVYFsGLcqqD43 eaB/F4rXUl5ZjOb0rdUu32H6DwXkWSohoODPmKLF5vJMxQ1ch8ynd9lP7oOtm+D1o62E YcJbDxYLs7F5mOBgKBJ2kiaoZ0p3cZnQNJva257LJqCVKFzJoOtsuf5EjRKMabtbADOx KeWJnRiCZgz1FJY6ltMhOoUMfMlVgvh4jjfipNH0g7beFokk2BYflk9EJWdLIzgCcYLy xs9g== 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=c0eiiFqem9l9N1mLT17IQTnWSo3UzP4GE8Fu/U14AIY=; b=Ww8QwILFmyYnFfp2ljOcpIeRWIBVmyOxmVhqIGko7yemi1aQn2CfYuTHgE7W0K0VHV w8m/INSg+z9yyBZQij9d6XPhsV9ZAUBlHSNX60RyWfxal4ObChks4ZL8pM5wvVX/JmVc Ly36S0UvR8rLnyi8SjuCTPmVnQ65UAjStlYNbGz0VJeFrqclZtaJwB8f4dF6fnyGYYHZ 4o+Mt+n6cuGQLBi2RbFX0Yn8zk3IETa6nWoD1B5sX6CNa/uUIYW1OrHHcrV5SPseDjER dKqOqqmLxzYI0pQfkfPLAqHT8NDnuxQjQ6eLrSJUYOVw9MyrQjb6tnogof2q0wNEzz0+ jgTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jL3urAkX; 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 s72si3258385pfa.252.2018.04.19.06.12.05; Thu, 19 Apr 2018 06:12:19 -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=jL3urAkX; 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 S1752738AbeDSNJZ (ORCPT + 99 others); Thu, 19 Apr 2018 09:09:25 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:45730 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752085AbeDSNJY (ORCPT ); Thu, 19 Apr 2018 09:09:24 -0400 Received: by mail-io0-f195.google.com with SMTP id a7-v6so6485400ioc.12 for ; Thu, 19 Apr 2018 06:09:24 -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=c0eiiFqem9l9N1mLT17IQTnWSo3UzP4GE8Fu/U14AIY=; b=jL3urAkXaf/Lixn7Ivk8JOwQKBw53KxHibVR779fqXhgkpQzkl6BcOo5Cdcg1wDo4X go/juPEo9plwvbez6aphGnlqzHnelR5CjDr7+sC+SspTj7VkeAoU1NsGlPe88TCmitfs he1Li00zLn7d+LLazzO6vdpUm9DUVQLjCJPJCi8duYHIVuauCWz3vkFswj3tIeIV7Jpw Lvlc3Y8jEaC6urDYZGE3OT9+nxIOGQ4F64L8RIjLBghtNKYUo5PIwd42XxIwnNtjaqV2 McywiHbYUFwmiYvEKCmuO+KF/6PvgfiFWGwdODg/boZBPwwPJCnp19hh7LPD2MksRW0p 2vLA== 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=c0eiiFqem9l9N1mLT17IQTnWSo3UzP4GE8Fu/U14AIY=; b=kYG77suAUKCgKRMaOQR1ZI2lDqOrkMDNV0XD8vtqkV4dtb6M9DJJALr6Nut5kWFaRc KvZSyO3Z1cYOUAEzgDvFE5hzTUycD2mi+BaS0x8rMDTtFfy4OsX4+saJ+oXUNSUu86WB vJLuitMr+KTj/09NF2uY3YnXmYNAU/cCwRPGhRkfXGKUyNZ7+iXeNNKtVLBjU6PlkAGT Lv6P72tiIoJeW/AstOPHahBZGACkWziBF7U4xPW1jqGqUbN3VHNRLggUNmI02uBWszB1 cEujksqJIktaw7ftJw5vC1JNeDiZl4PrYk6BfFG8MAslEylbuMEM8UvsELBV6LhClDMw iZZA== X-Gm-Message-State: ALQs6tAQ71fK1shcq02lgCy2YOkwgQArnn/91ElwmzOy/JL1RGt7rV87 tc85Vk76cDirkV9n1UtgFeSpzfpqTQUQF1bEkxzYZEgMWXk= X-Received: by 2002:a6b:2893:: with SMTP id o141-v6mr6097239ioo.72.1524143363394; Thu, 19 Apr 2018 06:09:23 -0700 (PDT) MIME-Version: 1.0 References: <20180412101350.210547-1-tweek@google.com> <20180412101350.210547-2-tweek@google.com> <20180417030202.GA30624@ziepe.ca> <20180417140013.GA2029@ziepe.ca> In-Reply-To: <20180417140013.GA2029@ziepe.ca> From: Thiebaud Weksteen Date: Thu, 19 Apr 2018 13:09:12 +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 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 > Jason 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.