mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
ae1d892d51
This is an effort to get rid of all multiplications from allocation functions in order to prevent integer overflows [1]. Here the multiplication is obviously safe because the "event_rings" member never can have a value greater than 255 (8 bits). This member is set twice using always FIELD_GET: mhi_cntrl->event_rings = FIELD_GET(MHICFG_NER_MASK, regval); mhi_cntrl->event_rings = FIELD_GET(MHICFG_NER_MASK, regval); And the MHICFG_NER_MASK macro defines the 8 bits mask that guarantees a maximum value of 255. However, using kcalloc() is more appropriate [1] and improves readability. This patch has no effect on runtime behavior. Link: https://github.com/KSPP/linux/issues/162 [1] Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments [1] Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: Erick Archer <erick.archer@gmx.com> Reviewed-by: Alex Elder <elder@linaro.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Link: https://lore.kernel.org/r/20240128112722.4334-1-erick.archer@gmx.com Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> |
||
---|---|---|
.. | ||
fsl-mc | ||
mhi | ||
arm-cci.c | ||
arm-integrator-lm.c | ||
brcmstb_gisb.c | ||
bt1-apb.c | ||
bt1-axi.c | ||
da8xx-mstpri.c | ||
hisi_lpc.c | ||
imx-weim.c | ||
intel-ixp4xx-eb.c | ||
Kconfig | ||
Makefile | ||
mips_cdmm.c | ||
moxtet.c | ||
mvebu-mbus.c | ||
omap_l3_noc.c | ||
omap_l3_noc.h | ||
omap_l3_smx.c | ||
omap_l3_smx.h | ||
omap-ocp2scp.c | ||
qcom-ebi2.c | ||
qcom-ssc-block-bus.c | ||
simple-pm-bus.c | ||
sun50i-de2.c | ||
sunxi-rsb.c | ||
tegra-aconnect.c | ||
tegra-gmi.c | ||
ti-pwmss.c | ||
ti-sysc.c | ||
ts-nbus.c | ||
uniphier-system-bus.c | ||
vexpress-config.c |