[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 09 Sep 2010 11:48:47 -0700
From: Joe Perches <joe@...ches.com>
To: Mike Frysinger <vapier.adi@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: Re: [rfc patch] treewide: Convert "static const char <*> foo[] ="
to "static const char <*> const foo[] ="
On Thu, 2010-09-09 at 14:29 -0400, Mike Frysinger wrote:
> On Thu, Sep 9, 2010 at 14:22, Joe Perches wrote:
> > To move data to const sections, specify
> > that the pointed to strings are also const.
> did you find cases where this couldnt be done ?
Nope.
> this is going to keep
> creeping back in with new drivers unless we have something like
> checkpatch.pl catching it ...
These are added pretty slowly, but both of
static char foo[] = "bar"
and
static const char *foo[] = {"bar"}
could be warned by checkpatch
> where is the actual patch ?
On my computer. 300KB is pretty big to post.
I'll sent it to you separately.
The script was:
search='\bstatic\s+const\s+char\s*\*\s*(\w+)\s*\[\s*\]\s*=\s*'
replace='static const char \* const \1\[\] = '
grep -rPl --include=*.[ch] "$search" * | \
while read file ; do \
echo $file ; \
perl -p -i -e "s/$search/$replace/g" $file ;\
done
with some hand cleanups for those functions that
needed to be changed to use "const char * const"
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists