From patchwork Fri Aug 10 20:03:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 176621 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4E46C2C007B for ; Sat, 11 Aug 2012 06:04:00 +1000 (EST) Received: from localhost ([::1]:54635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzvR8-0003Be-CL for incoming@patchwork.ozlabs.org; Fri, 10 Aug 2012 16:03:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzvQm-0002uB-0B for qemu-devel@nongnu.org; Fri, 10 Aug 2012 16:03:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzvQj-0000zZ-44 for qemu-devel@nongnu.org; Fri, 10 Aug 2012 16:03:35 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:59825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzvQi-0000zK-Th; Fri, 10 Aug 2012 16:03:33 -0400 Received: from localhost (v220110690675601.yourvserver.net.local [127.0.0.1]) by v220110690675601.yourvserver.net (Postfix) with ESMTP id 6E7017280031; Fri, 10 Aug 2012 22:03:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at weilnetz.de Received: from v220110690675601.yourvserver.net ([127.0.0.1]) by localhost (v220110690675601.yourvserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P-tl0Yc982lY; Fri, 10 Aug 2012 22:03:32 +0200 (CEST) Received: by v220110690675601.yourvserver.net (Postfix, from userid 1000) id 2075872800CC; Fri, 10 Aug 2012 22:03:32 +0200 (CEST) From: Stefan Weil To: qemu-trivial@nongnu.org Date: Fri, 10 Aug 2012 22:03:27 +0200 Message-Id: <1344629007-23311-3-git-send-email-sw@weilnetz.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1344629007-23311-1-git-send-email-sw@weilnetz.de> References: <1344629007-23311-1-git-send-email-sw@weilnetz.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 78.47.199.172 Cc: Stefan Weil , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] srp: Don't use QEMU_PACKED for single elements of a structured type X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org QEMU_PACKED results in a MinGW compiler warning when it is used for single structure elements: warning: 'gcc_struct' attribute ignored Using QEMU_PACKED for the whole structure avoids the compiler warning without changing the memory layout. Signed-off-by: Stefan Weil --- hw/srp.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/srp.h b/hw/srp.h index 3009bd5..5e0cad5 100644 --- a/hw/srp.h +++ b/hw/srp.h @@ -177,13 +177,13 @@ struct srp_tsk_mgmt { uint8_t reserved1[6]; uint64_t tag; uint8_t reserved2[4]; - uint64_t lun QEMU_PACKED; + uint64_t lun; uint8_t reserved3[2]; uint8_t tsk_mgmt_func; uint8_t reserved4; uint64_t task_tag; uint8_t reserved5[8]; -}; +} QEMU_PACKED; /* * We need the packed attribute because the SRP spec only aligns the @@ -198,14 +198,14 @@ struct srp_cmd { uint8_t data_in_desc_cnt; uint64_t tag; uint8_t reserved2[4]; - uint64_t lun QEMU_PACKED; + uint64_t lun; uint8_t reserved3; uint8_t task_attr; uint8_t reserved4; uint8_t add_cdb_len; uint8_t cdb[16]; uint8_t add_data[0]; -}; +} QEMU_PACKED; enum { SRP_RSP_FLAG_RSPVALID = 1 << 0,