Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1729406

Re: [Outreachy kernel] Re: [PATCH] staging: unisys: visorbus: Declared char * array as static const

From Julia Lawall <julia.lawall@lip6.fr>
Newsgroups linux.kernel
Subject Re: [Outreachy kernel] Re: [PATCH] staging: unisys: visorbus: Declared char * array as static const
Date 2017-09-09 10:40 +0200
Message-ID <unJsZ-2QM-1@gated-at.bofh.it> (permalink)
References <unI3T-25A-5@gated-at.bofh.it> <unIdA-28R-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On Sat, 9 Sep 2017, Greg KH wrote:

> On Sat, Sep 09, 2017 at 12:30:42PM +0530, Harsha Sharma wrote:
> > State explicitly that individual entries in array will not change.
> >
> > Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
> > ---
> >  drivers/staging/unisys/visorbus/visorchipset.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
> > index 6d4498f..6f2a010 100644
> > --- a/drivers/staging/unisys/visorbus/visorchipset.c
> > +++ b/drivers/staging/unisys/visorbus/visorchipset.c
> > @@ -1162,7 +1162,7 @@ static ssize_t deviceenabled_store(struct device *dev,
> >  	struct controlvm_message_packet *cmd = &req->msg.cmd;
> >  	char env_cmd[40], env_id[40], env_state[40], env_bus[40], env_dev[40],
> >  	    env_func[40];
> > -	char *envp[] = {
> > +	static const char * const envp[] = {
>
> Are you _sure_ about this?  Why make it static?  That seems a bit "odd",
> don't you think?  You need a lot more changelog text to get everyone to
> agree that this is ok to do...

Harsha,

Study carefully what static means when it is attached to a local variable.
And be sure that your code actually compiles.  If it doesn't try to figure
out why not.  There are other commits that are sort of like this on in the
kernel that you can find using git log.  But you may notice that they are
different in some way from yours.

julia


>
> Also, you forgot to cc: the actual maintainers of this code...
>
> thanks,
>
> greg k-h
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170909071451.GA27010%40kroah.com.
> For more options, visit https://groups.google.com/d/optout.
>

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] staging: unisys: visorbus: Declared char * array as static const Harsha Sharma <harshasharmaiitr@gmail.com> - 2017-09-09 09:10 +0200
  Re: [PATCH] staging: unisys: visorbus: Declared char * array as  static const Greg KH <gregkh@linuxfoundation.org> - 2017-09-09 09:20 +0200
    Re: [Outreachy kernel] Re: [PATCH] staging: unisys: visorbus: Declared  char * array as static const Julia Lawall <julia.lawall@lip6.fr> - 2017-09-09 10:40 +0200

csiph-web