[PATCH 0/9] mtd: add 'const' qualifiers
Artem Bityutskiy
dedekind1 at gmail.com
Tue Mar 12 07:08:19 EDT 2013
This patch-set amends declarations of arrays of partition parser names, as well
as declarations of few MTD functions which deal with such arrays.
The arrays are typically defined as 'const char **probes' or 'const char
*probes[]'. The arrays basically "list" names of MTD partition parsers. To put
it differently, they are arrays of pointers which point to strings.
The 'const' there means that the strings constant. IOW, probes points to a
pointer which points to a constant character).
What we do in this series is we turn the declarations into
'const char * const * probes' or 'const char * const probes[]'. This means that
not only the strings are constant, but the pointers pointing to them are also
constant. IOW, probes points to a constant pointer which points to a constant
character.
The motivation for this work is to make the code a bit stricter, less error
prone, and potentially enable the compiler to do more optimizations.
Thanks,
Artem.
More information about the linux-mtd
mailing list