From nobody Fri May 17 16:39:05 2024 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 1553169980720259.12774957884153; Thu, 21 Mar 2019 05:06:20 -0700 (PDT) Received: from localhost ([127.0.0.1]:36170 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6wSd-0001Ew-6f for importer@patchew.org; Thu, 21 Mar 2019 08:06:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6wQu-00080g-GB for qemu-devel@nongnu.org; Thu, 21 Mar 2019 08:04:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6wIZ-0002yX-Pu for qemu-devel@nongnu.org; Thu, 21 Mar 2019 07:55:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39178) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h6wIZ-0002xZ-Ee for qemu-devel@nongnu.org; Thu, 21 Mar 2019 07:55:51 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B36B28535D; Thu, 21 Mar 2019 11:55:50 +0000 (UTC) Received: from dhcp-17-117.lcy.redhat.com (unknown [10.42.17.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id D8FE75D9C4; Thu, 21 Mar 2019 11:55:49 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Date: Thu, 21 Mar 2019 11:55:48 +0000 Message-Id: <20190321115548.6985-2-berrange@redhat.com> In-Reply-To: <20190321115548.6985-1-berrange@redhat.com> References: <20190321115548.6985-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 21 Mar 2019 11:55:50 +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 1/1] crypto/block: remove redundant struct packing to fix build with gcc 9 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: Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Greg Kurz Build fails with gcc 9: crypto/block-luks.c:689:18: error: taking address of packed member of =E2= =80=98struct QCryptoBlockLUKSHeader=E2=80=99 may result in an unaligned poi= nter value [-Werror=3Daddress-of-packed-member] 689 | be32_to_cpus(&luks->header.payload_offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ crypto/block-luks.c:690:18: error: taking address of packed member of =E2= =80=98struct QCryptoBlockLUKSHeader=E2=80=99 may result in an unaligned poi= nter value [-Werror=3Daddress-of-packed-member] 690 | be32_to_cpus(&luks->header.key_bytes); | ^~~~~~~~~~~~~~~~~~~~~~~ crypto/block-luks.c:691:18: error: taking address of packed member of =E2= =80=98struct QCryptoBlockLUKSHeader=E2=80=99 may result in an unaligned poi= nter value [-Werror=3Daddress-of-packed-member] 691 | be32_to_cpus(&luks->header.master_key_iterations); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... a bunch of similar errors... crypto/block-luks.c:1288:22: error: taking address of packed member of =E2= =80=98struct QCryptoBlockLUKSKeySlot=E2=80=99 may result in an unaligned po= inter value [-Werror=3Daddress-of-packed-member] 1288 | be32_to_cpus(&luks->header.key_slots[i].stripes); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors All members of the QCryptoBlockLUKSKeySlot and QCryptoBlockLUKSHeader are naturally aligned and we already check at build time there isn't any unwanted padding. Drop the QEMU_PACKED attribute. Reviewed-by: Eric Blake Signed-off-by: Greg Kurz Signed-off-by: Daniel P. Berrang=C3=A9 --- crypto/block-luks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/block-luks.c b/crypto/block-luks.c index 6bac79c3ab..5a69b3ce74 100644 --- a/crypto/block-luks.c +++ b/crypto/block-luks.c @@ -146,7 +146,7 @@ struct QCryptoBlockLUKSKeySlot { uint32_t key_offset; /* number of anti-forensic stripes */ uint32_t stripes; -} QEMU_PACKED; +}; =20 QEMU_BUILD_BUG_ON(sizeof(struct QCryptoBlockLUKSKeySlot) !=3D 48); =20 @@ -191,7 +191,7 @@ struct QCryptoBlockLUKSHeader { =20 /* key slots */ QCryptoBlockLUKSKeySlot key_slots[QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS]; -} QEMU_PACKED; +}; =20 QEMU_BUILD_BUG_ON(sizeof(struct QCryptoBlockLUKSHeader) !=3D 592); =20 --=20 2.20.1