All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Muraru Mihaela <mihaela.muraru21@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH v2] Staging: emxx_udc: Make a read-only structure
Date: Wed, 19 Oct 2016 09:35:29 +0200	[thread overview]
Message-ID: <20161019073529.GA3241@kroah.com> (raw)
In-Reply-To: <20161019061829.GA25420@domino-MS-16Y1>

On Wed, Oct 19, 2016 at 09:18:29AM +0300, Muraru Mihaela wrote:
> On Wed, Oct 19, 2016 at 08:01:40AM +0200, Julia Lawall wrote:
> > 
> > 
> > On Wed, 19 Oct 2016, Muraru Mihaela wrote:
> > 
> > > On Tue, Oct 18, 2016 at 10:48:54PM +0200, Julia Lawall wrote:
> > > > On Tue, 18 Oct 2016, Mihaela Muraru wrote:
> > > >
> > > > > This patch add const qualifier at the declaration of the structure,
> > > > > because it contains information about usb hardware device and those
> > > > > values shoud not be overwritten.
> > > >
> > > > This focuses on the intent, which makes sense, but one really wants to be
> > > > sure that we won't end up with a const value floating into a modification
> > > > context, which would cause a runtime error.  So it would be good to
> > > > describe how the structure is used.  For example, is it only passed to
> > > > another function where the corresponding parameter is declared as const?
> > >
> > > The structure is declared and used only in emxx_udc.c. I searched it in all
> > > staging driver.
> > >
> > > And is passed as a patameter only to the sizeof operetor,
> > > that doesn't change the variable of the structure.
> > >
> > > To be 100% sure I will search on all the files of the kernel,
> > > it would take some time, and I will tell you what is the result, if is
> > > ok for you.
> > 
> > If the structure is static, then there is normally no need to check other
> > files.  The question though is how is it used in the current file.  Sizeof
> > is indeed not an issue, but what are the other ways in which it is used.
> 
> As I mentioned  it is not used in the current file. Now, I am
> wondering why is declared.

Yes, that is odd, does the compiler give you a warning about it when you
build the code that it's not being used?

thanks,

greg k-h


  reply	other threads:[~2016-10-19  7:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18 20:42 [PATCH v2] Staging: emxx_udc: Make a read-only structure Mihaela Muraru
2016-10-18 20:48 ` [Outreachy kernel] " Julia Lawall
2016-10-18 21:39   ` Muraru Mihaela
2016-10-19  6:01     ` Julia Lawall
2016-10-19  6:18       ` Muraru Mihaela
2016-10-19  7:35         ` Greg Kroah-Hartman [this message]
2016-10-19 15:20           ` Muraru Mihaela

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=20161019073529.GA3241@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=mihaela.muraru21@gmail.com \
    --cc=outreachy-kernel@googlegroups.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.