tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 459c73db4069c27c1d4a0e20d055b837396364b8 commit: ad6d474d82dfb346573146d1bb0d818a720314fd [15112/15174] rtc: ds1307: Convert to i2c's .probe_new() config: hexagon-buildonly-randconfig-r004-20221214 compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 98b13979fb05f3ed288a900deb843e7b27589e58) 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 # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ad6d474d82dfb346573146d1bb0d818a720314fd git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout ad6d474d82dfb346573146d1bb0d818a720314fd # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/rtc/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot Note: the linux-next/master HEAD 459c73db4069c27c1d4a0e20d055b837396364b8 builds fine. It may have been fixed somewhere. All errors (new ones prefixed by >>): In file included from drivers/rtc/rtc-ds1307.c:12: In file included from include/linux/i2c.h:19: In file included from include/linux/regulator/consumer.h:35: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:13: In file included from include/linux/cgroup.h:26: In file included from include/linux/kernel_stat.h:9: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __raw_readb(PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) ^ In file included from drivers/rtc/rtc-ds1307.c:12: In file included from include/linux/i2c.h:19: In file included from include/linux/regulator/consumer.h:35: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:13: In file included from include/linux/cgroup.h:26: In file included from include/linux/kernel_stat.h:9: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:573: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/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) ^ In file included from drivers/rtc/rtc-ds1307.c:12: In file included from include/linux/i2c.h:19: In file included from include/linux/regulator/consumer.h:35: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:13: In file included from include/linux/cgroup.h:26: In file included from include/linux/kernel_stat.h:9: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:584: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:594: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:604: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); ~~~~~~~~~~ ^ >> drivers/rtc/rtc-ds1307.c:1717:35: error: call to undeclared function 'i2c_client_get_device_id'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] const struct i2c_device_id *id = i2c_client_get_device_id(client); ^ drivers/rtc/rtc-ds1307.c:1717:35: note: did you mean 'i2c_get_device_id'? include/linux/i2c.h:190:5: note: 'i2c_get_device_id' declared here int i2c_get_device_id(const struct i2c_client *client, ^ >> drivers/rtc/rtc-ds1307.c:1717:30: error: incompatible integer to pointer conversion initializing 'const struct i2c_device_id *' with an expression of type 'int' [-Wint-conversion] const struct i2c_device_id *id = i2c_client_get_device_id(client); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6 warnings and 2 errors generated. vim +/i2c_client_get_device_id +1717 drivers/rtc/rtc-ds1307.c 1714 1715 static int ds1307_probe(struct i2c_client *client) 1716 { > 1717 const struct i2c_device_id *id = i2c_client_get_device_id(client); 1718 struct ds1307 *ds1307; 1719 const void *match; 1720 int err = -ENODEV; 1721 int tmp; 1722 const struct chip_desc *chip; 1723 bool want_irq; 1724 bool ds1307_can_wakeup_device = false; 1725 unsigned char regs[8]; 1726 struct ds1307_platform_data *pdata = dev_get_platdata(&client->dev); 1727 u8 trickle_charger_setup = 0; 1728 1729 ds1307 = devm_kzalloc(&client->dev, sizeof(struct ds1307), GFP_KERNEL); 1730 if (!ds1307) 1731 return -ENOMEM; 1732 1733 dev_set_drvdata(&client->dev, ds1307); 1734 ds1307->dev = &client->dev; 1735 ds1307->name = client->name; 1736 1737 ds1307->regmap = devm_regmap_init_i2c(client, ®map_config); 1738 if (IS_ERR(ds1307->regmap)) { 1739 dev_err(ds1307->dev, "regmap allocation failed\n"); 1740 return PTR_ERR(ds1307->regmap); 1741 } 1742 1743 i2c_set_clientdata(client, ds1307); 1744 1745 match = device_get_match_data(&client->dev); 1746 if (match) { 1747 ds1307->type = (enum ds_type)match; 1748 chip = &chips[ds1307->type]; 1749 } else if (id) { 1750 chip = &chips[id->driver_data]; 1751 ds1307->type = id->driver_data; 1752 } else { 1753 return -ENODEV; 1754 } 1755 1756 want_irq = client->irq > 0 && chip->alarm; 1757 1758 if (!pdata) 1759 trickle_charger_setup = ds1307_trickle_init(ds1307, chip); 1760 else if (pdata->trickle_charger_setup) 1761 trickle_charger_setup = pdata->trickle_charger_setup; 1762 1763 if (trickle_charger_setup && chip->trickle_charger_reg) { 1764 dev_dbg(ds1307->dev, 1765 "writing trickle charger info 0x%x to 0x%x\n", 1766 trickle_charger_setup, chip->trickle_charger_reg); 1767 regmap_write(ds1307->regmap, chip->trickle_charger_reg, 1768 trickle_charger_setup); 1769 } 1770 -- 0-DAY CI Kernel Test Service https://01.org/lkp