From patchwork Thu May 25 14:48:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 13255305 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5639DC77B7A for ; Thu, 25 May 2023 14:48:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241603AbjEYOsg (ORCPT ); Thu, 25 May 2023 10:48:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241137AbjEYOsf (ORCPT ); Thu, 25 May 2023 10:48:35 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 46642139 for ; Thu, 25 May 2023 07:48:33 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 833F815BF; Thu, 25 May 2023 07:49:18 -0700 (PDT) Received: from donnerap.cambridge.arm.com (donnerap.cambridge.arm.com [10.1.197.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6B2FD3F67D; Thu, 25 May 2023 07:48:32 -0700 (PDT) From: Andre Przywara To: Will Deacon , Julien Thierry Cc: Alexandru Elisei , Jean-Philippe Brucker , Suzuki K Poulose , kvm@vger.kernel.org Subject: [PATCH kvmtool 0/2] Fix builds with clang Date: Thu, 25 May 2023 15:48:25 +0100 Message-Id: <20230525144827.679651-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org When trying to build kvmtool with clang, it warned about two problems, which are fatal since we use "-Werror". Patch 1/2 is an easy one fixing an obvious bug (not sure why GCC didn't warn). Patch 2/2 removes an ugly hack which clang didn't want to let pass. This patch admittedly implements the most tedious solution to this problem, but I didn't want to just throw in a "__maybe_unused" (or "__used", as kvmtool puts it). If that solution is a bit over the top, let me know, maybe there is better solution which doesn't require to touch every user of the virtio endianess conversion functions - or __maybe_unused is OK after all. Cheers, Andre Andre Przywara (2): option parsing: fix type of empty .argh parameter virtio: sanitise virtio endian wrappers arm/include/arm-common/kvm-config-arch.h | 2 +- builtin-run.c | 2 +- include/kvm/parse-options.h | 7 ++-- include/kvm/virtio.h | 53 ++++++++++++++---------- virtio/9p.c | 2 +- virtio/blk.c | 8 ++-- virtio/console.c | 6 +-- virtio/core.c | 37 +++++++++-------- virtio/net.c | 6 +-- virtio/scsi.c | 20 ++++----- 10 files changed, 77 insertions(+), 66 deletions(-)