From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: Re: [staging:staging-testing 41/59] drivers/staging/wfx/main.c:47:14-21: ERROR: PTR_ERR applied after initialization to constant on line 42
Date: Wed, 09 Oct 2019 18:07:07 +0300 [thread overview]
Message-ID: <20191009150707.GA20470@kadam> (raw)
In-Reply-To: <3146028.s5zQrzEYB4@pc-42>
[-- Attachment #1: Type: text/plain, Size: 2327 bytes --]
On Wed, Oct 09, 2019 at 02:21:47PM +0000, Jerome Pouiller wrote:
> On Wednesday 9 October 2019 08:51:10 CEST Rong Chen wrote:
> > On 10/7/19 4:36 PM, Jerome Pouiller wrote:
> > > On Friday 4 October 2019 12:48:32 CEST kbuild test robot wrote:
> > > [...]
> > >>>> 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
> > > I think that this report is a false positive or I missed something?
> > >
> > Sorry for the inconvenience, but we confirmed that the error first
> > appeared since commit 0096214a59.
>
> Hi Rong,
>
> Err... I continue to not understand the meaning of this warning. If
> override != -1 then ret is not constant, isn't?
It's a false positive. Those happen. Just ignore it.
regards,
dan carpenter
next parent reply other threads:[~2019-10-09 15:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3146028.s5zQrzEYB4@pc-42>
2019-10-09 15:07 ` Dan Carpenter [this message]
[not found] <3767201.AobC1b7GVW@pc-42>
2019-10-07 8:57 ` [staging:staging-testing 41/59] drivers/staging/wfx/main.c:47:14-21: ERROR: PTR_ERR applied after initialization to constant on line 42 Greg Kroah-Hartman
2019-10-09 6:53 ` Rong Chen
2019-10-04 10:48 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=20191009150707.GA20470@kadam \
--to=dan.carpenter@oracle.com \
--cc=kbuild-all@lists.01.org \
/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.