Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.2-rc7 next-20190705]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:    
https://github.com/0day-ci/linux/commits/josua-solid-run-com/Fix-hang-of-Armada-8040-SoC-in-orion-mdio/20190707-111919
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.4.0
reproduce:
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <l...@intel.com>

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/marvell/mvmdio.c: In function 'orion_mdio_probe':
>> drivers/net/ethernet/marvell/mvmdio.c:324:30: warning: passing argument 1 of 
>> 'PTR_ERR' makes pointer from integer without a cast [-Wint-conversion]
      if (dev->clk[i] == PTR_ERR(-EPROBE_DEFER)) {
                                 ^
   In file included from include/linux/clk.h:12:0,
                    from drivers/net/ethernet/marvell/mvmdio.c:20:
   include/linux/err.h:29:33: note: expected 'const void *' but argument is of 
type 'int'
    static inline long __must_check PTR_ERR(__force const void *ptr)
                                    ^~~~~~~
>> drivers/net/ethernet/marvell/mvmdio.c:324:19: warning: comparison between 
>> pointer and integer
      if (dev->clk[i] == PTR_ERR(-EPROBE_DEFER)) {
                      ^~
   In file included from include/linux/node.h:18:0,
                    from include/linux/cpu.h:17,
                    from include/linux/of_device.h:5,
                    from drivers/net/ethernet/marvell/mvmdio.c:26:
   drivers/net/ethernet/marvell/mvmdio.c:334:12: error: passing argument 1 of 
'_dev_warn' from incompatible pointer type [-Werror=incompatible-pointer-types]
      dev_warn(dev, "unsupported number of clocks, limiting to the first "
               ^
   include/linux/device.h:1487:12: note: in definition of macro 'dev_warn'
     _dev_warn(dev, dev_fmt(fmt), ##__VA_ARGS__)
               ^~~
   include/linux/device.h:1425:6: note: expected 'const struct device *' but 
argument is of type 'struct orion_mdio_dev *'
    void _dev_warn(const struct device *dev, const char *fmt, ...);
         ^~~~~~~~~
   cc1: some warnings being treated as errors

vim +/PTR_ERR +324 drivers/net/ethernet/marvell/mvmdio.c

   275  
   276  static int orion_mdio_probe(struct platform_device *pdev)
   277  {
   278          enum orion_mdio_bus_type type;
   279          struct resource *r;
   280          struct mii_bus *bus;
   281          struct orion_mdio_dev *dev;
   282          int i, ret;
   283  
   284          type = (enum 
orion_mdio_bus_type)of_device_get_match_data(&pdev->dev);
   285  
   286          r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   287          if (!r) {
   288                  dev_err(&pdev->dev, "No SMI register address given\n");
   289                  return -ENODEV;
   290          }
   291  
   292          bus = devm_mdiobus_alloc_size(&pdev->dev,
   293                                        sizeof(struct orion_mdio_dev));
   294          if (!bus)
   295                  return -ENOMEM;
   296  
   297          switch (type) {
   298          case BUS_TYPE_SMI:
   299                  bus->read = orion_mdio_smi_read;
   300                  bus->write = orion_mdio_smi_write;
   301                  break;
   302          case BUS_TYPE_XSMI:
   303                  bus->read = orion_mdio_xsmi_read;
   304                  bus->write = orion_mdio_xsmi_write;
   305                  break;
   306          }
   307  
   308          bus->name = "orion_mdio_bus";
   309          snprintf(bus->id, MII_BUS_ID_SIZE, "%s-mii",
   310                   dev_name(&pdev->dev));
   311          bus->parent = &pdev->dev;
   312  
   313          dev = bus->priv;
   314          dev->regs = devm_ioremap(&pdev->dev, r->start, 
resource_size(r));
   315          if (!dev->regs) {
   316                  dev_err(&pdev->dev, "Unable to remap SMI register\n");
   317                  return -ENODEV;
   318          }
   319  
   320          init_waitqueue_head(&dev->smi_busy_wait);
   321  
   322          for (i = 0; i < ARRAY_SIZE(dev->clk); i++) {
   323                  dev->clk[i] = of_clk_get(pdev->dev.of_node, i);
 > 324                  if (dev->clk[i] == PTR_ERR(-EPROBE_DEFER)) {
   325                          ret = -EPROBE_DEFER;
   326                          goto out_clk;
   327                  }
   328                  if (IS_ERR(dev->clk[i]))
   329                          break;
   330                  clk_prepare_enable(dev->clk[i]);
   331          }
   332  
   333          if (!IS_ERR(of_clk_get(pdev->dev.of_node, i)))
   334                  dev_warn(dev, "unsupported number of clocks, limiting 
to the first "
   335                           __stringify(ARRAY_SIZE(dev->clk)) "\n");
   336  
   337          dev->err_interrupt = platform_get_irq(pdev, 0);
   338          if (dev->err_interrupt > 0 &&
   339              resource_size(r) < MVMDIO_ERR_INT_MASK + 4) {
   340                  dev_err(&pdev->dev,
   341                          "disabling interrupt, resource size is too 
small\n");
   342                  dev->err_interrupt = 0;
   343          }
   344          if (dev->err_interrupt > 0) {
   345                  ret = devm_request_irq(&pdev->dev, dev->err_interrupt,
   346                                          orion_mdio_err_irq,
   347                                          IRQF_SHARED, pdev->name, dev);
   348                  if (ret)
   349                          goto out_mdio;
   350  
   351                  writel(MVMDIO_ERR_INT_SMI_DONE,
   352                          dev->regs + MVMDIO_ERR_INT_MASK);
   353  
   354          } else if (dev->err_interrupt == -EPROBE_DEFER) {
   355                  ret = -EPROBE_DEFER;
   356                  goto out_mdio;
   357          }
   358  
   359          ret = of_mdiobus_register(bus, pdev->dev.of_node);
   360          if (ret < 0) {
   361                  dev_err(&pdev->dev, "Cannot register MDIO bus (%d)\n", 
ret);
   362                  goto out_mdio;
   363          }
   364  
   365          platform_set_drvdata(pdev, bus);
   366  
   367          return 0;
   368  
   369  out_mdio:
   370          if (dev->err_interrupt > 0)
   371                  writel(0, dev->regs + MVMDIO_ERR_INT_MASK);
   372  
   373  out_clk:
   374          for (i = 0; i < ARRAY_SIZE(dev->clk); i++) {
   375                  if (IS_ERR(dev->clk[i]))
   376                          break;
   377                  clk_disable_unprepare(dev->clk[i]);
   378                  clk_put(dev->clk[i]);
   379          }
   380  
   381          return ret;
   382  }
   383  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to