From: Simon Horman <horms@kernel.org>
To: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: Jiri Pirko <jiri@resnulli.us>,
netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Shannon Nelson <shannon.nelson@amd.com>,
Michael Chan <michael.chan@broadcom.com>,
Cai Huoqing <cai.huoqing@linux.dev>,
George Cherian <george.cherian@marvell.com>,
Danielle Ratson <danieller@nvidia.com>,
Moshe Shemesh <moshe@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Ariel Elior <aelior@marvell.com>,
Manish Chopra <manishc@marvell.com>,
Igor Russkikh <irusskikh@marvell.com>,
Coiby Xu <coiby.xu@gmail.com>,
Brett Creeley <brett.creeley@amd.com>,
Sunil Goutham <sgoutham@marvell.com>,
Linu Cherian <lcherian@marvell.com>,
Geetha sowjanya <gakula@marvell.com>,
Jerin Jacob <jerinj@marvell.com>, hariprasad <hkelam@marvell.com>,
Subbaraya Sundeep <sbhatta@marvell.com>,
Ido Schimmel <idosch@nvidia.com>, Petr Machata <petrm@nvidia.com>,
Eran Ben Elisha <eranbe@nvidia.com>,
Aya Levin <ayal@mellanox.com>, Leon Romanovsky <leon@kernel.org>,
linux-kernel@vger.kernel.org,
Jesse Brandeburg <jesse.brandeburg@intel.com>
Subject: Re: [PATCH net-next v2 08/11] net/mlx5: devlink health: use retained error fmsg API
Date: Wed, 18 Oct 2023 18:08:55 +0200 [thread overview]
Message-ID: <20231018160855.GT1940501@kernel.org> (raw)
In-Reply-To: <20231017105341.415466-9-przemyslaw.kitszel@intel.com>
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@intel.com>
> Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.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;
> }
...
next prev parent reply other threads:[~2023-10-18 16:09 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-17 10:53 [PATCH net-next v2 00/11] devlink: retain error in struct devlink_fmsg Przemek Kitszel
2023-10-17 10:53 ` [PATCH net-next v2 01/11] " Przemek Kitszel
2023-10-17 10:53 ` [PATCH net-next v2 02/11] netdevsim: devlink health: use retained error fmsg API Przemek Kitszel
2023-10-18 1:20 ` Jakub Kicinski
2023-10-17 10:53 ` [PATCH net-next v2 03/11] pds_core: " Przemek Kitszel
2023-10-17 11:06 ` Jiri Pirko
2023-10-17 11:15 ` Jiri Pirko
2023-10-17 11:35 ` Przemek Kitszel
2023-10-17 16:52 ` Nelson, Shannon
2023-10-17 10:53 ` [PATCH net-next v2 04/11] bnxt_en: " Przemek Kitszel
2023-10-17 10:53 ` [PATCH net-next v2 05/11] hinic: " Przemek Kitszel
2023-10-17 10:53 ` [PATCH net-next v2 06/11] octeontx2-af: " Przemek Kitszel
2023-10-17 10:53 ` [PATCH net-next v2 07/11] mlxsw: core: " Przemek Kitszel
2023-10-17 10:53 ` [PATCH net-next v2 08/11] net/mlx5: " Przemek Kitszel
2023-10-18 16:08 ` Simon Horman [this message]
2023-10-17 10:53 ` [PATCH net-next v2 09/11] qed: " Przemek Kitszel
2023-10-17 10:53 ` [PATCH net-next v2 10/11] staging: qlge: " Przemek Kitszel
2023-10-18 1:15 ` Jakub Kicinski
2023-10-19 14:28 ` Benjamin Poirier
2023-10-19 14:42 ` Jakub Kicinski
2023-10-19 18:32 ` Benjamin Poirier
2023-10-17 10:53 ` [PATCH net-next v2 11/11] devlink: convert most of devlink_fmsg_*() to return void Przemek Kitszel
2023-10-18 16:10 ` Simon Horman
2023-10-17 11:17 ` [PATCH net-next v2 00/11] devlink: retain error in struct devlink_fmsg Jiri Pirko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231018160855.GT1940501@kernel.org \
--to=horms@kernel.org \
--cc=aelior@marvell.com \
--cc=ayal@mellanox.com \
--cc=brett.creeley@amd.com \
--cc=cai.huoqing@linux.dev \
--cc=coiby.xu@gmail.com \
--cc=danieller@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eranbe@nvidia.com \
--cc=gakula@marvell.com \
--cc=george.cherian@marvell.com \
--cc=hkelam@marvell.com \
--cc=idosch@nvidia.com \
--cc=irusskikh@marvell.com \
--cc=jerinj@marvell.com \
--cc=jesse.brandeburg@intel.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=lcherian@marvell.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manishc@marvell.com \
--cc=michael.chan@broadcom.com \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=saeedm@nvidia.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
--cc=shannon.nelson@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).