Whamcloud - gitweb
LU-6142 misc: declare static chars as const where possible.
When a char * is statically initialized to a literal string, it is
best if the char is declared 'const' to ensure that literal string can
never be changed, and to allow it to be stored in read-only memory.
Unfortunately this is not possible for strings used as module
parameters. Similarly osd_0copy_tag in osd-zfs cannot be made const,
so that is change to a simple array (no pointer).
But in many other places it is possible, and it requires all ultimate
users of the string to declare that they are working with const chars.
This patch changes a collection of static char*s to const, and in many
cases arrays of char * to "const char * const", and then propagates
the 'const' annotion as needed.
Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I3185a6cd0d1b8a7dbd83698f456f65f47b4f2954
Reviewed-on: https://review.whamcloud.com/38421
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>