From patchwork Fri Mar 29 11:11:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 10876897 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5A8C813B5 for ; Fri, 29 Mar 2019 11:22:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45BFA28FE8 for ; Fri, 29 Mar 2019 11:22:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 43A7D29178; Fri, 29 Mar 2019 11:22:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E2D412914D for ; Fri, 29 Mar 2019 11:22:15 +0000 (UTC) Received: from localhost ([127.0.0.1]:51008 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9paR-0005PG-3R for patchwork-qemu-devel@patchwork.kernel.org; Fri, 29 Mar 2019 07:22:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9pR1-0004Fz-RE for qemu-devel@nongnu.org; Fri, 29 Mar 2019 07:12:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h9pQy-00038Y-UC for qemu-devel@nongnu.org; Fri, 29 Mar 2019 07:12:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45278) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h9pQy-0002oq-Lf; Fri, 29 Mar 2019 07:12:28 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DB9253083391; Fri, 29 Mar 2019 11:12:24 +0000 (UTC) Received: from dhcp-17-117.lcy.redhat.com (unknown [10.42.17.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 69FAB60BFB; Fri, 29 Mar 2019 11:12:22 +0000 (UTC) From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 29 Mar 2019 11:11:04 +0000 Message-Id: <20190329111104.17223-15-berrange@redhat.com> In-Reply-To: <20190329111104.17223-1-berrange@redhat.com> References: <20190329111104.17223-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 29 Mar 2019 11:12:25 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 14/14] hw/s390x/3270-ccw: avoid taking address of fields in packed struct X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Farman , Farhan Ali , David Hildenbrand , Cornelia Huck , Alex Williamson , Laurent Vivier , Halil Pasic , Max Filippov , qemu-s390x@nongnu.org, Gerd Hoffmann , Thomas Huth , Riku Voipio , Christian Borntraeger , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Compiling with GCC 9 complains hw/s390x/3270-ccw.c: In function ‘emulated_ccw_3270_cb’: hw/s390x/3270-ccw.c:81:19: error: taking address of packed member of ‘struct SCHIB’ may result in an unaligned pointer value [-Werror=address-of-packed-member] 81 | SCSW *s = &sch->curr_status.scsw; | ^~~~~~~~~~~~~~~~~~~~~~ This local variable is only present to save a little bit of typing when setting the field later. Get rid of this to avoid the warning about unaligned accesses. Signed-off-by: Daniel P. Berrangé Reviewed-by: David Hildenbrand Reviewed-by: Thomas Huth --- hw/s390x/3270-ccw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/s390x/3270-ccw.c b/hw/s390x/3270-ccw.c index 2c8d16ccf7..14882242c3 100644 --- a/hw/s390x/3270-ccw.c +++ b/hw/s390x/3270-ccw.c @@ -78,13 +78,13 @@ static int emulated_ccw_3270_cb(SubchDev *sch, CCW1 ccw) if (rc == -EIO) { /* I/O error, specific devices generate specific conditions */ - SCSW *s = &sch->curr_status.scsw; + SCHIB *schib = &sch->curr_status; sch->curr_status.scsw.dstat = SCSW_DSTAT_UNIT_CHECK; sch->sense_data[0] = 0x40; /* intervention-req */ - s->ctrl &= ~SCSW_ACTL_START_PEND; - s->ctrl &= ~SCSW_CTRL_MASK_STCTL; - s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY | + schib->scsw.ctrl &= ~SCSW_ACTL_START_PEND; + schib->scsw.ctrl &= ~SCSW_CTRL_MASK_STCTL; + schib->scsw.ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY | SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND; }