]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
EDAC/skx_common: Remove redundant upper bound check for res->imc
authorQiuxu Zhuo <qiuxu.zhuo@intel.com>
Thu, 31 Jul 2025 14:55:32 +0000 (22:55 +0800)
committerTony Luck <tony.luck@intel.com>
Tue, 19 Aug 2025 23:24:35 +0000 (16:24 -0700)
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
drivers/edac/skx_common.c

index 09187043c0451d5be937c956002b142bebf8e437..5899a1110495515bffaab52aeff6e66ed3548091 100644 (file)
@@ -207,7 +207,7 @@ static bool skx_adxl_decode(struct decoded_addr *res, enum error_source err_src)
                res->cs      = (int)adxl_values[component_indices[INDEX_CS]];
        }
 
-       if (res->imc > NUM_IMC - 1 || res->imc < 0) {
+       if (res->imc < 0) {
                skx_printk(KERN_ERR, "Bad imc %d\n", res->imc);
                return false;
        }