Skip to content

Commit

Permalink
net: qed_debug: fix check of false (grc_param < 0) expression
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jean Sacren authored and Jakub Kicinski committed Oct 13, 2021
1 parent edce2a9 commit 50515ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/qlogic/qed/qed_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -5256,7 +5256,7 @@ enum dbg_status qed_dbg_grc_config(struct qed_hwfn *p_hwfn,
*/
qed_dbg_grc_init_params(p_hwfn);

if (grc_param >= MAX_DBG_GRC_PARAMS || grc_param < 0)
if (grc_param >= MAX_DBG_GRC_PARAMS)
return DBG_STATUS_INVALID_ARGS;
if (val < s_grc_param_defs[grc_param].min ||
val > s_grc_param_defs[grc_param].max)
Expand Down

0 comments on commit 50515ca

Please sign in to comment.