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=P0bUyhbS; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 963805A061A for ; Wed, 01 Oct 2025 11:52:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1759312328; bh=f8DbnPbjvKtqiF2JNRXPsyxoUtmbpCwoj6WHMqSx9V0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P0bUyhbSSCHfQNVsforGXcj9zKaIOs0I3DtTxr7XwegRV9pcnmhqhry9FSOrUvY6h Sg+P6u9XtLQaMr+nzTjE5IiBiw2giHPE2JAzotpZWQ1qPmF5DVxO/oGJ3Gy5YwHRzu Qo7NXST3SzeKhpARZ0o1r0SyqmAeFS/dXInZuXPd/R3vMKWFJgzNqp3xNnuLtdlvMk TscMAXnU3jUssgPvdZqOL2PJjGIYNFus2oZa0si1EgKmenFHXqWsYTtKGYjI3+G7vw xxM6s/Vh/Qzw8azn3S4V8lAVBZeu4UEpMfhp0Mdj349Td2Iaw7tMlrT7mWuAOvcTL6 +h9K/Rogb9MBw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4cc9FN2pFmz4wD9; Wed, 1 Oct 2025 19:52:08 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 3/6] clang-tidy: Suppress redundant expression warning Date: Wed, 1 Oct 2025 19:51:59 +1000 Message-ID: <20251001095202.3875003-4-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251001095202.3875003-1-david@gibson.dropbear.id.au> References: <20251001095202.3875003-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: OGA4FGTZ5DJVKSRVTJQZW4GYS4DR7OVY X-Message-ID-Hash: OGA4FGTZ5DJVKSRVTJQZW4GYS4DR7OVY 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