From: Kent Gibson <warthog618@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Yihao Han <hanyihao@vivo.com>,
Linus Walleij <linus.walleij@linaro.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
kernel@vivo.com
Subject: Re: [PATCH] gpiolib: cdev: fix stream_open.cocci warnings
Date: Thu, 5 May 2022 20:24:50 +0800 [thread overview]
Message-ID: <20220505122450.GA23659@sol> (raw)
In-Reply-To: <CAMRc=MdkbZVW_vFxyJbKh9oDo3mdud2omfS=cW5=Gn=nMrM37A@mail.gmail.com>
On Thu, May 05, 2022 at 02:18:48PM +0200, Bartosz Golaszewski wrote:
> On Thu, May 5, 2022 at 1:50 PM Yihao Han <hanyihao@vivo.com> wrote:
> >
> > ./drivers/gpio/gpiolib-cdev.c:2498:7-23: WARNING:
> > gpio_fileops: .read() has stream semantic;
> > safe to change nonseekable_open -> stream_open.
> >
> > Generated by: scripts/coccinelle/api/stream_open.cocci
> >
> > Signed-off-by: Yihao Han <hanyihao@vivo.com>
> > ---
> > drivers/gpio/gpiolib-cdev.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c
> > index f5aa5f93342a..d03c8e012c8c 100644
> > --- a/drivers/gpio/gpiolib-cdev.c
> > +++ b/drivers/gpio/gpiolib-cdev.c
> > @@ -2495,7 +2495,7 @@ static int gpio_chrdev_open(struct inode *inode, struct file *file)
> > get_device(&gdev->dev);
> > file->private_data = cdev;
> >
> > - ret = nonseekable_open(inode, file);
> > + ret = stream_open(inode, file);
> > if (ret)
> > goto out_unregister_notifier;
> >
> > --
> > 2.17.1
> >
>
> Cc'ing Kent.
>
> This patch doesn't seem to target current master or rc1.
>
> It also can't be right - we specifically mark all filesystem objects
> exposed by the GPIO character device as non-seekable.
>
Agreed. I took the coccinelle warning as being a false positive.
If I recall correctly I had a quick look to see if it could be disabled,
but didn't find anything, and so just ignored it.
Cheers,
Kent.
next prev parent reply other threads:[~2022-05-05 12:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-05 11:50 [PATCH] gpiolib: cdev: fix stream_open.cocci warnings Yihao Han
2022-05-05 12:18 ` Bartosz Golaszewski
2022-05-05 12:24 ` Kent Gibson [this message]
2022-05-06 3:38 ` Kent Gibson
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=20220505122450.GA23659@sol \
--to=warthog618@gmail.com \
--cc=brgl@bgdev.pl \
--cc=hanyihao@vivo.com \
--cc=kernel@vivo.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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 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).