static int __init early_vmalloc(char *arg)
 {
        unsigned long vmalloc_reserve = memparse(arg, NULL);
+       unsigned long vmalloc_max;
 
        if (vmalloc_reserve < SZ_16M) {
                vmalloc_reserve = SZ_16M;
                        vmalloc_reserve >> 20);
        }
 
-       if (vmalloc_reserve > VMALLOC_END - (PAGE_OFFSET + SZ_32M)) {
-               vmalloc_reserve = VMALLOC_END - (PAGE_OFFSET + SZ_32M);
+       vmalloc_max = VMALLOC_END - (PAGE_OFFSET + SZ_32M);
+       if (vmalloc_reserve > vmalloc_max) {
+               vmalloc_reserve = vmalloc_max;
                pr_warn("vmalloc area is too big, limiting to %luMB\n",
                        vmalloc_reserve >> 20);
        }