All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: "Nuno Sá" <nuno.sa@analog.com>
Cc: kbuild-all@lists.01.org, linux-hwmon@vger.kernel.org,
	Guenter Roeck <linux@roeck-us.net>
Subject: [hwmon:hwmon-next 3/6] drivers//hwmon/axi-fan-control.c:419:26: warning: 'res' may be used uninitialized in this function
Date: Tue, 11 Feb 2020 10:27:37 +0800	[thread overview]
Message-ID: <202002111025.d165LQe1%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3897 bytes --]

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@intel.com>

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@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 51643 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [hwmon:hwmon-next 3/6] drivers//hwmon/axi-fan-control.c:419:26: warning: 'res' may be used uninitialized in this function
Date: Tue, 11 Feb 2020 10:27:37 +0800	[thread overview]
Message-ID: <202002111025.d165LQe1%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4007 bytes --]

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@intel.com>

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(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 51643 bytes --]

             reply	other threads:[~2020-02-11  2:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11  2:27 kbuild test robot [this message]
2020-02-11  2:27 ` [hwmon:hwmon-next 3/6] drivers//hwmon/axi-fan-control.c:419:26: warning: 'res' may be used uninitialized in this function kbuild test robot

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=202002111025.d165LQe1%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=nuno.sa@analog.com \
    /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.