Re: [PATCH v2 1/2] clk: qcom: rpmh: skip undefined clocks when registering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Taniya,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on clk/clk-next]
[also build test WARNING on v5.5-rc5 next-20191220]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Taniya-Das/Add-support-for-IPA-clock-for-SC7180/20200106-201629
base:   https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
config: mips-allmodconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=mips 

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

All warnings (new ones prefixed by >>):

   drivers/clk//qcom/clk-rpmh.c: In function 'clk_rpmh_probe':
>> drivers/clk//qcom/clk-rpmh.c:441:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      const char *name = hw_clks[i]->init->name;
      ^~~~~

vim +441 drivers/clk//qcom/clk-rpmh.c

   419	
   420	static int clk_rpmh_probe(struct platform_device *pdev)
   421	{
   422		struct clk_hw **hw_clks;
   423		struct clk_rpmh *rpmh_clk;
   424		const struct clk_rpmh_desc *desc;
   425		int ret, i;
   426	
   427		desc = of_device_get_match_data(&pdev->dev);
   428		if (!desc)
   429			return -ENODEV;
   430	
   431		hw_clks = desc->clks;
   432	
   433		for (i = 0; i < desc->num_clks; i++) {
   434			u32 res_addr;
   435			size_t aux_data_len;
   436			const struct bcm_db *data;
   437	
   438			if (!hw_clks[i])
   439				continue;
   440	
 > 441			const char *name = hw_clks[i]->init->name;
   442	
   443			rpmh_clk = to_clk_rpmh(hw_clks[i]);
   444			res_addr = cmd_db_read_addr(rpmh_clk->res_name);
   445			if (!res_addr) {
   446				dev_err(&pdev->dev, "missing RPMh resource address for %s\n",
   447					rpmh_clk->res_name);
   448				return -ENODEV;
   449			}
   450	
   451			data = cmd_db_read_aux_data(rpmh_clk->res_name, &aux_data_len);
   452			if (IS_ERR(data)) {
   453				ret = PTR_ERR(data);
   454				dev_err(&pdev->dev,
   455					"error reading RPMh aux data for %s (%d)\n",
   456					rpmh_clk->res_name, ret);
   457				return ret;
   458			}
   459	
   460			/* Convert unit from Khz to Hz */
   461			if (aux_data_len == sizeof(*data))
   462				rpmh_clk->unit = le32_to_cpu(data->unit) * 1000ULL;
   463	
   464			rpmh_clk->res_addr += res_addr;
   465			rpmh_clk->dev = &pdev->dev;
   466	
   467			ret = devm_clk_hw_register(&pdev->dev, hw_clks[i]);
   468			if (ret) {
   469				dev_err(&pdev->dev, "failed to register %s\n", name);
   470				return ret;
   471			}
   472		}
   473	
   474		/* typecast to silence compiler warning */
   475		ret = devm_of_clk_add_hw_provider(&pdev->dev, of_clk_rpmh_hw_get,
   476						  (void *)desc);
   477		if (ret) {
   478			dev_err(&pdev->dev, "Failed to add clock provider\n");
   479			return ret;
   480		}
   481	
   482		dev_dbg(&pdev->dev, "Registered RPMh clocks\n");
   483	
   484		return 0;
   485	}
   486	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux