lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202505191305.un0tzZu1-lkp@intel.com>
Date: Mon, 19 May 2025 13:58:03 +0800
From: kernel test robot <lkp@...el.com>
To: Charles Han <hanchunchao@...pur.com>, krzk@...nel.org, sre@...nel.org,
	akpm@...ux-foundation.org, lee@...nel.org
Cc: oe-kbuild-all@...ts.linux.dev, linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org, Charles Han <hanchunchao@...pur.com>
Subject: Re: [PATCH V2] charger: max14577: Handle NULL pdata when CONFIG_OF
 is not set

Hi Charles,

kernel test robot noticed the following build errors:

[auto build test ERROR on sre-power-supply/for-next]
[also build test ERROR on linus/master v6.15-rc7 next-20250516]
[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/Charles-Han/charger-max14577-Handle-NULL-pdata-when-CONFIG_OF-is-not-set/20250519-095431
base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
patch link:    https://lore.kernel.org/r/20250519014804.2244-1-hanchunchao%40inspur.com
patch subject: [PATCH V2] charger: max14577: Handle NULL pdata when CONFIG_OF is not set
config: sh-randconfig-002-20250519 (https://download.01.org/0day-ci/archive/20250519/202505191305.un0tzZu1-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250519/202505191305.un0tzZu1-lkp@intel.com/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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505191305.un0tzZu1-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/power/supply/max14577_charger.c: In function 'max14577_charger_dt_init':
>> drivers/power/supply/max14577_charger.c:504:16: error: returning 'int' from a function with return type 'struct max14577_charger_platform_data *' makes pointer from integer without a cast [-Wint-conversion]
     504 |         return -ENODATA;
         |                ^


vim +504 drivers/power/supply/max14577_charger.c

   454	
   455	#ifdef CONFIG_OF
   456	static struct max14577_charger_platform_data *max14577_charger_dt_init(
   457			struct platform_device *pdev)
   458	{
   459		struct max14577_charger_platform_data *pdata;
   460		struct device_node *np = pdev->dev.of_node;
   461		int ret;
   462	
   463		if (!np) {
   464			dev_err(&pdev->dev, "No charger OF node\n");
   465			return ERR_PTR(-EINVAL);
   466		}
   467	
   468		pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
   469		if (!pdata)
   470			return ERR_PTR(-ENOMEM);
   471	
   472		ret = of_property_read_u32(np, "maxim,constant-uvolt",
   473				&pdata->constant_uvolt);
   474		if (ret) {
   475			dev_err(&pdev->dev, "Cannot parse maxim,constant-uvolt field from DT\n");
   476			return ERR_PTR(ret);
   477		}
   478	
   479		ret = of_property_read_u32(np, "maxim,fast-charge-uamp",
   480				&pdata->fast_charge_uamp);
   481		if (ret) {
   482			dev_err(&pdev->dev, "Cannot parse maxim,fast-charge-uamp field from DT\n");
   483			return ERR_PTR(ret);
   484		}
   485	
   486		ret = of_property_read_u32(np, "maxim,eoc-uamp", &pdata->eoc_uamp);
   487		if (ret) {
   488			dev_err(&pdev->dev, "Cannot parse maxim,eoc-uamp field from DT\n");
   489			return ERR_PTR(ret);
   490		}
   491	
   492		ret = of_property_read_u32(np, "maxim,ovp-uvolt", &pdata->ovp_uvolt);
   493		if (ret) {
   494			dev_err(&pdev->dev, "Cannot parse maxim,ovp-uvolt field from DT\n");
   495			return ERR_PTR(ret);
   496		}
   497	
   498		return pdata;
   499	}
   500	#else /* CONFIG_OF */
   501	static struct max14577_charger_platform_data *max14577_charger_dt_init(
   502			struct platform_device *pdev)
   503	{
 > 504		return -ENODATA;
   505	}
   506	#endif /* CONFIG_OF */
   507	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ