netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: qed_debug: fix check of false (grc_param < 0) expression
@ 2021-10-12  7:46 Jεan Sacren
  2021-10-13 15:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 3+ messages in thread
From: Jεan Sacren @ 2021-10-12  7:46 UTC (permalink / raw)
  To: Ariel Elior; +Cc: GR-everest-linux-l2, davem, kuba, netdev

From: Jean Sacren <sakiwit@gmail.com>

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>
---
 drivers/net/ethernet/qlogic/qed/qed_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_debug.c b/drivers/net/ethernet/qlogic/qed/qed_debug.c
index f6198b9a1b02..e3edca187ddf 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_debug.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_debug.c
@@ -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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH net-next] net: qed_debug: fix check of false (grc_param < 0) expression
@ 2021-10-12  8:21 Shai Malin
  0 siblings, 0 replies; 3+ messages in thread
From: Shai Malin @ 2021-10-12  8:21 UTC (permalink / raw)
  To: Jεan Sacren
  Cc: GR-everest-linux-l2, davem@davemloft.net, kuba@kernel.org,
	netdev@vger.kernel.org, Ariel Elior

On 10/12/21 at 10:47 AM  Jεan Sacren wrote:
> 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>
> ---
>  drivers/net/ethernet/qlogic/qed/qed_debug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/qlogic/qed/qed_debug.c
> b/drivers/net/ethernet/qlogic/qed/qed_debug.c
> index f6198b9a1b02..e3edca187ddf 100644
> --- a/drivers/net/ethernet/qlogic/qed/qed_debug.c
> +++ b/drivers/net/ethernet/qlogic/qed/qed_debug.c
> @@ -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)

Thanks.

Acked-by: Shai Malin <smalin@marvell.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: qed_debug: fix check of false (grc_param < 0) expression
  2021-10-12  7:46 [PATCH net-next] net: qed_debug: fix check of false (grc_param < 0) expression Jεan Sacren
@ 2021-10-13 15:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-13 15:50 UTC (permalink / raw)
  To: =?utf-8?q?J=CE=B5an_Sacren_=3Csakiwit=40gmail=2Ecom=3E?=
  Cc: aelior, GR-everest-linux-l2, davem, kuba, netdev

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 12 Oct 2021 01:46:45 -0600 you wrote:
> From: Jean Sacren <sakiwit@gmail.com>
> 
> 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>
> 
> [...]

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-13 15:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-12  7:46 [PATCH net-next] net: qed_debug: fix check of false (grc_param < 0) expression Jεan Sacren
2021-10-13 15:50 ` patchwork-bot+netdevbpf
  -- strict thread matches above, loose matches on Subject: below --
2021-10-12  8:21 Shai Malin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).