padata: add parenthesis in MAX_SEQ_NR macro
Subsystems (2)
PATCH 1/1 padata: add parenthesis in MAX_SEQ_NR macro
MAX_SEQ_NR is used in padata_alloc_pd() like this:
pd->max_seq_nr = (MAX_SEQ_NR / num_cpus) * num_cpus - 1;
It needs parenthesis or the divide by num_cpus takes precedence over the subtraction.
Signed-off-by Dan Carpenter <[email protected]>
---
Found by a static checker. I don't really know this code.
kernel/padata.c +1 -1
@@ -28,7 +28,7 @@#include <linux/slab.h> #include <linux/rcupdate.h> -#define MAX_SEQ_NR INT_MAX - NR_CPUS +#define MAX_SEQ_NR (INT_MAX - NR_CPUS)#define MAX_OBJ_NUM 1000static int padata_index_to_cpu (struct parallel_data *pd,int cpu_index)
Quoted 8 lines · Dan Carpenter
MAX_SEQ_NRis used inpadata_alloc_pd()like this:pd->max_seq_nr = (MAX_SEQ_NR / num_cpus) * num_cpus - 1;It needs parenthesis or the divide by
num_cpustakes precedence over the subtraction.Signed-off-by Dan Carpenter <[email protected]>
Acked-by Steffen Klassert <[email protected]>
Thanks,
Steffen
�