All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: cros-kernel-buildreports@googlegroups.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [android-common:incoming-android15-6.6-desktop-chromeos 498/498] drivers/cpufreq/mediatek-cpufreq-hw_main.c:620:63-68: WARNING: conversion to bool not needed here
Date: Fri, 28 Mar 2025 12:30:37 +0800	[thread overview]
Message-ID: <202503281257.BmX4sfnQ-lkp@intel.com> (raw)

tree:   https://android.googlesource.com/kernel/common incoming-android15-6.6-desktop-chromeos
head:   971c23c737d79895eb40ddbbed5817f6ee6ea162
commit: 3c107c736a59f5d566bc0d7ef4910c92040f0017 [498/498] CHROMIUM: cpufreq: Add cpufreq-hw drivers for MT8196
config: arm-randconfig-r061-20250328 (https://download.01.org/0day-ci/archive/20250328/202503281257.BmX4sfnQ-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project c2692afc0a92cd5da140dfcdfff7818a5b8ce997)

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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503281257.BmX4sfnQ-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/cpufreq/mediatek-cpufreq-hw_main.c:620:63-68: WARNING: conversion to bool not needed here
--
>> drivers/cpufreq/mediatek-cpufreq-hw_fdvfs.c:77:1-7: ERROR: missing put_device; call of_find_device_by_node on line 54, but without a corresponding object release within this function.
   drivers/cpufreq/mediatek-cpufreq-hw_fdvfs.c:83:1-7: ERROR: missing put_device; call of_find_device_by_node on line 54, but without a corresponding object release within this function.
--
>> drivers/cpufreq/mediatek-cpufreq-hw_main.c:583:2-8: ERROR: missing put_device; call of_find_device_by_node on line 574, but without a corresponding object release within this function.
   drivers/cpufreq/mediatek-cpufreq-hw_main.c:589:2-8: ERROR: missing put_device; call of_find_device_by_node on line 574, but without a corresponding object release within this function.
   drivers/cpufreq/mediatek-cpufreq-hw_main.c:627:3-9: ERROR: missing put_device; call of_find_device_by_node on line 574, but without a corresponding object release within this function.
   drivers/cpufreq/mediatek-cpufreq-hw_main.c:636:3-9: ERROR: missing put_device; call of_find_device_by_node on line 574, but without a corresponding object release within this function.
   drivers/cpufreq/mediatek-cpufreq-hw_main.c:643:3-9: ERROR: missing put_device; call of_find_device_by_node on line 574, but without a corresponding object release within this function.
   drivers/cpufreq/mediatek-cpufreq-hw_main.c:649:4-10: ERROR: missing put_device; call of_find_device_by_node on line 574, but without a corresponding object release within this function.
   drivers/cpufreq/mediatek-cpufreq-hw_main.c:656:4-10: ERROR: missing put_device; call of_find_device_by_node on line 574, but without a corresponding object release within this function.
   drivers/cpufreq/mediatek-cpufreq-hw_main.c:664:2-8: ERROR: missing put_device; call of_find_device_by_node on line 574, but without a corresponding object release within this function.
   drivers/cpufreq/mediatek-cpufreq-hw_main.c:669:1-7: ERROR: missing put_device; call of_find_device_by_node on line 574, but without a corresponding object release within this function.
   drivers/cpufreq/mediatek-cpufreq-hw_main.c:673:1-7: ERROR: missing put_device; call of_find_device_by_node on line 574, but without a corresponding object release within this function.

vim +620 drivers/cpufreq/mediatek-cpufreq-hw_main.c

   551	
   552	static int mtk_cpufreq_hw_driver_probe(struct platform_device *pdev)
   553	{
   554		struct device_node *cpu_np;
   555		struct device_node *hvfs_node, *csram_sys_node;
   556		struct of_phandle_args args;
   557		struct resource *csram_res;
   558		struct platform_device *pdev_c;
   559		static void __iomem *csram_base;
   560		const u16 *offsets;
   561		unsigned int cpu;
   562		int ret;
   563	
   564		offsets = of_device_get_match_data(&pdev->dev);
   565		if (!offsets)
   566			return -EINVAL;
   567	
   568		hvfs_node = of_find_compatible_node(NULL, NULL, "mediatek,cpufreq-hybrid");
   569		if (!hvfs_node) {
   570			dev_err(&pdev->dev, "failed to find node @ %s\n", __func__);
   571			return -ENODEV;
   572		}
   573	
 > 574		pdev_c = of_find_device_by_node(hvfs_node);
   575		if (!pdev_c) {
   576			dev_err(&pdev->dev, "failed to find pdev @ %s\n", __func__);
   577			return -EINVAL;
   578		}
   579	
   580		csram_res = platform_get_resource(pdev_c, IORESOURCE_MEM, 1);
   581		if (!csram_res) {
   582			dev_err(&pdev->dev, "failed to get mem resource @ %s\n", __func__);
 > 583			return -ENODEV;
   584		}
   585	
   586		if (!request_mem_region(csram_res->start, resource_size(csram_res),
   587				csram_res->name)) {
   588			dev_err(&pdev->dev, "failed to request resource %pR\n", csram_res);
   589			return -EBUSY;
   590		}
   591	
   592		csram_base = ioremap(csram_res->start, resource_size(csram_res));
   593		if (!csram_base) {
   594			dev_err(&pdev->dev, "failed to map csram_base @ %s\n", __func__);
   595			ret = -ENOMEM;
   596			goto release_region;
   597		}
   598	
   599		csram_sys_node = of_parse_phandle(hvfs_node, "csram-sys-base", 0);
   600		if (csram_sys_node != NULL) {
   601			static void __iomem *csram_sys_base;
   602	
   603			csram_sys_base = of_iomap(csram_sys_node, 0);
   604			if (readl_relaxed(csram_sys_base) != CHECK_VAL ||
   605			    !readl_relaxed(csram_sys_base + CSRAM_BASE_ADD +
   606					   cpufreq_mtk_offsets[REG_FREQ_HW_STATE])) {
   607				dev_err(&pdev->dev, "%s: cpufreq hardware not enable\n", __func__);
   608				ret = -EIO;
   609				iounmap(csram_base);
   610				goto release_region;
   611			}
   612			dev_dbg(&pdev->dev, "%s: cpufreq hardware enable\n", __func__);
   613		}
   614	
   615		if (readl_relaxed(csram_base + REG_FREQ_SCALING)){
   616			freq_scaling_disabled = false;
   617			iounmap(csram_base);
   618			release_mem_region(csram_res->start, resource_size(csram_res));
   619		}
 > 620		fdvfs_enabled = check_fdvfs_support(&pdev->dev) == 1 ? true : false;
   621		per_core_enabled = check_per_core_enabled(&pdev->dev);
   622	
   623		if (per_core_enabled) {
   624			per_core_base = ioremap(csram_res->start + PER_CORE_OFF, PER_CORE_SIZE);
   625			if (!per_core_base) {
   626				dev_err(&pdev->dev, "failed to map per_core_base @ %s\n", __func__);
   627				return -ENOMEM;
   628			}
   629		}
   630	
   631		for_each_possible_cpu(cpu) {
   632			cpu_np = of_cpu_device_node_get(cpu);
   633			if (!cpu_np) {
   634				dev_err(&pdev->dev, "Failed to get cpu %d device\n",
   635					cpu);
   636				return -ENODEV;
   637			}
   638	
   639			ret = of_parse_phandle_with_args(cpu_np, "performance-domains",
   640							 "#performance-domain-cells", 0,
   641							 &args);
   642			if (ret < 0)
   643				return ret;
   644	
   645			if (per_core_enabled) {
   646				ret = mtk_per_core_cpu_resources_init(pdev, cpu, args.args[0], offsets);
   647				if (ret) {
   648					dev_err(&pdev->dev, "per-core CPUFreq resource init failed\n");
   649					return ret;
   650				}
   651			} else {
   652				/* Get the bases of cpufreq for domains */
   653				ret = mtk_cpu_resources_init(pdev, cpu, args.args[0], offsets);
   654				if (ret) {
   655					dev_err(&pdev->dev, "CPUFreq resource init failed\n");
   656					return ret;
   657				}
   658			}
   659		}
   660	
   661		ret = cpufreq_register_driver(&cpufreq_mtk_hw_driver);
   662		if (ret) {
   663			dev_err(&pdev->dev, "CPUFreq HW driver failed to register\n");
   664			return ret;
   665		}
   666		register_die_notifier(&die_blk);
   667		atomic_notifier_chain_register(&panic_notifier_list, &panic_blk);
   668	
   669		return 0;
   670	
   671	release_region:
   672		release_mem_region(csram_res->start, resource_size(csram_res));
   673		return ret;
   674	}
   675	

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

                 reply	other threads:[~2025-03-28  4:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202503281257.BmX4sfnQ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cros-kernel-buildreports@googlegroups.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.