linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/staging/wfx/main.c:47:14-21: ERROR: PTR_ERR applied after initialization to constant on line 42
@ 2020-06-08 13:31 kernel test robot
  2020-06-08 13:51 ` Jérôme Pouiller
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2020-06-08 13:31 UTC (permalink / raw)
  To: Jérôme Pouiller; +Cc: kbuild-all, linux-kernel, Greg Kroah-Hartman

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   af7b4801030c07637840191c69eb666917e4135d
commit: 0096214a59a72b3c3c943e27bd03307324d3ce0f staging: wfx: add support for I/O access
date:   8 months ago
config: i386-randconfig-c024-20200607 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


coccinelle warnings: (new ones prefixed by >>)

>> drivers/staging/wfx/main.c:47:14-21: ERROR: PTR_ERR applied after initialization to constant on line 42

vim +47 drivers/staging/wfx/main.c

    30	
    31	struct gpio_desc *wfx_get_gpio(struct device *dev, int override, const char *label)
    32	{
    33		struct gpio_desc *ret;
    34		char label_buf[256];
    35	
    36		if (override >= 0) {
    37			snprintf(label_buf, sizeof(label_buf), "wfx_%s", label);
    38			ret = ERR_PTR(devm_gpio_request_one(dev, override, GPIOF_OUT_INIT_LOW, label_buf));
    39			if (!ret)
    40				ret = gpio_to_desc(override);
    41		} else if (override == -1) {
  > 42			ret = NULL;
    43		} else {
    44			ret = devm_gpiod_get(dev, label, GPIOD_OUT_LOW);
    45		}
    46		if (IS_ERR(ret) || !ret) {
  > 47			if (!ret || PTR_ERR(ret) == -ENOENT)
    48				dev_warn(dev, "gpio %s is not defined\n", label);
    49			else
    50				dev_warn(dev, "error while requesting gpio %s\n", label);
    51			ret = NULL;
    52		} else {
    53			dev_dbg(dev, "using gpio %d for %s\n", desc_to_gpio(ret), label);
    54		}
    55		return ret;
    56	}
    57	

---
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: 28311 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drivers/staging/wfx/main.c:47:14-21: ERROR: PTR_ERR applied after initialization to constant on line 42
  2020-06-08 13:31 drivers/staging/wfx/main.c:47:14-21: ERROR: PTR_ERR applied after initialization to constant on line 42 kernel test robot
@ 2020-06-08 13:51 ` Jérôme Pouiller
  0 siblings, 0 replies; 4+ messages in thread
From: Jérôme Pouiller @ 2020-06-08 13:51 UTC (permalink / raw)
  To: kernel test robot; +Cc: kbuild-all, linux-kernel, Greg Kroah-Hartman

On Monday 8 June 2020 15:31:36 CEST kernel test robot wrote:
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   af7b4801030c07637840191c69eb666917e4135d
> commit: 0096214a59a72b3c3c943e27bd03307324d3ce0f staging: wfx: add support for I/O access
> date:   8 months ago
> config: i386-randconfig-c024-20200607 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> 
> coccinelle warnings: (new ones prefixed by >>)
> 
> >> drivers/staging/wfx/main.c:47:14-21: ERROR: PTR_ERR applied after initialization to constant on line 42
> 
> vim +47 drivers/staging/wfx/main.c
> 
>     30
>     31  struct gpio_desc *wfx_get_gpio(struct device *dev, int override, const char *label)
>     32  {
>     33          struct gpio_desc *ret;
>     34          char label_buf[256];
>     35
>     36          if (override >= 0) {
>     37                  snprintf(label_buf, sizeof(label_buf), "wfx_%s", label);
>     38                  ret = ERR_PTR(devm_gpio_request_one(dev, override, GPIOF_OUT_INIT_LOW, label_buf));
>     39                  if (!ret)
>     40                          ret = gpio_to_desc(override);
>     41          } else if (override == -1) {
>   > 42                  ret = NULL;
>     43          } else {
>     44                  ret = devm_gpiod_get(dev, label, GPIOD_OUT_LOW);
>     45          }
>     46          if (IS_ERR(ret) || !ret) {
>   > 47                  if (!ret || PTR_ERR(ret) == -ENOENT)
>     48                          dev_warn(dev, "gpio %s is not defined\n", label);
>     49                  else
>     50                          dev_warn(dev, "error while requesting gpio %s\n", label);
>     51                  ret = NULL;
>     52          } else {
>     53                  dev_dbg(dev, "using gpio %d for %s\n", desc_to_gpio(ret), label);
>     54          }
>     55          return ret;
>     56  }
>     57
Hello,

This warning seems to be a false positive (the variable "ret" is affected in
all branches of the if/else).


-- 
Jérôme Pouiller



^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/staging/wfx/main.c:47:14-21: ERROR: PTR_ERR applied after initialization to constant on line 42
@ 2020-07-05 20:30 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2020-07-05 20:30 UTC (permalink / raw)
  To: Jérôme Pouiller; +Cc: kbuild-all, linux-kernel, Greg Kroah-Hartman

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   19a61a753d0705fcb41e7aa130351e0a0a54c3bd
commit: 0096214a59a72b3c3c943e27bd03307324d3ce0f staging: wfx: add support for I/O access
date:   9 months ago
config: c6x-randconfig-c024-20200705 (attached as .config)
compiler: c6x-elf-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


coccinelle warnings: (new ones prefixed by >>)

>> drivers/staging/wfx/main.c:47:14-21: ERROR: PTR_ERR applied after initialization to constant on line 42

vim +47 drivers/staging/wfx/main.c

    30	
    31	struct gpio_desc *wfx_get_gpio(struct device *dev, int override, const char *label)
    32	{
    33		struct gpio_desc *ret;
    34		char label_buf[256];
    35	
    36		if (override >= 0) {
    37			snprintf(label_buf, sizeof(label_buf), "wfx_%s", label);
    38			ret = ERR_PTR(devm_gpio_request_one(dev, override, GPIOF_OUT_INIT_LOW, label_buf));
    39			if (!ret)
    40				ret = gpio_to_desc(override);
    41		} else if (override == -1) {
  > 42			ret = NULL;
    43		} else {
    44			ret = devm_gpiod_get(dev, label, GPIOD_OUT_LOW);
    45		}
    46		if (IS_ERR(ret) || !ret) {
  > 47			if (!ret || PTR_ERR(ret) == -ENOENT)
    48				dev_warn(dev, "gpio %s is not defined\n", label);
    49			else
    50				dev_warn(dev, "error while requesting gpio %s\n", label);
    51			ret = NULL;
    52		} else {
    53			dev_dbg(dev, "using gpio %d for %s\n", desc_to_gpio(ret), label);
    54		}
    55		return ret;
    56	}
    57	

---
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: 23472 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/staging/wfx/main.c:47:14-21: ERROR: PTR_ERR applied after initialization to constant on line 42
@ 2020-01-05 22:35 kbuild test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2020-01-05 22:35 UTC (permalink / raw)
  To: Jérôme Pouiller; +Cc: kbuild-all, linux-kernel, Greg Kroah-Hartman

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   768fc661d12559b0dbd99d941b3bf28fe92fd365
commit: 0096214a59a72b3c3c943e27bd03307324d3ce0f staging: wfx: add support for I/O access
date:   3 months ago

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


coccinelle warnings: (new ones prefixed by >>)

>> drivers/staging/wfx/main.c:47:14-21: ERROR: PTR_ERR applied after initialization to constant on line 42

vim +47 drivers/staging/wfx/main.c

    30	
    31	struct gpio_desc *wfx_get_gpio(struct device *dev, int override, const char *label)
    32	{
    33		struct gpio_desc *ret;
    34		char label_buf[256];
    35	
    36		if (override >= 0) {
    37			snprintf(label_buf, sizeof(label_buf), "wfx_%s", label);
    38			ret = ERR_PTR(devm_gpio_request_one(dev, override, GPIOF_OUT_INIT_LOW, label_buf));
    39			if (!ret)
    40				ret = gpio_to_desc(override);
    41		} else if (override == -1) {
  > 42			ret = NULL;
    43		} else {
    44			ret = devm_gpiod_get(dev, label, GPIOD_OUT_LOW);
    45		}
    46		if (IS_ERR(ret) || !ret) {
  > 47			if (!ret || PTR_ERR(ret) == -ENOENT)
    48				dev_warn(dev, "gpio %s is not defined\n", label);
    49			else
    50				dev_warn(dev, "error while requesting gpio %s\n", label);
    51			ret = NULL;
    52		} else {
    53			dev_dbg(dev, "using gpio %d for %s\n", desc_to_gpio(ret), label);
    54		}
    55		return ret;
    56	}
    57	

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-05 20:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-08 13:31 drivers/staging/wfx/main.c:47:14-21: ERROR: PTR_ERR applied after initialization to constant on line 42 kernel test robot
2020-06-08 13:51 ` Jérôme Pouiller
  -- strict thread matches above, loose matches on Subject: below --
2020-07-05 20:30 kernel test robot
2020-01-05 22:35 kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).