Skip to content

Commit d5383b0

Browse files
andy-shevdavem330
authored andcommitted
stmmac: intel: Eliminate useless conditions and variables
There are useless conditions like func() { ... int ret; ... ret = foo(); if (ret) return ret; return 0; } which may be replaced with direct return statement, what we have done here. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 52c1f79 commit d5383b0

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -347,16 +347,11 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
347347
static int ehl_common_data(struct pci_dev *pdev,
348348
struct plat_stmmacenet_data *plat)
349349
{
350-
int ret;
351-
352350
plat->rx_queues_to_use = 8;
353351
plat->tx_queues_to_use = 8;
354352
plat->clk_ptp_rate = 200000000;
355-
ret = intel_mgbe_common_data(pdev, plat);
356-
if (ret)
357-
return ret;
358353

359-
return 0;
354+
return intel_mgbe_common_data(pdev, plat);
360355
}
361356

362357
static int ehl_sgmii_data(struct pci_dev *pdev,
@@ -457,16 +452,11 @@ static struct stmmac_pci_info ehl_pse1_sgmii1g_pci_info = {
457452
static int tgl_common_data(struct pci_dev *pdev,
458453
struct plat_stmmacenet_data *plat)
459454
{
460-
int ret;
461-
462455
plat->rx_queues_to_use = 6;
463456
plat->tx_queues_to_use = 4;
464457
plat->clk_ptp_rate = 200000000;
465-
ret = intel_mgbe_common_data(pdev, plat);
466-
if (ret)
467-
return ret;
468458

469-
return 0;
459+
return intel_mgbe_common_data(pdev, plat);
470460
}
471461

472462
static int tgl_sgmii_data(struct pci_dev *pdev,

0 commit comments

Comments
 (0)