[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231018160855.GT1940501@kernel.org>
Date: Wed, 18 Oct 2023 18:08:55 +0200
From: Simon Horman <horms@...nel.org>
To: Przemek Kitszel <przemyslaw.kitszel@...el.com>
Cc: Jiri Pirko <jiri@...nulli.us>, netdev@...r.kernel.org,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Shannon Nelson <shannon.nelson@....com>,
Michael Chan <michael.chan@...adcom.com>,
Cai Huoqing <cai.huoqing@...ux.dev>,
George Cherian <george.cherian@...vell.com>,
Danielle Ratson <danieller@...dia.com>,
Moshe Shemesh <moshe@...dia.com>,
Saeed Mahameed <saeedm@...dia.com>,
Ariel Elior <aelior@...vell.com>,
Manish Chopra <manishc@...vell.com>,
Igor Russkikh <irusskikh@...vell.com>,
Coiby Xu <coiby.xu@...il.com>,
Brett Creeley <brett.creeley@....com>,
Sunil Goutham <sgoutham@...vell.com>,
Linu Cherian <lcherian@...vell.com>,
Geetha sowjanya <gakula@...vell.com>,
Jerin Jacob <jerinj@...vell.com>,
hariprasad <hkelam@...vell.com>,
Subbaraya Sundeep <sbhatta@...vell.com>,
Ido Schimmel <idosch@...dia.com>,
Petr Machata <petrm@...dia.com>,
Eran Ben Elisha <eranbe@...dia.com>,
Aya Levin <ayal@...lanox.com>,
Leon Romanovsky <leon@...nel.org>,
linux-kernel@...r.kernel.org,
Jesse Brandeburg <jesse.brandeburg@...el.com>
Subject: Re: [PATCH net-next v2 08/11] net/mlx5: devlink health: use retained
error fmsg API
On Tue, Oct 17, 2023 at 12:53:38PM +0200, Przemek Kitszel wrote:
> Drop unneeded error checking.
>
> devlink_fmsg_*() family of functions is now retaining errors,
> so there is no need to check for them after each call.
>
> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@...el.com>
> Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@...el.com>
...
> @@ -288,52 +206,31 @@ int mlx5e_health_rsc_fmsg_dump(struct mlx5e_priv *priv, struct mlx5_rsc_key *key
Hi Przemek,
The code above this hunk looks like this:
do {
cmd_err = mlx5_rsc_dump_next(mdev, cmd, page, &size);
if (cmd_err < 0) {
err = cmd_err;
clang-16 W=1 warns that err, which is used as the return value of the
function, will be uninitialised if the loop never hits this condition.
Smatch also warns about this.
> goto destroy_cmd;
> }
>
> - err = mlx5e_health_rsc_fmsg_binary(fmsg, page_address(page), size);
> - if (err)
> - goto destroy_cmd;
> -
> + mlx5e_health_rsc_fmsg_binary(fmsg, page_address(page), size);
> } while (cmd_err > 0);
>
> destroy_cmd:
> mlx5_rsc_dump_cmd_destroy(cmd);
> - end_err = devlink_fmsg_binary_pair_nest_end(fmsg);
> - if (end_err)
> - err = end_err;
> + devlink_fmsg_binary_pair_nest_end(fmsg);
> free_page:
> __free_page(page);
> return err;
> }
...
Powered by blists - more mailing lists