From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gbFiJktk; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 2994B5A026F for ; Tue, 07 Oct 2025 16:13:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1759846429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+e8tOdfAFEbuW2GB0jn6MXJIV81EqTm4L9ulFVc9Xs8=; b=gbFiJktk3TJDfhFpnzMmZXtSlrzxg+raoVOZYuHUCUPSe3pL8bR6I7vvZa1ap5BxLNTntu nAuNrwGvZBe7IUK/FM7inbEmgYymYoS82p2Di2bdVqD10ikTDHOoe4UfUWG7gz0xT5GzgX eUmr4ea2fZgPhyHcQPzOVRxjjmIdxfc= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-497-bVJXaqTZOXCgYN_e8mX5Ow-1; Tue, 07 Oct 2025 10:13:47 -0400 X-MC-Unique: bVJXaqTZOXCgYN_e8mX5Ow-1 X-Mimecast-MFC-AGG-ID: bVJXaqTZOXCgYN_e8mX5Ow_1759846425 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3f384f10762so3310756f8f.3 for ; Tue, 07 Oct 2025 07:13:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759846425; x=1760451225; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=+e8tOdfAFEbuW2GB0jn6MXJIV81EqTm4L9ulFVc9Xs8=; b=kIwMtNeo3FtNJzK76MxHSFN1Sw/tY88QuFrTNq8OlOcc2U0Xl+lHsjjuE630dSL4tp 82Tns5eAJfENoV+yutGimk304vWyCHpkqGLKk0jfbqwG4v+gZuTHpxpYmNInIyQr0M+g shdC6jmV4caVrx4hLzHVcgmirXmTE3xVGGCRV0yMpiVarIjTGeMpixd8Drs5j0cJuknl ObRzlpIOA2f3tJQsEUbBAHsB1sM49eUNPCQ27KRi/RG9awCHIWbfsVKSaaUYLuuUPqo9 ApAI52vv9icvRpuN0zJulGguOEF2e5sBh8KfX+q7kpZzo5ts7NTZmJiONJIBJGSWWghI 5xwg== X-Gm-Message-State: AOJu0YxEP0er/cAuqXCYsgwLtxhoE4TTNWPLiGaVLvotx0ue3gff+Km9 PimgG6qrCrnK/pIlC2B4MyL9oVIUQNaXLHJyfNj804r7/VoU2iQnraW9Yx24E9xwqSQWwA08xj8 8ipMPGLvxcspvbIRrY9bbHjfrhuvImQzTHD41TcnTcHNFKbhNaWo1uiYBEIpGrw== X-Gm-Gg: ASbGncsgaRh9W6NAPJxnTImGSriwpXKtjwddRok80jnjBHpbOdKWDtC8mUUGh9V966n HxgmKqRd2P6vBXoxUQG+gIyZnAIRJNx0IUtdKmPZirospHAe6XIEUhKhTGz5j92SI4eBO5RZ9SA neoH++zYaBlDqdic0PdUX6t+POYhcJKb00iK+7MvpwG0WVBdexffta8g/Zrjx+ok4ltGRpTNXhz bpGyZ9iH940g0LG4q2McI6OHgwFnxcE3KDjJ/fBvggYFvesd6Esg1WW81cfckU9WGmfp8wN9vW7 5kp48W5N0gC8O9WKm79X5SvNkNTfTi0EyIi1AlN2DAm/Q1RQxDVWHSJEjFbFFKQIDxgwx/BqZg= = X-Received: by 2002:a5d:5d86:0:b0:3ea:e0fd:290a with SMTP id ffacd0b85a97d-4256713a379mr10182381f8f.12.1759846424938; Tue, 07 Oct 2025 07:13:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGh6iHJWpMK2y8mf62bdTUO6e5Obdgx5bHpaZtHw7M/TVxB9OFwefTr+grBdLMOmFS4uqpgJQ== X-Received: by 2002:a5d:5d86:0:b0:3ea:e0fd:290a with SMTP id ffacd0b85a97d-4256713a379mr10182366f8f.12.1759846424432; Tue, 07 Oct 2025 07:13:44 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4255d8b005dsm25228885f8f.25.2025.10.07.07.13.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Oct 2025 07:13:43 -0700 (PDT) Date: Tue, 7 Oct 2025 16:13:41 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v3 1/6] clang-tidy: Suppress redundant expression warning Message-ID: <20251007161341.582043d2@elisabeth> In-Reply-To: <20251002050437.4175553-2-david@gibson.dropbear.id.au> References: <20251002050437.4175553-1-david@gibson.dropbear.id.au> <20251002050437.4175553-2-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: WSp3wRTmciMI45Fza6GpzjmmmJdZYJzKRUSpld_m2Mc_1759846425 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: B7OODSQUVFK3NIPENNQBTNBA2DN7BOSC X-Message-ID-Hash: B7OODSQUVFK3NIPENNQBTNBA2DN7BOSC X-MailFrom: sbrivio@redhat.com 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: passt-dev@passt.top 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: On Thu, 2 Oct 2025 15:04:32 +1000 David Gibson 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 > --- > 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