Commit 3827974e authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman
Browse files

staging: r8188eu: remove unnecessary return labels.



Remove the RETURN labels in rtw_alloc_etherdev_with_old_priv() and
rtw_alloc_etherdev() and return directly to clean up the code and
improve readability.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: default avatarMichael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220908130915.8406-5-straube.linux@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4cf393ae
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -54,14 +54,13 @@ struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv,

	pnetdev = alloc_etherdev_mq(sizeof(struct rtw_netdev_priv_indicator), 4);
	if (!pnetdev)
		goto RETURN;
		return NULL;

	pnetdev->dev.type = &wlan_type;
	pnpi = netdev_priv(pnetdev);
	pnpi->priv = old_priv;
	pnpi->sizeof_priv = sizeof_priv;

RETURN:
	return pnetdev;
}

@@ -72,19 +71,18 @@ struct net_device *rtw_alloc_etherdev(int sizeof_priv)

	pnetdev = alloc_etherdev_mq(sizeof(struct rtw_netdev_priv_indicator), 4);
	if (!pnetdev)
		goto RETURN;
		return NULL;

	pnpi = netdev_priv(pnetdev);

	pnpi->priv = vzalloc(sizeof_priv);
	if (!pnpi->priv) {
		free_netdev(pnetdev);
		pnetdev = NULL;
		goto RETURN;
		return NULL;
	}

	pnpi->sizeof_priv = sizeof_priv;
RETURN:

	return pnetdev;
}