public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Yi Yang <yiyang13@huawei.com>,
	horms@kernel.org, davem@davemloft.net,  edumazet@google.com,
	kuba@kernel.org, nichen@iscas.ac.cn
Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org,
	stable@vger.kernel.org,  wangweiyang2@huawei.com
Subject: Re: [PATCH net 2/2] net: usb: asix: Replace the direct return with goto statement
Date: Tue, 09 Apr 2024 10:57:25 +0200	[thread overview]
Message-ID: <e6bc6f826aa59e8023e18892276ec875f4fc3bda.camel@redhat.com> (raw)
In-Reply-To: <20240407075513.923435-3-yiyang13@huawei.com>

On Sun, 2024-04-07 at 07:55 +0000, Yi Yang wrote:
> Replace the direct return statement in ax88772_bind() with goto, to adhere
> to the kernel coding style.
> 
> Signed-off-by: Yi Yang <yiyang13@huawei.com>
> ---
>  drivers/net/usb/asix_devices.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
> index d8f86bafad6a..11417ed86d9e 100644
> --- a/drivers/net/usb/asix_devices.c
> +++ b/drivers/net/usb/asix_devices.c
> @@ -838,7 +838,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
>  
>  	ret = usbnet_get_endpoints(dev, intf);
>  	if (ret)
> -		return ret;
> +		goto mdio_err;
>  
>  	/* Maybe the boot loader passed the MAC address via device tree */
>  	if (!eth_platform_get_mac_address(&dev->udev->dev, buf)) {
> @@ -862,7 +862,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
>  		if (ret < 0) {
>  			netdev_dbg(dev->net, "Failed to read MAC address: %d\n",
>  				   ret);
> -			return ret;
> +			goto mdio_err;
>  		}
>  	}
>  
> @@ -875,7 +875,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
>  
>  	ret = asix_read_phy_addr(dev, true);
>  	if (ret < 0)
> -		return ret;
> +		goto mdio_err;
>  
>  	priv->phy_addr = ret;
>  	priv->embd_phy = ((priv->phy_addr & 0x1f) == AX_EMBD_PHY_ADDR);
> @@ -884,7 +884,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
>  			    &priv->chipcode, 0);
>  	if (ret < 0) {
>  		netdev_dbg(dev->net, "Failed to read STATMNGSTS_REG: %d\n", ret);
> -		return ret;
> +		goto mdio_err;
>  	}
>  
>  	priv->chipcode &= AX_CHIPCODE_MASK;
> @@ -899,7 +899,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
>  	ret = priv->reset(dev, 0);
>  	if (ret < 0) {
>  		netdev_dbg(dev->net, "Failed to reset AX88772: %d\n", ret);
> -		return ret;
> +		goto mdio_err;
>  	}
>  
>  	/* Asix framing packs multiple eth frames into a 2K usb bulk transfer */

As noted by Simon in the previous submission, this kind of change
should target the 'net-next' tree, you can't bundle it in a 'net'
series. You have to submit the 'net' patch, get it merged, wait until
'net' is merged back into 'net-next' and then submit the 'net-next'
follow-up.

Please read Documentation/process/maintainer-netdev.rst for the gory
details.

Additionally, I would also suggest to drop instead the 'mdio_err'
label: there is little/no gain replacing a return statement with jump
to a return statement.

Cheers,

Paolo



      parent reply	other threads:[~2024-04-09  8:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-07  7:55 [PATCH net 0/2] Add check for usbnet_get_endpoints and cleanup Yi Yang
2024-04-07  7:55 ` [PATCH net 1/2] net: usb: asix: Add check for usbnet_get_endpoints Yi Yang
2024-04-07  7:55 ` [PATCH net 2/2] net: usb: asix: Replace the direct return with goto statement Yi Yang
2024-04-07  7:59   ` kernel test robot
2024-04-09  8:57   ` Paolo Abeni [this message]

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=e6bc6f826aa59e8023e18892276ec875f4fc3bda.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nichen@iscas.ac.cn \
    --cc=stable@vger.kernel.org \
    --cc=wangweiyang2@huawei.com \
    --cc=yiyang13@huawei.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