[<prev] [next>] [day] [month] [year] [list]
Message-ID: <SJ0PR18MB38820AF4EDE62387B8925168CCB69@SJ0PR18MB3882.namprd18.prod.outlook.com>
Date: Tue, 12 Oct 2021 08:21:21 +0000
From: Shai Malin <smalin@...vell.com>
To: Jεan Sacren <sakiwit@...il.com>
CC: GR-everest-linux-l2 <GR-everest-linux-l2@...vell.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"kuba@...nel.org" <kuba@...nel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Ariel Elior <aelior@...vell.com>
Subject: RE: [PATCH net-next] net: qed_debug: fix check of false (grc_param <
0) expression
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@...il.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@...vell.com>
Powered by blists - more mailing lists