]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm-memory-failurec-define-page-types-for-action_result-in-one-place-v3
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Tue, 7 Apr 2015 23:44:22 +0000 (09:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 7 Apr 2015 23:44:22 +0000 (09:44 +1000)
ChangeLog v2 -> v3:
- rename action_page_type to action_page_types
- rename enum page_type to enum action_page_type

ChangeLog v1 -> v2:
- fix DIRTY_UNEVICTABLE_LRU typo
- adding "MSG_" prefix to each enum value
- use declaration with type "enum page_type" instead of int
- define action_type_type as "static const char * const" (not "static const=
 char *")

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory-failure.c

index 10c73a5d698129dc8463b621a71c80c8a922fdc0..5fd8931d8c31c09e0c2bc666f641d19fd38fda7c 100644 (file)
@@ -521,7 +521,7 @@ static const char *action_name[] = {
        [RECOVERED] = "Recovered",
 };
 
-enum page_type {
+enum action_page_type {
        MSG_KERNEL,
        MSG_KERNEL_HIGH_ORDER,
        MSG_SLAB,
@@ -544,7 +544,7 @@ enum page_type {
        MSG_UNKNOWN,
 };
 
-static const char *action_page_type[] = {
+static const char * const action_page_types[] = {
        [MSG_KERNEL]                    = "reserved kernel page",
        [MSG_KERNEL_HIGH_ORDER]         = "high-order kernel page",
        [MSG_SLAB]                      = "kernel slab page",
@@ -823,7 +823,7 @@ static int me_huge_page(struct page *p, unsigned long pfn)
 static struct page_state {
        unsigned long mask;
        unsigned long res;
-       int type;
+       enum action_page_type type;
        int (*action)(struct page *p, unsigned long pfn);
 } error_states[] = {
        { reserved,     reserved,       MSG_KERNEL,     me_kernel },
@@ -881,10 +881,10 @@ static struct page_state {
  * "Dirty/Clean" indication is not 100% accurate due to the possibility of
  * setting PG_dirty outside page lock. See also comment above set_page_dirty().
  */
-static void action_result(unsigned long pfn, int type, int result)
+static void action_result(unsigned long pfn, enum action_page_type type, int result)
 {
        pr_err("MCE %#lx: recovery action for %s: %s\n",
-               pfn, action_page_type[type], action_name[result]);
+               pfn, action_page_types[type], action_name[result]);
 }
 
 static int page_action(struct page_state *ps, struct page *p,
@@ -901,7 +901,7 @@ static int page_action(struct page_state *ps, struct page *p,
        if (count != 0) {
                printk(KERN_ERR
                       "MCE %#lx: %s still referenced by %d users\n",
-                      pfn, action_page_type[ps->type], count);
+                      pfn, action_page_types[ps->type], count);
                result = FAILED;
        }
        action_result(pfn, ps->type, result);