Skip to contentSkip to conversation

s390: add <linux/minmax.h> to <asm/facility.h>

PATCH In review Randy Dunlap 2 participants 2 messages Oct 29, 2021 s390

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390: add <linux/minmax.h> to <asm/facility.h>

S390's <asm/facility.h> uses the min_t() macro, so it should include <linux/minmax.h> to avoid build errors.

In file included from arch/s390/pci/pci_insn.c:12:
arch/s390/include/asm/facility.h: In function '__stfle':
arch/s390/include/asm/facility.h:98:22: error: implicit declaration of function 'min_t' [-Werror=implicit-function-declaration]
98 | nr = min_t(unsigned long, (nr + 1) * 8, size * 8);
arch/s390/include/asm/facility.h:98:28: error: expected expression before 'unsigned'
98 | nr = min_t(unsigned long, (nr + 1) * 8, size * 8);

Fixes 4f18d869ffd0 ("s390: fix stfle zero padding")
Cc Naresh Kamboju <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Christian Borntraeger <[email protected]>
---
 arch/s390/include/asm/facility.h |    1 +
 1 file changed, 1 insertion(+)
arch/s390/include/asm/facility.h +1 -0
@@ -9,6 +9,7 @@
 #define __ASM_FACILITY_H
 
 #include <asm/facility-defs.h>
+#include <linux/minmax.h>
 #include <linux/string.h>
 #include <linux/preempt.h>
 #include <asm/lowcore.h>
maintainer
#1 lore raw
Quoted 11 lines · Randy Dunlap

S390's <asm/facility.h> uses the min_t() macro, so it should include <linux/minmax.h> to avoid build errors.

In file included from arch/s390/pci/pci_insn.c:12:
arch/s390/include/asm/facility.h: In function '__stfle':
arch/s390/include/asm/facility.h:98:22: error: implicit declaration of function 'min_t' [-Werror=implicit-function-declaration]
98 | nr = min_t(unsigned long, (nr + 1) * 8, size * 8);
arch/s390/include/asm/facility.h:98:28: error: expected expression before 'unsigned'
98 | nr = min_t(unsigned long, (nr + 1) * 8, size * 8);

Thank you, but it has been addressed in latest linux-next by:
https://lore.kernel.org/all/[email protected]/