net: qed_debug: fix check of false (grc_param < 0) expression
Subsystems (3)
PATCH 1/1 net: qed_debug: fix check of false (grc_param < 0) expression
From: Jean Sacren <[email protected]>
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.
--- drivers/net/ethernet/qlogic/qed/qed_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/qlogic/qed/qed_debug.c +1 -1
@@ -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)
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Tue, 12 Oct 2021 01:46:45 -0600 you wrote:
From: Jean Sacren <[email protected]>
The type of enum
dbg_grc_paramshas the enumerator list starting from 0. Whengrc_paramis declared by enumdbg_grc_params, (grc_param< 0) is always false. We should remove the check of this expression.Signed-off-by Jean Sacren <[email protected]>[...]
Here is the summary with links:
- [net-next] net: qed_debug: fix check of false (grc_param < 0) expression
https://git.kernel.org/netdev/net-next/c/50515cac8d0e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html