net: pcs: xpcs: remove return statements in void function

While using "return" when calling a void returning function inside a
function that returns void doesn't cause a compiler warning, it looks
weird. Convert the bunch of if() statements to a switch() and remove
these return statements.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tested-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Russell King (Oracle) 2024-10-17 12:53:10 +01:00 committed by Paolo Abeni
parent 11afdf3b2e
commit fd4056db7a

View File

@ -1140,13 +1140,20 @@ static void xpcs_link_up(struct phylink_pcs *pcs, unsigned int neg_mode,
{
struct dw_xpcs *xpcs = phylink_pcs_to_xpcs(pcs);
if (interface == PHY_INTERFACE_MODE_USXGMII)
return xpcs_link_up_usxgmii(xpcs, speed);
switch (interface) {
case PHY_INTERFACE_MODE_USXGMII:
xpcs_link_up_usxgmii(xpcs, speed);
break;
if (interface == PHY_INTERFACE_MODE_SGMII ||
interface == PHY_INTERFACE_MODE_1000BASEX)
return xpcs_link_up_sgmii_1000basex(xpcs, neg_mode, interface,
speed, duplex);
case PHY_INTERFACE_MODE_SGMII:
case PHY_INTERFACE_MODE_1000BASEX:
xpcs_link_up_sgmii_1000basex(xpcs, neg_mode, interface, speed,
duplex);
break;
default:
break;
}
}
static void xpcs_an_restart(struct phylink_pcs *pcs)