[PATCH] x86/apic: Use max() to fix Coccinelle warning

Thorsten Blum posted 1 patch 1 year, 10 months ago
arch/x86/kernel/apic/ipi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] x86/apic: Use max() to fix Coccinelle warning
Posted by Thorsten Blum 1 year, 10 months ago
Fixes the following Coccinelle/coccicheck warning reported by
minmax.cocci:

	WARNING opportunity for max()

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
---
 arch/x86/kernel/apic/ipi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/apic/ipi.c b/arch/x86/kernel/apic/ipi.c
index 5da693d633b7..7047948396c1 100644
--- a/arch/x86/kernel/apic/ipi.c
+++ b/arch/x86/kernel/apic/ipi.c
@@ -314,7 +314,7 @@ int safe_smp_processor_id(void)
 
 	cpuid = convert_apicid_to_cpu(apicid);
 
-	return cpuid >= 0 ? cpuid : 0;
+	return max(cpuid, 0);
 }
 #endif
 #endif
-- 
2.44.0