mtd: add 'const' qualifiers
Status from this message: Pushed to l2-mtd.git.
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | mtd: add 'const' qualifier to a couple of register functionsdrivers/ drivers/ drivers/ +1 more | +8 | 0 replies | |
| 2/9 | mtd: plat-ram: add const quilifiersdrivers/ include/ | +3 | 0 replies | |
| 3/9 | mtd: physmap: add const qualifiersdrivers/ include/ | +8 | 0 replies | |
| 4/9 | bcma_mips: add a const qualifierdrivers/ | +1 | 0 replies | |
| 5/9 | ssb: driver_mipscore: add a const qualifierdrivers/ | +1 | 0 replies | |
| 6/9 | mtd: physmap_of: add const qualifiersdrivers/ | +9 | 0 replies | |
| 7/9 | mtd: maps: add const qualifiersdrivers/ drivers/ drivers/ +10 more | +21 | 0 replies | |
| 8/9 | mtd: devices: add const qualifiersdrivers/ drivers/ | +2 | 0 replies | |
| 9/9 | mtd: mtdcore: use const qualifierdrivers/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/9] mtd: add 'const' qualifiers
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.