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

net: qed_debug: fix check of false (grc_param < 0) expression

The type of enum dbg_grc_params has the enumerator list starting from 0.
When grc_param is declared by enum dbg_grc_params, (grc_param < 0) is
always false. We should remove the check of this expression.

Signed-off-by: Jean Sacren <sakiwit@gmail.com>
Acked-by: Shai Malin <smalin@marvell.com>
Link: https://lore.kernel.org/r/20211012074645.12864-1-sakiwit@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Jean Sacren and committed by
Jakub Kicinski
50515cac edce2a93

+1 -1
+1 -1
drivers/net/ethernet/qlogic/qed/qed_debug.c
··· 5256 5256 */ 5257 5257 qed_dbg_grc_init_params(p_hwfn); 5258 5258 5259 - if (grc_param >= MAX_DBG_GRC_PARAMS || grc_param < 0) 5259 + if (grc_param >= MAX_DBG_GRC_PARAMS) 5260 5260 return DBG_STATUS_INVALID_ARGS; 5261 5261 if (val < s_grc_param_defs[grc_param].min || 5262 5262 val > s_grc_param_defs[grc_param].max)