x86: fix memalign() parameter order
authorStephen Warren <swarren@nvidia.com>
Fri, 12 Feb 2016 21:27:56 +0000 (14:27 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Sun, 21 Feb 2016 05:42:51 +0000 (13:42 +0800)
Purely by code inspection, it looks like the parameter order to memalign()
is swapped; its parameters are (align, size). 4096 is a likely desired
alignment, and a variable named size sounds like a size:-)

Fixes: 45b5a37836d5 ("x86: Add multi-processor init")
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/mp_init.c

index 7917350bff267acd988d68065b35269e00e84729..fc2fb5bf445cad9ab1d415933e30b6e9ed02ed02 100644 (file)
@@ -243,7 +243,7 @@ static int load_sipi_vector(atomic_t **ap_countp, int num_cpus)
 
        params->stack_size = CONFIG_AP_STACK_SIZE;
        size = params->stack_size * num_cpus;
-       stack = memalign(size, 4096);
+       stack = memalign(4096, size);
        if (!stack)
                return -ENOMEM;
        params->stack_top = (u32)(stack + size);