From: Greg KH <gregkh@linuxfoundation.org>
To: Nam Cao <namcaov@gmail.com>
Cc: forest@alittletooquiet.net, linux-kernel@vger.kernel.org,
linux-staging@lists.linux.dev
Subject: Re: [PATCH v3 1/2] staging: vt6655: remove unnecessary volatile qualifier
Date: Sun, 11 Sep 2022 09:25:23 +0200 [thread overview]
Message-ID: <Yx2NY0RBWLqH3rDK@kroah.com> (raw)
In-Reply-To: <CA+sZ8B8Y1ZGou1Y4tQYJC1Wp_2MVdYKO0Bd3SfxMAU1DF+mz_g@mail.gmail.com>
On Sun, Sep 11, 2022 at 09:12:44AM +0200, Nam Cao wrote:
> On Fri, Sep 9, 2022 at 8:03 PM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Fri, Sep 09, 2022 at 02:17:55PM +0200, Nam Cao wrote:
> > > Remove volatile qualifier for the member rd0 of struct vnt_rx_desc,
> > > because there is no reason it must be volatile.
> > >
> > > Signed-off-by: Nam Cao <namcaov@gmail.com>
> > > ---
> > > drivers/staging/vt6655/desc.h | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h
> > > index 17a40c53b8ff..3f0f287b1693 100644
> > > --- a/drivers/staging/vt6655/desc.h
> > > +++ b/drivers/staging/vt6655/desc.h
> > > @@ -182,7 +182,7 @@ struct vnt_rdes1 {
> > >
> > > /* Rx descriptor*/
> > > struct vnt_rx_desc {
> > > - volatile struct vnt_rdes0 rd0;
> > > + struct vnt_rdes0 rd0;
> >
> > You can not just remove this without describing _WHY_ it is ok to do so.
> >
> > Have you properly determined why it is, or is not, ok to use volatile
> > here?
>
> I did not carefully look at the volatile usage here. After looking at it
> again, using volatile is actually valid: the structure resides on coherent
> memory.
Are you sure? That's a very odd thing for a driver to need. Looks like
they are allocating some dma memory and then pointing structures on top
of that memory. Why would you need to have "volatile" markings on a
structure definition for that?
Dig into this some more please, I don't think this is correct.
thanks,
greg k-h
next prev parent reply other threads:[~2022-09-11 7:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-09 12:17 [PATCH v3 0/2] use memset to make code clearer Nam Cao
2022-09-09 12:17 ` [PATCH v3 1/2] staging: vt6655: remove unnecessary volatile qualifier Nam Cao
2022-09-09 18:03 ` Greg KH
2022-09-11 7:12 ` Nam Cao
2022-09-11 7:25 ` Greg KH [this message]
2022-09-13 16:52 ` Nam Cao
2022-09-14 8:02 ` Greg KH
2022-09-09 12:17 ` [PATCH v3 2/2] staging: vt6655: use memset to make code clearer Nam Cao
2022-09-09 17:58 ` [PATCH v3 0/2] " Philipp Hortmann
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=Yx2NY0RBWLqH3rDK@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=forest@alittletooquiet.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=namcaov@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox