From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202508 header.b=lVWSvQA2; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id CF0185A0619 for ; Thu, 02 Oct 2025 07:04:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1759381478; bh=f8DbnPbjvKtqiF2JNRXPsyxoUtmbpCwoj6WHMqSx9V0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lVWSvQA2NCZmFDx5D2d0jfBuPejSo39/jzKVQqRZvg0YNUwuflT6NaAiWpyI98uKI 6nQi5Ikjj+RoBEHtgp0smY3oZ2yWYebtjGxZDquIdsr+T+dG3UsEvvLfgAUmJO82+o RJn26Zjc806NKB/LyXh4YgH9oeIPSAOMOVMEAe9E/6cLKeUemCOejDbluuz/X7m45V Xj2Fs1TlNGDdEo2MxxWSMj60xkZpwofzYeHrYV6rKLhgBgsYz2f6Klpk0afwbnt8NI qG7L4YojoOIQwERIEYfF7fFN46FiFzS4S0qqoqXmaLbl3AUk1VR9G/9y21+h8+wdjR 5tdc3mbLs9EWQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4ccfqB4nwBz4w9m; Thu, 2 Oct 2025 15:04:38 +1000 (AEST) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v3 1/6] clang-tidy: Suppress redundant expression warning Date: Thu, 2 Oct 2025 15:04:32 +1000 Message-ID: <20251002050437.4175553-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251002050437.4175553-1-david@gibson.dropbear.id.au> References: <20251002050437.4175553-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: IUBVIF6HODOF7EPW6F6SXFINCBDJGET2 X-Message-ID-Hash: IUBVIF6HODOF7EPW6F6SXFINCBDJGET2 X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: clang-tidy 20.1.8 doesn't like (VHOST_USER_MAX_VQS / 2), because it expands to (2 / 2). But in the context of the #define, this makes logical sense, so suppress the warning. I'm not sure why it isn't firing on the debug() line just below. Possibly it only complains once per expression per function, so we only have to suppress it once? Signed-off-by: David Gibson --- vhost_user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vhost_user.c b/vhost_user.c index fa343a86..223332d5 100644 --- a/vhost_user.c +++ b/vhost_user.c @@ -939,6 +939,7 @@ static bool vu_get_queue_num_exec(struct vu_dev *vdev, { (void)vdev; + /* NOLINTNEXTLINE(misc-redundant-expression) */ vmsg_set_reply_u64(vmsg, VHOST_USER_MAX_VQS / 2); debug("VHOST_USER_MAX_VQS %u", VHOST_USER_MAX_VQS / 2); -- 2.51.0