cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/0016-pc-bios-s390-ccw-struct-tpi_info-must-be-declared-as.patch

ae23c9
From 3e38e82fc6601763cb597d8849a61a871ab06b72 Mon Sep 17 00:00:00 2001
ae23c9
From: Thomas Huth <thuth@redhat.com>
ae23c9
Date: Tue, 8 May 2018 12:01:10 +0200
ae23c9
Subject: pc-bios/s390-ccw: struct tpi_info must be declared as aligned(4)
ae23c9
ae23c9
Upstream-status: n/a yet (likely later, but downstream fix is required now)
ae23c9
ae23c9
I've run into a compilation error today with the current version of GCC:
ae23c9
ae23c9
In file included from s390-ccw.h:49,
ae23c9
                 from main.c:12:
ae23c9
cio.h:128:1: error: alignment 1 of 'struct tpi_info' is less than 4 [-Werror=packed-not-aligned]
ae23c9
 } __attribute__ ((packed));
ae23c9
 ^
ae23c9
cc1: all warnings being treated as errors
ae23c9
ae23c9
Since the struct tpi_info contains an element ("struct subchannel_id schid")
ae23c9
which is marked as aligned(4), we've got to mark the struct tpi_info as
ae23c9
aligned(4), too.
ae23c9
ae23c9
Signed-off-by: Thomas Huth <thuth@redhat.com>
ae23c9
---
ae23c9
 pc-bios/s390-ccw/cio.h | 2 +-
ae23c9
 1 file changed, 1 insertion(+), 1 deletion(-)
ae23c9
ae23c9
diff --git a/pc-bios/s390-ccw/cio.h b/pc-bios/s390-ccw/cio.h
ae23c9
index 55eaeee..1a0795f 100644
ae23c9
--- a/pc-bios/s390-ccw/cio.h
ae23c9
+++ b/pc-bios/s390-ccw/cio.h
ae23c9
@@ -125,7 +125,7 @@ struct tpi_info {
ae23c9
     __u32 reserved3  : 12;
ae23c9
     __u32 int_type   : 3;
ae23c9
     __u32 reserved4  : 12;
ae23c9
-} __attribute__ ((packed));
ae23c9
+} __attribute__ ((packed, aligned(4)));
ae23c9
 
ae23c9
 /* channel command word (type 1) */
ae23c9
 struct ccw1 {
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9