2009-10-12 20:53:47

by Tommi Rantala

[permalink] [raw]
Subject: [PATCH] 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(-)

diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c
index 3ec4f2a..16fb478 100644
--- a/Documentation/vm/page-types.c
+++ b/Documentation/vm/page-types.c
@@ -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' },
--
1.5.6.5


2009-10-12 20:53:34

by Tommi Rantala

[permalink] [raw]
Subject: [PATCH] page-types: trivial typo fixes

Trivial typo fixes.

Signed-off-by: Tommi Rantala <[email protected]>
---
Documentation/vm/page-types.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c
index 16fb478..d6d21c2 100644
--- a/Documentation/vm/page-types.c
+++ b/Documentation/vm/page-types.c
@@ -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"
--
1.5.6.5

2009-10-13 01:23:34

by Fengguang Wu

[permalink] [raw]
Subject: Re: [PATCH] page-types: trivial typo fixes

On Tue, Oct 13, 2009 at 04:51:34AM +0800, Tommi Rantala wrote:
> Trivial typo fixes.

Good catch, thanks!

Fengguang

> Signed-off-by: Tommi Rantala <[email protected]>
> ---
> Documentation/vm/page-types.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c
> index 16fb478..d6d21c2 100644
> --- a/Documentation/vm/page-types.c
> +++ b/Documentation/vm/page-types.c
> @@ -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"
> --
> 1.5.6.5