Re: [PATCH v8 2/2] power: supply: bq256xx: Introduce the BQ256XX charger driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ricardo,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on power-supply/for-next]
[also build test WARNING on robh/for-next v5.11-rc2 next-20210104]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Ricardo-Rivera-Matos/Introduce-the-BQ256XX-family-of-chargers/20210105-043028
base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
config: s390-randconfig-r005-20210105 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 5c951623bc8965fa1e89660f2f5f4a2944e4981a)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install s390 cross compiling tool for clang build
        # apt-get install binutils-s390x-linux-gnu
        # https://github.com/0day-ci/linux/commit/82436c2c6d99c4effb187bbd09b47c4dc59a1f3d
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Ricardo-Rivera-Matos/Introduce-the-BQ256XX-family-of-chargers/20210105-043028
        git checkout 82436c2c6d99c4effb187bbd09b47c4dc59a1f3d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   include/uapi/linux/swab.h:19:12: note: expanded from macro '___constant_swab32'
           (((__u32)(x) & (__u32)0x000000ffUL) << 24) |            \
                     ^
   In file included from drivers/power/supply/bq256xx_charger.c:13:
   In file included from include/linux/regmap.h:20:
   In file included from include/linux/iopoll.h:14:
   In file included from include/linux/io.h:13:
   In file included from arch/s390/include/asm/io.h:80:
   include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
           ___constant_swab32(x) :                 \
                              ^
   include/uapi/linux/swab.h:20:12: note: expanded from macro '___constant_swab32'
           (((__u32)(x) & (__u32)0x0000ff00UL) <<  8) |            \
                     ^
   In file included from drivers/power/supply/bq256xx_charger.c:13:
   In file included from include/linux/regmap.h:20:
   In file included from include/linux/iopoll.h:14:
   In file included from include/linux/io.h:13:
   In file included from arch/s390/include/asm/io.h:80:
   include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
           ___constant_swab32(x) :                 \
                              ^
   include/uapi/linux/swab.h:21:12: note: expanded from macro '___constant_swab32'
           (((__u32)(x) & (__u32)0x00ff0000UL) >>  8) |            \
                     ^
   In file included from drivers/power/supply/bq256xx_charger.c:13:
   In file included from include/linux/regmap.h:20:
   In file included from include/linux/iopoll.h:14:
   In file included from include/linux/io.h:13:
   In file included from arch/s390/include/asm/io.h:80:
   include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
           ___constant_swab32(x) :                 \
                              ^
   include/uapi/linux/swab.h:22:12: note: expanded from macro '___constant_swab32'
           (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
                     ^
   In file included from drivers/power/supply/bq256xx_charger.c:13:
   In file included from include/linux/regmap.h:20:
   In file included from include/linux/iopoll.h:14:
   In file included from include/linux/io.h:13:
   In file included from arch/s390/include/asm/io.h:80:
   include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:120:12: note: expanded from macro '__swab32'
           __fswab32(x))
                     ^
   In file included from drivers/power/supply/bq256xx_charger.c:13:
   In file included from include/linux/regmap.h:20:
   In file included from include/linux/iopoll.h:14:
   In file included from include/linux/io.h:13:
   In file included from arch/s390/include/asm/io.h:80:
   include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsb(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsw(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsl(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesb(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesw(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesl(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
>> drivers/power/supply/bq256xx_charger.c:1644:29: warning: variable 'psy_cfg' is uninitialized when used here [-Wuninitialized]
           ret = bq256xx_parse_dt(bq, psy_cfg, dev);
                                      ^~~~~~~
   drivers/power/supply/bq256xx_charger.c:1618:37: note: initialize the variable 'psy_cfg' to silence this warning
           struct power_supply_config *psy_cfg;
                                              ^
                                               = NULL
>> drivers/power/supply/bq256xx_charger.c:1720:36: warning: unused variable 'bq256xx_acpi_match' [-Wunused-const-variable]
   static const struct acpi_device_id bq256xx_acpi_match[] = {
                                      ^
   22 warnings generated.


vim +/psy_cfg +1644 drivers/power/supply/bq256xx_charger.c

  1612	
  1613	static int bq256xx_probe(struct i2c_client *client,
  1614				 const struct i2c_device_id *id)
  1615	{
  1616		struct device *dev = &client->dev;
  1617		struct bq256xx_device *bq;
  1618		struct power_supply_config *psy_cfg;
  1619	
  1620		int ret;
  1621	
  1622		bq = devm_kzalloc(dev, sizeof(*bq), GFP_KERNEL);
  1623		if (!bq)
  1624			return -ENOMEM;
  1625	
  1626		bq->client = client;
  1627		bq->dev = dev;
  1628		bq->chip_info = &bq256xx_chip_info_tbl[id->driver_data];
  1629	
  1630		mutex_init(&bq->lock);
  1631	
  1632		strncpy(bq->model_name, id->name, I2C_NAME_SIZE);
  1633	
  1634		bq->regmap = devm_regmap_init_i2c(client,
  1635						bq->chip_info->bq256xx_regmap_config);
  1636	
  1637		if (IS_ERR(bq->regmap)) {
  1638			dev_err(dev, "Failed to allocate register map\n");
  1639			return PTR_ERR(bq->regmap);
  1640		}
  1641	
  1642		i2c_set_clientdata(client, bq);
  1643	
> 1644		ret = bq256xx_parse_dt(bq, psy_cfg, dev);
  1645		if (ret) {
  1646			dev_err(dev, "Failed to read device tree properties%d\n", ret);
  1647			return ret;
  1648		}
  1649	
  1650		ret = devm_add_action_or_reset(dev, bq256xx_charger_reset, bq);
  1651		if (ret)
  1652			return ret;
  1653	
  1654		/* OTG reporting */
  1655		bq->usb2_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
  1656		if (!IS_ERR_OR_NULL(bq->usb2_phy)) {
  1657			INIT_WORK(&bq->usb_work, bq256xx_usb_work);
  1658			bq->usb_nb.notifier_call = bq256xx_usb_notifier;
  1659			usb_register_notifier(bq->usb2_phy, &bq->usb_nb);
  1660		}
  1661	
  1662		bq->usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3);
  1663		if (!IS_ERR_OR_NULL(bq->usb3_phy)) {
  1664			INIT_WORK(&bq->usb_work, bq256xx_usb_work);
  1665			bq->usb_nb.notifier_call = bq256xx_usb_notifier;
  1666			usb_register_notifier(bq->usb3_phy, &bq->usb_nb);
  1667		}
  1668	
  1669		if (client->irq) {
  1670			ret = devm_request_threaded_irq(dev, client->irq, NULL,
  1671							bq256xx_irq_handler_thread,
  1672							IRQF_TRIGGER_FALLING |
  1673							IRQF_ONESHOT,
  1674							dev_name(&client->dev), bq);
  1675			if (ret < 0) {
  1676				dev_err(dev, "get irq fail: %d\n", ret);
  1677				return ret;
  1678			}
  1679		}
  1680	
  1681		ret = bq256xx_power_supply_init(bq, psy_cfg, dev);
  1682		if (ret) {
  1683			dev_err(dev, "Failed to register power supply\n");
  1684			return ret;
  1685		}
  1686	
  1687		ret = bq256xx_hw_init(bq);
  1688		if (ret) {
  1689			dev_err(dev, "Cannot initialize the chip.\n");
  1690			return ret;
  1691		}
  1692	
  1693		return ret;
  1694	}
  1695	
  1696	static const struct i2c_device_id bq256xx_i2c_ids[] = {
  1697		{ "bq25600", BQ25600 },
  1698		{ "bq25600d", BQ25600D },
  1699		{ "bq25601", BQ25601 },
  1700		{ "bq25601d", BQ25601D },
  1701		{ "bq25611d", BQ25611D },
  1702		{ "bq25618", BQ25618 },
  1703		{ "bq25619", BQ25619 },
  1704		{},
  1705	};
  1706	MODULE_DEVICE_TABLE(i2c, bq256xx_i2c_ids);
  1707	
  1708	static const struct of_device_id bq256xx_of_match[] = {
  1709		{ .compatible = "ti,bq25600", .data = (void *)BQ25600 },
  1710		{ .compatible = "ti,bq25600d", .data = (void *)BQ25600D },
  1711		{ .compatible = "ti,bq25601", .data = (void *)BQ25601 },
  1712		{ .compatible = "ti,bq25601d", .data = (void *)BQ25601D },
  1713		{ .compatible = "ti,bq25611d", .data = (void *)BQ25611D },
  1714		{ .compatible = "ti,bq25618", .data = (void *)BQ25618 },
  1715		{ .compatible = "ti,bq25619", .data = (void *)BQ25619 },
  1716		{ },
  1717	};
  1718	MODULE_DEVICE_TABLE(of, bq256xx_of_match);
  1719	
> 1720	static const struct acpi_device_id bq256xx_acpi_match[] = {
  1721		{ "bq25600", BQ25600 },
  1722		{ "bq25600d", BQ25600D },
  1723		{ "bq25601", BQ25601 },
  1724		{ "bq25601d", BQ25601D },
  1725		{ "bq25611d", BQ25611D },
  1726		{ "bq25618", BQ25618 },
  1727		{ "bq25619", BQ25619 },
  1728		{},
  1729	};
  1730	MODULE_DEVICE_TABLE(acpi, bq256xx_acpi_match);
  1731	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux