Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

EDAC/skx_common: Remove redundant upper bound check for res->imc

The following upper bound check for the memory controller physical index
decoded by ADXL is the only place where use the macro 'NUM_IMC' is used:

res->imc > NUM_IMC - 1

Since this check is already covered by skx_get_mc_mapping(), meaning no
memory controller logical index exists for an invalid memory controller
physical index decoded by ADXL, remove the redundant upper bound check
so that the definition for 'NUM_IMC' can be cleaned up (in another patch).

Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20250731145534.2759334-6-qiuxu.zhuo@intel.com

authored by

Qiuxu Zhuo and committed by
Tony Luck
91ded20f 43060ca5

+1 -1
+1 -1
drivers/edac/skx_common.c
··· 207 207 res->cs = (int)adxl_values[component_indices[INDEX_CS]]; 208 208 } 209 209 210 - if (res->imc > NUM_IMC - 1 || res->imc < 0) { 210 + if (res->imc < 0) { 211 211 skx_printk(KERN_ERR, "Bad imc %d\n", res->imc); 212 212 return false; 213 213 }