public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: passt-dev@passt.top
Subject: Re: [PATCH v3 1/6] clang-tidy: Suppress redundant expression warning
Date: Tue, 7 Oct 2025 16:13:41 +0200	[thread overview]
Message-ID: <20251007161341.582043d2@elisabeth> (raw)
In-Reply-To: <20251002050437.4175553-2-david@gibson.dropbear.id.au>

On Thu,  2 Oct 2025 15:04:32 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:

> 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 <david@gibson.dropbear.id.au>
> ---
>  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


  reply	other threads:[~2025-10-07 14:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-02  5:04 [PATCH v3 0/6] Test and linter fixups David Gibson
2025-10-02  5:04 ` [PATCH v3 1/6] clang-tidy: Suppress redundant expression warning David Gibson
2025-10-07 14:13   ` Stefano Brivio [this message]
2025-10-02  5:04 ` [PATCH v3 2/6] cppcheck: Suppress the suppression of a suppression David Gibson
2025-10-02  5:04 ` [PATCH v3 3/6] cppcheck: Suppress a buggy cppcheck warning David Gibson
2025-10-02  5:04 ` [PATCH v3 4/6] cppcheck: Suppress variable scope warnings in dhcpv6() David Gibson
2025-10-02  5:04 ` [PATCH v3 5/6] test: Don't delete exetool on make clean David Gibson
2025-10-02  5:04 ` [PATCH v3 6/6] test: Add linting of Python test scripts David Gibson
2025-10-07 14:13 ` [PATCH v3 0/6] Test and linter fixups Stefano Brivio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251007161341.582043d2@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).