aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/bitops.h
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2025-02-20 18:36:34 +0000
committerJakub Kicinski <[email protected]>2025-02-20 18:37:30 +0000
commit5d6ba5ab8582aa35c1ee98e47af28e6f6772596c (patch)
treea4a3a2d311773c19909c9928273e0bcae01a39ce /arch/s390/include/asm/bitops.h
parentMerge tag 'linux-can-next-for-6.15-20250219' of git://git.kernel.org/pub/scm/... (diff)
parentMerge tag 'net-6.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/net... (diff)
downloadkernel-5d6ba5ab8582aa35c1ee98e47af28e6f6772596c.tar.gz
kernel-5d6ba5ab8582aa35c1ee98e47af28e6f6772596c.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR (net-6.14-rc4). No conflicts or adjacent changes. Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'arch/s390/include/asm/bitops.h')
-rw-r--r--arch/s390/include/asm/bitops.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index d5125296ade2..a5ca0a947691 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -53,7 +53,11 @@ static __always_inline bool arch_test_bit(unsigned long nr, const volatile unsig
unsigned long mask;
int cc;
- if (__builtin_constant_p(nr)) {
+ /*
+ * With CONFIG_PROFILE_ALL_BRANCHES enabled gcc fails to
+ * handle __builtin_constant_p() in some cases.
+ */
+ if (!IS_ENABLED(CONFIG_PROFILE_ALL_BRANCHES) && __builtin_constant_p(nr)) {
addr = (const volatile unsigned char *)ptr;
addr += (nr ^ (BITS_PER_LONG - BITS_PER_BYTE)) / BITS_PER_BYTE;
mask = 1UL << (nr & (BITS_PER_BYTE - 1));