From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF9AD37151 for ; Wed, 18 Oct 2023 16:09:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Xu0yRV8x" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12435C433C7; Wed, 18 Oct 2023 16:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697645342; bh=4MR7iDZ+ixMX3Hkqy8fTKzN7HrpxuhyU6baJRTI8kUg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Xu0yRV8xDJ2jramzFaTKjJu286TbqXgRtm6Fnu6t/XIWQN67j4ZKJzisW2q9Xc+43 aJP9Clv7ivguDYTQHxjOOg/UJX5LkCg35QqWSOk1mRuBGg4Ce8MxOKRICXSTUxQrFD Z40rGO35IXupws5F9Y5gw5++KTerH/+BA213yF1MxOmm8HnglybT/1Mp2CJQeC2Ox6 /K6wEwD7y/RXAUVJvasd/7I7i5569LnWUiB7OBB9nj2O8wtl16qcrf6WQnu7LHd/8r KCUYy6pEUiOMQx3fr0Dj+JxVLpZsI9C8CU2Ai/yYzsrCpleBTM3FBS+0Kf8RtHn68Q +JZA55NQnJxww== Date: Wed, 18 Oct 2023 18:08:55 +0200 From: Simon Horman To: Przemek Kitszel Cc: Jiri Pirko , netdev@vger.kernel.org, "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shannon Nelson , Michael Chan , Cai Huoqing , George Cherian , Danielle Ratson , Moshe Shemesh , Saeed Mahameed , Ariel Elior , Manish Chopra , Igor Russkikh , Coiby Xu , Brett Creeley , Sunil Goutham , Linu Cherian , Geetha sowjanya , Jerin Jacob , hariprasad , Subbaraya Sundeep , Ido Schimmel , Petr Machata , Eran Ben Elisha , Aya Levin , Leon Romanovsky , linux-kernel@vger.kernel.org, Jesse Brandeburg Subject: Re: [PATCH net-next v2 08/11] net/mlx5: devlink health: use retained error fmsg API Message-ID: <20231018160855.GT1940501@kernel.org> References: <20231017105341.415466-1-przemyslaw.kitszel@intel.com> <20231017105341.415466-9-przemyslaw.kitszel@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > Signed-off-by: Przemek Kitszel ... > @@ -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; > } ...