All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: Rehas Sachdeva <aquannie@gmail.com>,
	outreachy-kernel@googlegroups.com,
	Bryan O'Donoghue <pure.logic@nexus-software.ie>,
	Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>
Subject: Re: [Outreachy kernel] [Outreachy Kernel] [PATCH] staging: greybus: Constify local struct gb_loopback_stats
Date: Mon, 3 Oct 2016 12:14:46 +0200	[thread overview]
Message-ID: <20161003101446.GC6060@kroah.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1610022135511.3327@hadrien>

On Sun, Oct 02, 2016 at 09:36:39PM +0200, Julia Lawall wrote:
> 
> 
> On Mon, 3 Oct 2016, Rehas Sachdeva wrote:
> 
> > The local declaration "struct gb_loopback_stats reset" is not modified
> > throughout its scope and hence can be made const. Done using Coccinelle.
> >
> > Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
> > ---
> >  drivers/staging/greybus/loopback.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
> > index 7882306..fb5a068 100644
> > --- a/drivers/staging/greybus/loopback.c
> > +++ b/drivers/staging/greybus/loopback.c
> > @@ -837,7 +837,7 @@ static int gb_loopback_request_handler(struct gb_operation *operation)
> >
> >  static void gb_loopback_reset_stats(struct gb_loopback *gb)
> >  {
> > -	struct gb_loopback_stats reset = {
> > +	const struct gb_loopback_stats reset = {
> 
> Should it also be static?  I recall this comment being made in another
> case, but I don't know what the tradeoffs are.

I'll let Bryan answer that one, he should know...

Bryan?



  reply	other threads:[~2016-10-03 10:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-02 19:22 [Outreachy Kernel] [PATCH] staging: greybus: Constify local struct gb_loopback_stats Rehas Sachdeva
2016-10-02 19:36 ` [Outreachy kernel] " Julia Lawall
2016-10-03 10:14   ` Greg Kroah-Hartman [this message]
     [not found]   ` <1475489763.28319.85.camel@nexus-software.ie>
2016-10-03 10:44     ` Rehas Sachdeva
     [not found]       ` <1475497775.28319.95.camel@nexus-software.ie>
2016-10-03 14:37         ` Julia Lawall

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=20161003101446.GC6060@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=aquannie@gmail.com \
    --cc=elder@kernel.org \
    --cc=johan@kernel.org \
    --cc=julia.lawall@lip6.fr \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=pure.logic@nexus-software.ie \
    /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.