[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CALSSxFYBhv==pJTme0FThxP9JBJszsj1v4G2s-HGzkaevbyvBA@mail.gmail.com>
Date: Thu, 16 Nov 2023 11:05:46 -0800
From: Justin Chen <justin.chen@...adcom.com>
To: Markus Elfring <Markus.Elfring@....de>
Cc: Florian Fainelli <florian.fainelli@...adcom.com>,
Jakub Kicinski <kuba@...nel.org>,
Wojciech Drewek <wojciech.drewek@...el.com>,
Julia Lawall <Julia.Lawall@...ia.fr>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
bcm-kernel-feedback-list@...adcom.com, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>, cocci@...ia.fr,
Simon Horman <horms@...nel.org>
Subject: Re: [PATCH v2] net: bcmasp: Use common error handling code in bcmasp_probe()
On Wed, Nov 15, 2023 at 1:11 AM Markus Elfring <Markus.Elfring@....de> wrote:
>
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Wed, 15 Nov 2023 09:38:56 +0100
>
> Add a jump target so that a bit of exception handling can be better reused
> in this function implementation.
>
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> ---
>
> v2:
> Special expectations were expressed for the previous patch size.
>
> * Jakub Kicinski
> https://lore.kernel.org/netdev/20231106145806.669875f4@kernel.org/
>
> * Justin Chen
> https://lore.kernel.org/netdev/CALSSxFYRgPwEq+QhCOYPqrtae8RvL=jTOcz4mk3vbe+Fc0QwbQ@mail.gmail.com/
>
> * Florian Fainelli
> https://lore.kernel.org/netdev/4053e838-e5cf-4450-8067-21bdec989d1b@broadcom.com/
>
>
> Thus another change variant can eventually be integrated.
>
>
> drivers/net/ethernet/broadcom/asp2/bcmasp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
> index 29b04a274d07..7d6c15732d9f 100644
> --- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c
> +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
> @@ -1304,9 +1304,8 @@ static int bcmasp_probe(struct platform_device *pdev)
> intf = bcmasp_interface_create(priv, intf_node, i);
> if (!intf) {
> dev_err(dev, "Cannot create eth interface %d\n", i);
> - bcmasp_remove_intfs(priv);
> of_node_put(intf_node);
> - goto of_put_exit;
> + goto remove_intfs;
> }
> list_add_tail(&intf->list, &priv->intfs);
> i++;
> @@ -1331,6 +1330,7 @@ static int bcmasp_probe(struct platform_device *pdev)
> netdev_err(intf->ndev,
> "failed to register net_device: %d\n", ret);
> priv->destroy_wol(priv);
> +remove_intfs:
> bcmasp_remove_intfs(priv);
> goto of_put_exit;
> }
> --
> 2.42.1
>
nak. Doesn't save any lines of code. Doesn't make things clearer or
easier to follow. This doesn't seem like an improvement to me.
Justin
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4206 bytes)
Powered by blists - more mailing lists