summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/preempt.h
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2024-02-05 16:35:46 +0100
committerMax Krummenacher <max.krummenacher@toradex.com>2024-02-05 16:36:18 +0100
commit340d0000d1e277a5ec64e5bd903dab8ed1df1860 (patch)
treeb785c59256937102b9f0011ef143b1cb40471b48 /arch/s390/include/asm/preempt.h
parent4f79a6f97a8b85a7f887723616825b2427e38059 (diff)
parent16e6e107a688046df37976fb6d7310e886c8115d (diff)
Merge tag 'v5.4.264' into toradex_5.4.y
This is the 5.4.264 stable release Conflicts: drivers/pci/controller/dwc/pci-imx6.c commit 0f31993721f92 ("PCI: imx6: Install the fault handler only on compatible match") overlaps with our not mainlined THUMB work. Keep both additions sound/soc/codecs/sgtl5000.c commit c062676528865 (ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove") with a backport of a "fixes" commit.
Diffstat (limited to 'arch/s390/include/asm/preempt.h')
-rw-r--r--arch/s390/include/asm/preempt.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/s390/include/asm/preempt.h b/arch/s390/include/asm/preempt.h
index b5ea9e14c017..3dcd8ab3db73 100644
--- a/arch/s390/include/asm/preempt.h
+++ b/arch/s390/include/asm/preempt.h
@@ -52,10 +52,17 @@ static inline bool test_preempt_need_resched(void)
static inline void __preempt_count_add(int val)
{
- if (__builtin_constant_p(val) && (val >= -128) && (val <= 127))
- __atomic_add_const(val, &S390_lowcore.preempt_count);
- else
- __atomic_add(val, &S390_lowcore.preempt_count);
+ /*
+ * With some obscure config options and CONFIG_PROFILE_ALL_BRANCHES
+ * enabled, gcc 12 fails to handle __builtin_constant_p().
+ */
+ if (!IS_ENABLED(CONFIG_PROFILE_ALL_BRANCHES)) {
+ if (__builtin_constant_p(val) && (val >= -128) && (val <= 127)) {
+ __atomic_add_const(val, &S390_lowcore.preempt_count);
+ return;
+ }
+ }
+ __atomic_add(val, &S390_lowcore.preempt_count);
}
static inline void __preempt_count_sub(int val)