[hwmon:hwmon-next 3/6] drivers//hwmon/axi-fan-control.c:419:26: warning: 'res' may be used uninitialized in this function

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
head:   2cef560d05dd1355fc612c9c9ad061337adc4d59
commit: 690dd9ce04f6a1b319bcb211ee0b3e125a4fa4f2 [3/6] hwmon: Support ADI Fan Control IP
config: c6x-allyesconfig (attached as .config)
compiler: c6x-elf-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
        git checkout 690dd9ce04f6a1b319bcb211ee0b3e125a4fa4f2
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=c6x 

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

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers//hwmon/axi-fan-control.c: In function 'axi_fan_control_probe':
>> drivers//hwmon/axi-fan-control.c:419:26: warning: 'res' may be used uninitialized in this function [-Wmaybe-uninitialized]
      (unsigned long long)res->start, ctl->base);
                             ^~

vim +/res +419 drivers//hwmon/axi-fan-control.c

   385	
   386	static int axi_fan_control_probe(struct platform_device *pdev)
   387	{
   388		struct axi_fan_control_data *ctl;
   389		struct clk *clk;
   390		const struct of_device_id *id;
   391		const char *name = "axi_fan_control";
   392		struct resource *res;
   393		u32 version;
   394		int ret;
   395	
   396		id = of_match_node(axi_fan_control_of_match, pdev->dev.of_node);
   397		if (!id)
   398			return -EINVAL;
   399	
   400		ctl = devm_kzalloc(&pdev->dev, sizeof(*ctl), GFP_KERNEL);
   401		if (!ctl)
   402			return -ENOMEM;
   403	
   404		ctl->base = devm_platform_ioremap_resource(pdev, 0);
   405		if (IS_ERR(ctl->base))
   406			return PTR_ERR(ctl->base);
   407	
   408		clk = devm_clk_get(&pdev->dev, NULL);
   409		if (IS_ERR(clk)) {
   410			dev_err(&pdev->dev, "clk_get failed with %ld\n", PTR_ERR(clk));
   411			return PTR_ERR(clk);
   412		}
   413	
   414		ctl->clk_rate = clk_get_rate(clk);
   415		if (!ctl->clk_rate)
   416			return -EINVAL;
   417	
   418		dev_dbg(&pdev->dev, "Re-mapped from 0x%08llX to %p\n",
 > 419			(unsigned long long)res->start, ctl->base);
   420	
   421		version = axi_ioread(ADI_AXI_REG_VERSION, ctl);
   422		if (ADI_AXI_PCORE_VER_MAJOR(version) !=
   423		    ADI_AXI_PCORE_VER_MAJOR((*(u32 *)id->data))) {
   424			dev_err(&pdev->dev, "Major version mismatch. Expected %d.%.2d.%c, Reported %d.%.2d.%c\n",
   425				ADI_AXI_PCORE_VER_MAJOR((*(u32 *)id->data)),
   426				ADI_AXI_PCORE_VER_MINOR((*(u32 *)id->data)),
   427				ADI_AXI_PCORE_VER_PATCH((*(u32 *)id->data)),
   428				ADI_AXI_PCORE_VER_MAJOR(version),
   429				ADI_AXI_PCORE_VER_MINOR(version),
   430				ADI_AXI_PCORE_VER_PATCH(version));
   431			return -ENODEV;
   432		}
   433	
   434		ctl->irq = platform_get_irq(pdev, 0);
   435		if (ctl->irq < 0)
   436			return ctl->irq;
   437	
   438		ret = devm_request_threaded_irq(&pdev->dev, ctl->irq, NULL,
   439						axi_fan_control_irq_handler,
   440						IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
   441						pdev->driver_override, ctl);
   442		if (ret) {
   443			dev_err(&pdev->dev, "failed to request an irq, %d", ret);
   444			return ret;
   445		}
   446	
   447		ret = axi_fan_control_init(ctl, pdev->dev.of_node);
   448		if (ret) {
   449			dev_err(&pdev->dev, "Failed to initialize device\n");
   450			return ret;
   451		}
   452	
   453		ctl->hdev = devm_hwmon_device_register_with_info(&pdev->dev,
   454								 name,
   455								 ctl,
   456								 &axi_chip_info,
   457								 NULL);
   458	
   459		return PTR_ERR_OR_ZERO(ctl->hdev);
   460	}
   461	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux