mm/mmzone.c: make "migratetype_names" const char *
authorAlexey Dobriyan <adobriyan@gmail.com>
Fri, 28 Dec 2018 08:35:55 +0000 (00:35 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 28 Dec 2018 20:11:48 +0000 (12:11 -0800)
Those strings are immutable in fact.

Link: http://lkml.kernel.org/r/20181124090327.GA10877@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/mmzone.h
mm/page_alloc.c

index 5b4bfb90fb942045d92e12fbfd3c63790dbb54e5..e0c3bc2edbbd0de9b072a3e51c61f5d96a2a099f 100644 (file)
@@ -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)
index 80373eca453dde248cbac5b7285b38197b6eb4fb..4115d7f20223fe1cd6c3971e1e104d7ac4f723ea 100644 (file)
@@ -236,7 +236,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",