render / rpms / qemu

Forked from rpms/qemu 5 months ago
Clone

Blame 0180-srp-Don-t-use-QEMU_PACKED-for-single-elements-of-a-s.patch

5544c1
From 66cbaa761bc0f6d528957f9e3bc5762acb7f5f1c Mon Sep 17 00:00:00 2001
5544c1
From: Stefan Weil <sw@weilnetz.de>
5544c1
Date: Fri, 10 Aug 2012 22:03:27 +0200
5544c1
Subject: [PATCH] srp: Don't use QEMU_PACKED for single elements of a
5544c1
 structured type
5544c1
5544c1
QEMU_PACKED results in a MinGW compiler warning when it is
5544c1
used for single structure elements:
5544c1
5544c1
warning: 'gcc_struct' attribute ignored
5544c1
5544c1
Using QEMU_PACKED for the whole structure avoids the compiler warning
5544c1
without changing the memory layout.
5544c1
5544c1
Signed-off-by: Stefan Weil <sw@weilnetz.de>
5544c1
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
5544c1
(cherry picked from commit 93d3ad2a8048469d2b2bb157697425b66b2a37aa)
5544c1
5544c1
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5544c1
---
5544c1
 hw/srp.h | 8 ++++----
5544c1
 1 file changed, 4 insertions(+), 4 deletions(-)
5544c1
5544c1
diff --git a/hw/srp.h b/hw/srp.h
5544c1
index 3009bd5..5e0cad5 100644
5544c1
--- a/hw/srp.h
5544c1
+++ b/hw/srp.h
5544c1
@@ -177,13 +177,13 @@ struct srp_tsk_mgmt {
5544c1
     uint8_t    reserved1[6];
5544c1
     uint64_t   tag;
5544c1
     uint8_t    reserved2[4];
5544c1
-    uint64_t   lun QEMU_PACKED;
5544c1
+    uint64_t   lun;
5544c1
     uint8_t    reserved3[2];
5544c1
     uint8_t    tsk_mgmt_func;
5544c1
     uint8_t    reserved4;
5544c1
     uint64_t   task_tag;
5544c1
     uint8_t    reserved5[8];
5544c1
-};
5544c1
+} QEMU_PACKED;
5544c1
 
5544c1
 /*
5544c1
  * We need the packed attribute because the SRP spec only aligns the
5544c1
@@ -198,14 +198,14 @@ struct srp_cmd {
5544c1
     uint8_t    data_in_desc_cnt;
5544c1
     uint64_t   tag;
5544c1
     uint8_t    reserved2[4];
5544c1
-    uint64_t   lun QEMU_PACKED;
5544c1
+    uint64_t   lun;
5544c1
     uint8_t    reserved3;
5544c1
     uint8_t    task_attr;
5544c1
     uint8_t    reserved4;
5544c1
     uint8_t    add_cdb_len;
5544c1
     uint8_t    cdb[16];
5544c1
     uint8_t    add_data[0];
5544c1
-};
5544c1
+} QEMU_PACKED;
5544c1
 
5544c1
 enum {
5544c1
     SRP_RSP_FLAG_RSPVALID = 1 << 0,
5544c1
-- 
5544c1
1.7.12.1
5544c1