include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / blackfin / mm / isram-driver.c
index 84cdc5a1c139bddc5f81c7e2ac17a8af112ed45d..39b058564f62400db2b00af74127d13cd0d83fd4 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
+#include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/sched.h>
 
@@ -62,7 +63,7 @@ static void isram_write(const void *addr, uint64_t data)
        uint32_t cmd;
        unsigned long flags;
 
-       if (addr >= (void *)(L1_CODE_START + L1_CODE_LENGTH))
+       if (unlikely(addr >= (void *)(L1_CODE_START + L1_CODE_LENGTH)))
                return;
 
        cmd = IADDR2DTEST(addr) | 2;             /* write */
@@ -93,7 +94,7 @@ static uint64_t isram_read(const void *addr)
        unsigned long flags;
        uint64_t ret;
 
-       if (addr > (void *)(L1_CODE_START + L1_CODE_LENGTH))
+       if (unlikely(addr > (void *)(L1_CODE_START + L1_CODE_LENGTH)))
                return 0;
 
        cmd = IADDR2DTEST(addr) | 0;              /* read */
@@ -120,7 +121,7 @@ static bool isram_check_addr(const void *addr, size_t n)
 {
        if ((addr >= (void *)L1_CODE_START) &&
            (addr < (void *)(L1_CODE_START + L1_CODE_LENGTH))) {
-               if ((addr + n) > (void *)(L1_CODE_START + L1_CODE_LENGTH)) {
+               if (unlikely((addr + n) > (void *)(L1_CODE_START + L1_CODE_LENGTH))) {
                        show_stack(NULL, NULL);
                        pr_err("copy involving %p length (%zu) too long\n", addr, n);
                }