Thread (23 messages) 23 messages, 9 authors, 2017-02-02

RE: ibmvtpm byteswapping inconsistency

flat view

From: David Laight <hidden>
Date: 2017-01-27 11:40:55
Also in: lkml

From: Michal Such=E1nek
building ibmvtpm I noticed gcc warning complaining that second word of
struct ibmvtpm_crq in tpm_ibmvtpm_suspend is uninitialized.
=20
The structure is defined as
=20
struct ibmvtpm_crq {
        u8 valid;
        u8 msg;
        __be16 len;
        __be32 data;
        __be64 reserved;
} __attribute__((packed, aligned(8)));
=20
initialized as
=20
        struct ibmvtpm_crq crq;
        u64 *buf =3D (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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help