2024-05-14 00:54:20

by kernel test robot

[permalink] [raw]
Subject: drivers/pci/controller/dwc/pci-imx6.c:564:5-8: Unneeded variable: "ret". Return "0" on line 608

Hi Frank,

First bad commit (maybe != root cause):

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a7c840ba5fa78d7761b9fedc33d69cef44986d79
commit: 0c9651c21f2a09672a983e4c43a74824eca3b174 PCI: imx6: Simplify reset handling by using *_FLAG_HAS_*_RESET
date: 2 months ago
config: arm64-randconfig-r054-20240514 (https://download.01.org/0day-ci/archive/20240514/[email protected]/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

cocci warnings: (new ones prefixed by >>)
>> drivers/pci/controller/dwc/pci-imx6.c:564:5-8: Unneeded variable: "ret". Return "0" on line 608

vim +564 drivers/pci/controller/dwc/pci-imx6.c

3f7cceeab895fc drivers/pci/controller/dwc/pci-imx6.c Leonard Crestez 2018-10-08 560
4d1821e729b5d2 drivers/pci/host/pci-imx6.c Bjorn Helgaas 2016-03-14 561 static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)
4d1821e729b5d2 drivers/pci/host/pci-imx6.c Bjorn Helgaas 2016-03-14 562 {
2d8ed461dbc9bc drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-02-01 563 unsigned int offset;
e6f1fef04c2539 drivers/pci/host/pci-imx6.c Andrey Smirnov 2016-05-02 @564 int ret = 0;
e3c06cd063d69d drivers/pci/host/pci-imx6.c Christoph Fritz 2016-04-05 565
e8e4d4e95701a1 drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-02-01 566 switch (imx6_pcie->drvdata->variant) {
e6f1fef04c2539 drivers/pci/host/pci-imx6.c Andrey Smirnov 2016-05-02 567 case IMX6SX:
e3c06cd063d69d drivers/pci/host/pci-imx6.c Christoph Fritz 2016-04-05 568 regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
e3c06cd063d69d drivers/pci/host/pci-imx6.c Christoph Fritz 2016-04-05 569 IMX6SX_GPR12_PCIE_TEST_POWERDOWN, 0);
e6f1fef04c2539 drivers/pci/host/pci-imx6.c Andrey Smirnov 2016-05-02 570 break;
73abd0bf89d275 drivers/pci/controller/dwc/pci-imx6.c Gustavo A. R. Silva 2020-07-21 571 case IMX6QP:
e6f1fef04c2539 drivers/pci/host/pci-imx6.c Andrey Smirnov 2016-05-02 572 case IMX6Q:
4d1821e729b5d2 drivers/pci/host/pci-imx6.c Bjorn Helgaas 2016-03-14 573 /* power up core phy and enable ref clock */
4d1821e729b5d2 drivers/pci/host/pci-imx6.c Bjorn Helgaas 2016-03-14 574 regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
4d1821e729b5d2 drivers/pci/host/pci-imx6.c Bjorn Helgaas 2016-03-14 575 IMX6Q_GPR1_PCIE_TEST_PD, 0 << 18);
4d1821e729b5d2 drivers/pci/host/pci-imx6.c Bjorn Helgaas 2016-03-14 576 /*
4d1821e729b5d2 drivers/pci/host/pci-imx6.c Bjorn Helgaas 2016-03-14 577 * the async reset input need ref clock to sync internally,
4d1821e729b5d2 drivers/pci/host/pci-imx6.c Bjorn Helgaas 2016-03-14 578 * when the ref clock comes after reset, internal synced
4d1821e729b5d2 drivers/pci/host/pci-imx6.c Bjorn Helgaas 2016-03-14 579 * reset time is too short, cannot meet the requirement.
4d1821e729b5d2 drivers/pci/host/pci-imx6.c Bjorn Helgaas 2016-03-14 580 * add one ~10us delay here.
4d1821e729b5d2 drivers/pci/host/pci-imx6.c Bjorn Helgaas 2016-03-14 581 */
87cb312777b5dc drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-04-14 582 usleep_range(10, 100);
4d1821e729b5d2 drivers/pci/host/pci-imx6.c Bjorn Helgaas 2016-03-14 583 regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
4d1821e729b5d2 drivers/pci/host/pci-imx6.c Bjorn Helgaas 2016-03-14 584 IMX6Q_GPR1_PCIE_REF_CLK_EN, 1 << 16);
e6f1fef04c2539 drivers/pci/host/pci-imx6.c Andrey Smirnov 2016-05-02 585 break;
9b3fe6796d7c0e drivers/pci/dwc/pci-imx6.c Andrey Smirnov 2017-03-28 586 case IMX7D:
9b3fe6796d7c0e drivers/pci/dwc/pci-imx6.c Andrey Smirnov 2017-03-28 587 break;
178e244cb6e209 drivers/pci/controller/dwc/pci-imx6.c Richard Zhu 2021-12-24 588 case IMX8MM:
fb3217e2cfc6a5 drivers/pci/controller/dwc/pci-imx6.c Richard Zhu 2023-01-16 589 case IMX8MM_EP:
2d8ed461dbc9bc drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-02-01 590 case IMX8MQ:
530ba41250b69d drivers/pci/controller/dwc/pci-imx6.c Richard Zhu 2023-01-16 591 case IMX8MQ_EP:
3db1e531e44429 drivers/pci/controller/dwc/pci-imx6.c Richard Zhu 2022-09-02 592 case IMX8MP:
c435669a41dd4e drivers/pci/controller/dwc/pci-imx6.c Richard Zhu 2023-01-16 593 case IMX8MP_EP:
2d8ed461dbc9bc drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-02-01 594 offset = imx6_pcie_grp_offset(imx6_pcie);
2d8ed461dbc9bc drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-02-01 595 /*
2d8ed461dbc9bc drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-02-01 596 * Set the over ride low and enabled
2d8ed461dbc9bc drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-02-01 597 * make sure that REF_CLK is turned on.
2d8ed461dbc9bc drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-02-01 598 */
2d8ed461dbc9bc drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-02-01 599 regmap_update_bits(imx6_pcie->iomuxc_gpr, offset,
2d8ed461dbc9bc drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-02-01 600 IMX8MQ_GPR_PCIE_CLK_REQ_OVERRIDE,
2d8ed461dbc9bc drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-02-01 601 0);
2d8ed461dbc9bc drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-02-01 602 regmap_update_bits(imx6_pcie->iomuxc_gpr, offset,
2d8ed461dbc9bc drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-02-01 603 IMX8MQ_GPR_PCIE_CLK_REQ_OVERRIDE_EN,
2d8ed461dbc9bc drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-02-01 604 IMX8MQ_GPR_PCIE_CLK_REQ_OVERRIDE_EN);
2d8ed461dbc9bc drivers/pci/controller/dwc/pci-imx6.c Andrey Smirnov 2019-02-01 605 break;
e6f1fef04c2539 drivers/pci/host/pci-imx6.c Andrey Smirnov 2016-05-02 606 }
e6f1fef04c2539 drivers/pci/host/pci-imx6.c Andrey Smirnov 2016-05-02 607
e6f1fef04c2539 drivers/pci/host/pci-imx6.c Andrey Smirnov 2016-05-02 @608 return ret;
4d1821e729b5d2 drivers/pci/host/pci-imx6.c Bjorn Helgaas 2016-03-14 609 }
4d1821e729b5d2 drivers/pci/host/pci-imx6.c Bjorn Helgaas 2016-03-14 610

:::::: The code at line 564 was first introduced by commit
:::::: e6f1fef04c253955004efea35aea2e4bc59f49b6 PCI: imx6: Use enum instead of bool for variant indicator

:::::: TO: Andrey Smirnov <[email protected]>
:::::: CC: Bjorn Helgaas <[email protected]>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki