From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934470AbdA0Lkz convert rfc822-to-8bit (ORCPT ); Fri, 27 Jan 2017 06:40:55 -0500 Received: from smtp-out6.electric.net ([192.162.217.182]:51973 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933751AbdA0Lkx (ORCPT ); Fri, 27 Jan 2017 06:40:53 -0500 From: David Laight To: =?Windows-1252?Q?=27Michal_Such=E1nek=27?= , Ashley Lai , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Peter Huewe , Marcel Selhorst , "Jarkko Sakkinen" , Jason Gunthorpe , "tpmdd-devel@lists.sourceforge.net" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Subject: RE: ibmvtpm byteswapping inconsistency Thread-Topic: ibmvtpm byteswapping inconsistency Thread-Index: AQHSeBIe8lHqrdS2Gkm+aOCXywnIf6FMLLKg Date: Fri, 27 Jan 2017 11:18:01 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DB0270A32@AcuExch.aculab.com> References: <20170126212248.3f3e9103@kitsune.suse.cz> In-Reply-To: <20170126212248.3f3e9103@kitsune.suse.cz> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Suchánek > building ibmvtpm I noticed gcc warning complaining that second word of > struct ibmvtpm_crq in tpm_ibmvtpm_suspend is uninitialized. > > The structure is defined as > > struct ibmvtpm_crq { > u8 valid; > u8 msg; > __be16 len; > __be32 data; > __be64 reserved; > } __attribute__((packed, aligned(8))); > > initialized as > > struct ibmvtpm_crq crq; > u64 *buf = (u64 *) &crq; ... Hrummfff.... What is that attribute for, seems pretty confusing and pointless to me. I also suspect that if you want to access it as two 64bit words it ought to be a union. David