]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
parisc: Use max() to calculate parisc_tlb_flush_threshold
authorThorsten Blum <thorsten.blum@toblux.com>
Thu, 4 Jul 2024 04:51:34 +0000 (06:51 +0200)
committerHelge Deller <deller@gmx.de>
Thu, 4 Jul 2024 20:37:26 +0000 (22:37 +0200)
Use max() to reduce 4 lines of code to a single line and improve its
readability.

Fixes the following Coccinelle/coccicheck warning reported by
minmax.cocci:

  WARNING opportunity for max()

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/kernel/cache.c

index 483bfafd930cdecd694571572b578d9cabcb9677..db531e58d70ef01d5461805f4d2430a0d9efd34b 100644 (file)
@@ -611,11 +611,7 @@ void __init parisc_setup_cache_timing(void)
                threshold/1024);
 
 set_tlb_threshold:
-       if (threshold > FLUSH_TLB_THRESHOLD)
-               parisc_tlb_flush_threshold = threshold;
-       else
-               parisc_tlb_flush_threshold = FLUSH_TLB_THRESHOLD;
-
+       parisc_tlb_flush_threshold = max(threshold, FLUSH_TLB_THRESHOLD);
        printk(KERN_INFO "TLB flush threshold set to %lu KiB\n",
                parisc_tlb_flush_threshold/1024);
 }