Skip to contentSkip to conversation

mm: make "migratetype_names" const char *

PATCH New Alexey Dobriyan 1 participant 1 message Nov 24, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: make "migratetype_names" const char *

Those strings are immutable in fact.

---

 include/linux/mmzone.h |    2 +-
 mm/page_alloc.c        |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/mmzone.h +1 -1
@@ -65,7 +65,7 @@ enum migratetype {
 };
 
 /* In mm/page_alloc.c; keep in sync also with show_migration_types() there */
-extern char * const migratetype_names[MIGRATE_TYPES];
+extern const char * const migratetype_names[MIGRATE_TYPES];
 
 #ifdef CONFIG_CMA
 #  define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA)
mm/page_alloc.c +1 -1
@@ -237,7 +237,7 @@ static char * const zone_names[MAX_NR_ZONES] = {
 #endif
 };
 
-char * const migratetype_names[MIGRATE_TYPES] = {
+const char * const migratetype_names[MIGRATE_TYPES] = {
 	"Unmovable",
 	"Movable",
 	"Reclaimable",