page-types: constify read only arrays
PATCH 1/1 page-types: trivial typo fixes
In reply to Tommi RantalaTrivial typo fixes.
Signed-off-by Tommi Rantala <[email protected]>
--- Documentation/vm/page-types.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Documentation/vm/page-types.c +2 -2
@@ -301,7 +301,7 @@ static char *page_flag_name(uint64_t flags) present = (flags >> i) &1 ;if (!page_flag_names[i]) {if (present) -fatal ("unkown flag bit %d\n" , i); +fatal ("unknown flag bit %d\n" , i);continue ; } buf[j++] = present ? page_flag_names[i][0 ] :'_' ;
@@ -682,7 +682,7 @@ static void usage(void)#endif " -l|--list Show page details in ranges\n" " -L|--list-each Show page details one by one\n" -" -N|--no-summary Don't show summay info\n" +" -N|--no-summary Don't show summary info\n" " -X|--hwpoison hwpoison pages\n" " -x|--unpoison unpoison pages\n" " -h|--help Show this usage message\n"
Signature · 1 line
1.5.6.5
PATCH 1/1 page-types: constify read only arrays
Constify read only arrays.
Signed-off-by Tommi Rantala <[email protected]>
--- Documentation/vm/page-types.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
Documentation/vm/page-types.c +3 -3
@@ -100,7 +100,7 @@#define BIT (name) (1ULL << KPF_##name)#define BITS_COMPOUND (BIT(COMPOUND_HEAD) | BIT(COMPOUND_TAIL)) -static char *page_flag_names[] = { +static const char *page_flag_names[] = { [KPF_LOCKED ] ="L:locked" , [KPF_ERROR ] ="E:error" , [KPF_REFERENCED ] ="R:referenced" ,
@@ -173,7 +173,7 @@ static int kpageflags_fd;static int opt_hwpoison;static int opt_unpoison; -static char *hwpoison_debug_fs ="/debug/hwpoison" ; +static const char hwpoison_debug_fs[] ="/debug/hwpoison" ;static int hwpoison_inject_fd;static int hwpoison_forget_fd;
@@ -885,7 +885,7 @@ static void parse_bits_mask(const char *optarg) } -static struct option opts[] = { +static const struct option opts[] = { {"raw" ,0 ,NULL ,'r' }, {"pid" ,1 ,NULL ,'p' }, {"file" ,1 ,NULL ,'f' },
Signature · 1 line
1.5.6.5
Re: [PATCH] page-types: trivial typo fixes
In reply to Tommi RantalaQuoted 1 line · Tommi Rantala
Trivial typo fixes.
Good catch, thanks!
Fengguang
Quoted 29 lines
Signed-off-by Tommi Rantala <[email protected]>--- Documentation/vm/page-types.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)Documentation/vm/page-types.c +2
-2@@ -301,7 +301,7 @@ static char *page_flag_name(uint64_t flags) present = (flags >> i) &1 ;if (!page_flag_names[i]) {if (present) -fatal ("unkown flag bit %d\n" , i); +fatal ("unknown flag bit %d\n" , i);continue ; } buf[j++] = present ? page_flag_names[i][0 ] :'_' ;@@ -682,7 +682,7 @@ static void usage(void)#endif " -l|--list Show page details in ranges\n" " -L|--list-each Show page details one by one\n" -" -N|--no-summary Don't show summay info\n" +" -N|--no-summary Don't show summary info\n" " -X|--hwpoison hwpoison pages\n" " -x|--unpoison unpoison pages\n" " -h|--help Show this usage message\n" Signature · 1 line
1.5.6.5