Re: [PATCH] PM: domains: Don't attach a device to genpd that corresponds to a provider

From: kernel test robot
Date: Fri Jul 09 2021 - 14:50:11 EST


Hi Ulf,

I love your patch! Perhaps something to improve:

[auto build test WARNING on pm/linux-next]
[also build test WARNING on v5.13 next-20210709]
[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/Ulf-Hansson/PM-domains-Don-t-attach-a-device-to-genpd-that-corresponds-to-a-provider/20210709-205736
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: i386-randconfig-s001-20210709 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://github.com/0day-ci/linux/commit/5f3ae7877b4b3a9c2c4d96c2106c41b16b981958
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Ulf-Hansson/PM-domains-Don-t-attach-a-device-to-genpd-that-corresponds-to-a-provider/20210709-205736
git checkout 5f3ae7877b4b3a9c2c4d96c2106c41b16b981958
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386

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


sparse warnings: (new ones prefixed by >>)
>> drivers/base/power/domain.c:2704:24: sparse: sparse: incorrect type in return expression (different base types) @@ expected int @@ got void * @@
drivers/base/power/domain.c:2704:24: sparse: expected int
drivers/base/power/domain.c:2704:24: sparse: got void *

vim +2704 drivers/base/power/domain.c

2683
2684 /**
2685 * genpd_dev_pm_attach - Attach a device to its PM domain using DT.
2686 * @dev: Device to attach.
2687 *
2688 * Parse device's OF node to find a PM domain specifier. If such is found,
2689 * attaches the device to retrieved pm_domain ops.
2690 *
2691 * Returns 1 on successfully attached PM domain, 0 when the device don't need a
2692 * PM domain or when multiple power-domains exists for it, else a negative error
2693 * code. Note that if a power-domain exists for the device, but it cannot be
2694 * found or turned on, then return -EPROBE_DEFER to ensure that the device is
2695 * not probed and to re-try again later.
2696 */
2697 int genpd_dev_pm_attach(struct device *dev)
2698 {
2699 if (!dev->of_node)
2700 return 0;
2701
2702 /* Don't try to attach a genpd provider. */
2703 if (of_find_property(dev->of_node, "#power-domain-cells", NULL))
> 2704 return NULL;
2705
2706 /*
2707 * Devices with multiple PM domains must be attached separately, as we
2708 * can only attach one PM domain per device.
2709 */
2710 if (of_count_phandle_with_args(dev->of_node, "power-domains",
2711 "#power-domain-cells") != 1)
2712 return 0;
2713
2714 return __genpd_dev_pm_attach(dev, dev, 0, true);
2715 }
2716 EXPORT_SYMBOL_GPL(genpd_dev_pm_attach);
2717

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

Attachment: .config.gz
Description: application/gzip