From nobody Sun Feb 8 21:47:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1554286036693755.9649042598822; Wed, 3 Apr 2019 03:07:16 -0700 (PDT) Received: from localhost ([127.0.0.1]:49398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBcnV-0000n0-Nn for importer@patchew.org; Wed, 03 Apr 2019 06:07:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBcll-0008Aa-EV for qemu-devel@nongnu.org; Wed, 03 Apr 2019 06:05:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hBclk-0002dk-A2 for qemu-devel@nongnu.org; Wed, 03 Apr 2019 06:05:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50322) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hBcli-0002V6-1K; Wed, 03 Apr 2019 06:05:20 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C580C307D85B; Wed, 3 Apr 2019 10:05:15 +0000 (UTC) Received: from localhost (dhcp-192-213.str.redhat.com [10.33.192.213]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 69ED060144; Wed, 3 Apr 2019 10:05:15 +0000 (UTC) From: Cornelia Huck To: Peter Maydell Date: Wed, 3 Apr 2019 12:05:05 +0200 Message-Id: <20190403100505.7550-5-cohuck@redhat.com> In-Reply-To: <20190403100505.7550-1-cohuck@redhat.com> References: <20190403100505.7550-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 03 Apr 2019 10:05:15 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL for-4.0 4/4] 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: qemu-s390x@nongnu.org, Cornelia Huck , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Daniel P. Berrang=C3=A9 Compiling with GCC 9 complains hw/s390x/3270-ccw.c: In function =E2=80=98emulated_ccw_3270_cb=E2=80=99: hw/s390x/3270-ccw.c:81:19: error: taking address of packed member of =E2=80= =98struct SCHIB=E2=80=99 may result in an unaligned pointer value [-Werror= =3Daddress-of-packed-member] 81 | SCSW *s =3D &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=C3=A9 Message-Id: <20190329111104.17223-15-berrange@redhat.com> Reviewed-by: David Hildenbrand Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- 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 2c8d16ccf7e2..14882242c3de 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) =20 if (rc =3D=3D -EIO) { /* I/O error, specific devices generate specific conditions */ - SCSW *s =3D &sch->curr_status.scsw; + SCHIB *schib =3D &sch->curr_status; =20 sch->curr_status.scsw.dstat =3D SCSW_DSTAT_UNIT_CHECK; sch->sense_data[0] =3D 0x40; /* intervention-req */ - s->ctrl &=3D ~SCSW_ACTL_START_PEND; - s->ctrl &=3D ~SCSW_CTRL_MASK_STCTL; - s->ctrl |=3D SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY | + schib->scsw.ctrl &=3D ~SCSW_ACTL_START_PEND; + schib->scsw.ctrl &=3D ~SCSW_CTRL_MASK_STCTL; + schib->scsw.ctrl |=3D SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY | SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND; } =20 --=20 2.17.2