* [PATCH trivial] checksum: fix clang-tidy error
@ 2026-02-26 16:24 Laurent Vivier
2026-03-03 19:11 ` Stefano Brivio
0 siblings, 1 reply; 3+ messages in thread
From: Laurent Vivier @ 2026-02-26 16:24 UTC (permalink / raw)
To: passt-dev; +Cc: Laurent Vivier, jfiusdq
Fix the following error reported by clang-tidy
$ make clang-tidy
...
checksum.c:284:2: error: preprocessor condition can be written more concisely using '#ifdef' [readability-use-concise-preprocessor-directives,-warnings-as-errors]
284 | #if defined(__AVX2__)
| ^~ ~~~~~~~~~~~~~~~~~
| ifdef __AVX2__
Fixes: 036fb8770cc2 ("checksum: add VSX fast path for POWER8/POWER9")
Cc: jfiusdq@proton.me
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
checksum.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/checksum.c b/checksum.c
index 828f9ecc9c02..bfba6f78b293 100644
--- a/checksum.c
+++ b/checksum.c
@@ -281,7 +281,7 @@ void csum_icmp6(struct icmp6hdr *icmp6hr,
icmp6hr->icmp6_cksum = csum(payload, dlen, psum);
}
-#if defined(__AVX2__)
+#ifdef __AVX2__
#include <immintrin.h>
/**
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH trivial] checksum: fix clang-tidy error
2026-02-26 16:24 [PATCH trivial] checksum: fix clang-tidy error Laurent Vivier
@ 2026-03-03 19:11 ` Stefano Brivio
2026-03-03 22:51 ` David Gibson
0 siblings, 1 reply; 3+ messages in thread
From: Stefano Brivio @ 2026-03-03 19:11 UTC (permalink / raw)
To: Laurent Vivier; +Cc: passt-dev, jfiusdq
On Thu, 26 Feb 2026 17:24:51 +0100
Laurent Vivier <lvivier@redhat.com> wrote:
> Fix the following error reported by clang-tidy
>
> $ make clang-tidy
> ...
> checksum.c:284:2: error: preprocessor condition can be written more concisely using '#ifdef' [readability-use-concise-preprocessor-directives,-warnings-as-errors]
> 284 | #if defined(__AVX2__)
> | ^~ ~~~~~~~~~~~~~~~~~
> | ifdef __AVX2__
>
> Fixes: 036fb8770cc2 ("checksum: add VSX fast path for POWER8/POWER9")
> Cc: jfiusdq@proton.me
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> checksum.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/checksum.c b/checksum.c
> index 828f9ecc9c02..bfba6f78b293 100644
> --- a/checksum.c
> +++ b/checksum.c
> @@ -281,7 +281,7 @@ void csum_icmp6(struct icmp6hdr *icmp6hr,
> icmp6hr->icmp6_cksum = csum(payload, dlen, psum);
> }
>
> -#if defined(__AVX2__)
> +#ifdef __AVX2__
> #include <immintrin.h>
>
> /**
This (conceptually) conflicts with a newer patch:
[PATCH 3/3] clang-tidy: Don't insist on #ifdef over #if defined()
https://archives.passt.top/passt-dev/20260302043135.800803-4-david@gibson.dropbear.id.au/
which, Laurent mentioned offline, is preferable to this in his view.
So I'm going to drop this (while carrying the Fixes: tag and adding a
Reported-by:) in favour of that one.
--
Stefano
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH trivial] checksum: fix clang-tidy error
2026-03-03 19:11 ` Stefano Brivio
@ 2026-03-03 22:51 ` David Gibson
0 siblings, 0 replies; 3+ messages in thread
From: David Gibson @ 2026-03-03 22:51 UTC (permalink / raw)
To: Stefano Brivio; +Cc: Laurent Vivier, passt-dev, jfiusdq
[-- Attachment #1: Type: text/plain, Size: 1822 bytes --]
On Tue, Mar 03, 2026 at 08:11:32PM +0100, Stefano Brivio wrote:
> On Thu, 26 Feb 2026 17:24:51 +0100
> Laurent Vivier <lvivier@redhat.com> wrote:
>
> > Fix the following error reported by clang-tidy
> >
> > $ make clang-tidy
> > ...
> > checksum.c:284:2: error: preprocessor condition can be written more concisely using '#ifdef' [readability-use-concise-preprocessor-directives,-warnings-as-errors]
> > 284 | #if defined(__AVX2__)
> > | ^~ ~~~~~~~~~~~~~~~~~
> > | ifdef __AVX2__
> >
> > Fixes: 036fb8770cc2 ("checksum: add VSX fast path for POWER8/POWER9")
> > Cc: jfiusdq@proton.me
> > Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> > ---
> > checksum.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/checksum.c b/checksum.c
> > index 828f9ecc9c02..bfba6f78b293 100644
> > --- a/checksum.c
> > +++ b/checksum.c
> > @@ -281,7 +281,7 @@ void csum_icmp6(struct icmp6hdr *icmp6hr,
> > icmp6hr->icmp6_cksum = csum(payload, dlen, psum);
> > }
> >
> > -#if defined(__AVX2__)
> > +#ifdef __AVX2__
> > #include <immintrin.h>
> >
> > /**
>
> This (conceptually) conflicts with a newer patch:
>
> [PATCH 3/3] clang-tidy: Don't insist on #ifdef over #if defined()
> https://archives.passt.top/passt-dev/20260302043135.800803-4-david@gibson.dropbear.id.au/
>
> which, Laurent mentioned offline, is preferable to this in his view.
>
> So I'm going to drop this (while carrying the Fixes: tag and adding a
> Reported-by:) in favour of that one.
Somehow I entirely missed Laurent's mail. Thanks for fixing this up.
--
David Gibson (he or they) | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you, not the other way
| around.
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-03 22:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-26 16:24 [PATCH trivial] checksum: fix clang-tidy error Laurent Vivier
2026-03-03 19:11 ` Stefano Brivio
2026-03-03 22:51 ` David Gibson
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).