On Thu, 2 Oct 2025 15:04:32 +1000
David Gibson
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?
I have the feeling it's not really "exploring" debug() calls, rather, but I didn't really investigate. Whatever, it doesn't really matter.
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);
-- Stefano