From: David Gibson <david@gibson.dropbear.id.au>
To: passt-dev@passt.top, Stefano Brivio <sbrivio@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 3/3] clang-tidy: Don't insist on #ifdef over #if defined()
Date: Mon, 2 Mar 2026 15:31:35 +1100 [thread overview]
Message-ID: <20260302043135.800803-4-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20260302043135.800803-1-david@gibson.dropbear.id.au>
Commit 036fb8770 ("checksum: add VSX fast path for POWER8/POWER9") changed
an #ifdef to #if defined, in order to match a newly introduced #if which
needs to check two different symbols. This causes clang-tidy to complain
that the directive could be written more concisely.
In this case consistency with the other #if branch seems more important,
and in general insisting on #ifdef over #if seems unhelpfully pedantic.
Suppress that warning globally.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
.clang-tidy | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/.clang-tidy b/.clang-tidy
index 9d346ec2..773121f5 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -81,6 +81,11 @@ Checks:
# precedence over addition in modern mathematical notation. Adding
# parentheses to reinforce that certainly won't improve readability.
- "-readability-math-missing-parentheses"
+
+ # #if defined(FOO) is fine, and can be more consistent with other
+ # #if directives. Don't insist on #ifdef instead.
+ - "-readability-use-concise-preprocessor-directives"
+
WarningsAsErrors: "*"
HeaderFileExtensions:
- h
--
2.53.0
next prev parent reply other threads:[~2026-03-02 4:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 4:31 [PATCH 0/3] Miscellaneous minor fixes David Gibson
2026-03-02 4:31 ` [PATCH 1/3] tcp: Use flow_foreach_of_type() in tcp_{keepalive,inactivity} David Gibson
2026-03-05 0:38 ` Stefano Brivio
2026-03-02 4:31 ` [PATCH 2/3] fwd, pif: Replace with pif_sock_l4() with pif_listen() David Gibson
2026-03-03 19:11 ` Stefano Brivio
2026-03-03 22:55 ` David Gibson
2026-03-05 0:38 ` Stefano Brivio
2026-03-02 4:31 ` David Gibson [this message]
2026-03-05 0:38 ` [PATCH 3/3] clang-tidy: Don't insist on #ifdef over #if defined() 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=20260302043135.800803-4-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/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).