Re: [PATCH] staging: greybus: Fix static array of pointers declaration as static const.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

> On Wed, Dec 21, 2016 at 04:38:26PM +0100, Emmanuil Chatzipetru wrote:
> > Fix coding style issue caught by checkpatch.pl related to the following
> > warning:
> > 	- "WARNING: char * array declaration might be better as static const"
> > 
> > Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@xxxxxxxxx>
> > ---
> >  drivers/staging/greybus/svc_watchdog.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/greybus/svc_watchdog.c b/drivers/staging/greybus/svc_watchdog.c
> > index d8af2d5d0025..60489e21daf3 100644
> > --- a/drivers/staging/greybus/svc_watchdog.c
> > +++ b/drivers/staging/greybus/svc_watchdog.c
> > @@ -45,12 +45,12 @@ static int svc_watchdog_pm_notifier(struct notifier_block *notifier,
> >  static void greybus_reset(struct work_struct *work)
> >  {
> >  	static char start_path[256] = "/system/bin/start";
> > -	static char *envp[] = {
> > +	static char * const envp[] = {
> >  		"HOME=/",
> >  		"PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin",
> >  		NULL,
> >  	};
> >
> > -	static char *argv[] = {
> > +	static char * const argv[] = {
> >  		start_path,
> >  		"unipro_reset",
> >  		NULL,
> 
> Did you not even compile test this series? This patch would trigger
> warnings about discarded const modifiers when the arrays are used.

Sorry, missed that.

> 
> The first two look ok, but please resend and make sure to include to
> include a module prefix is your Subject (since you're not doing anything
> greybus subsystem wide), that is:
> 
> 	staging: greybus: svc_watchdog: ...
> 
> Johan

I will modify the subject line of the first two patches accordingly, and will
resend.

Thanks
Emmanuil

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux