Re: [PATCH v1 2/3] pinctrl: baytrail: Replace ifdeffery by pm_sleep_ptr() macro

From: kernel test robot
Date: Wed Sep 04 2024 - 09:11:55 EST


Hi Andy,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linusw-pinctrl/devel]
[also build test WARNING on linusw-pinctrl/for-next linus/master v6.11-rc6 next-20240904]
[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#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/pinctrl-intel-Replace-ifdeffery-by-pm_sleep_ptr-macro/20240904-011041
base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link: https://lore.kernel.org/r/20240903170752.3564538-3-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 2/3] pinctrl: baytrail: Replace ifdeffery by pm_sleep_ptr() macro
config: i386-buildonly-randconfig-002-20240904 (https://download.01.org/0day-ci/archive/20240904/202409042054.YDMtnXfx-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240904/202409042054.YDMtnXfx-lkp@xxxxxxxxx/reproduce)

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 <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409042054.YDMtnXfx-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

drivers/pinctrl/intel/pinctrl-baytrail.c: In function 'byt_pinctrl_probe':
>> drivers/pinctrl/intel/pinctrl-baytrail.c:1610:49: warning: the address of 'byt_pinctrl_pm_init' will always evaluate as 'true' [-Waddress]
1610 | ret = pm_sleep_ptr(byt_pinctrl_pm_init) ? byt_pinctrl_pm_init(vg) : 0;
| ^


vim +1610 drivers/pinctrl/intel/pinctrl-baytrail.c

1587
1588 static int byt_pinctrl_probe(struct platform_device *pdev)
1589 {
1590 const struct intel_pinctrl_soc_data *soc_data;
1591 struct device *dev = &pdev->dev;
1592 struct intel_pinctrl *vg;
1593 int ret;
1594
1595 soc_data = intel_pinctrl_get_soc_data(pdev);
1596 if (IS_ERR(soc_data))
1597 return PTR_ERR(soc_data);
1598
1599 vg = devm_kzalloc(dev, sizeof(*vg), GFP_KERNEL);
1600 if (!vg)
1601 return -ENOMEM;
1602
1603 vg->dev = dev;
1604 ret = byt_set_soc_data(vg, soc_data);
1605 if (ret) {
1606 dev_err(dev, "failed to set soc data\n");
1607 return ret;
1608 }
1609
> 1610 ret = pm_sleep_ptr(byt_pinctrl_pm_init) ? byt_pinctrl_pm_init(vg) : 0;
1611 if (ret)
1612 return ret;
1613
1614 vg->pctldesc = byt_pinctrl_desc;
1615 vg->pctldesc.name = dev_name(dev);
1616 vg->pctldesc.pins = vg->soc->pins;
1617 vg->pctldesc.npins = vg->soc->npins;
1618
1619 vg->pctldev = devm_pinctrl_register(dev, &vg->pctldesc, vg);
1620 if (IS_ERR(vg->pctldev)) {
1621 dev_err(dev, "failed to register pinctrl driver\n");
1622 return PTR_ERR(vg->pctldev);
1623 }
1624
1625 ret = byt_gpio_probe(vg);
1626 if (ret)
1627 return ret;
1628
1629 platform_set_drvdata(pdev, vg);
1630
1631 return 0;
1632 }
1633

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