From ebe3c6d0b013a3343ccc904c5bf8c9ce10a3dfff Mon Sep 17 00:00:00 2001 From: Lee Schermerhorn Date: Mon, 24 May 2010 14:32:03 -0700 Subject: [PATCH] --- yaml --- r: 198225 b: refs/heads/master c: b4652e8429100ba5c3ddb49499faa1188c98c246 h: refs/heads/master i: 198223: a6ae2c77ee79552c4e1cc5c151d3a821e1ae9ab3 v: v3 --- [refs] | 2 +- trunk/mm/mempolicy.c | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 4fff3877f1b3..c9f555bcc3b2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e17f74af351cce9a1bade7b33af179497fdf95cf +refs/heads/master: b4652e8429100ba5c3ddb49499faa1188c98c246 diff --git a/trunk/mm/mempolicy.c b/trunk/mm/mempolicy.c index 0e1b293e4054..b4f1265df2d8 100644 --- a/trunk/mm/mempolicy.c +++ b/trunk/mm/mempolicy.c @@ -2148,12 +2148,11 @@ static const char * const policy_types[] = int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context) { struct mempolicy *new = NULL; - unsigned short uninitialized_var(mode); + unsigned short mode; unsigned short uninitialized_var(mode_flags); nodemask_t nodes; char *nodelist = strchr(str, ':'); char *flags = strchr(str, '='); - int i; int err = 1; if (nodelist) { @@ -2169,13 +2168,12 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context) if (flags) *flags++ = '\0'; /* terminate mode string */ - for (i = 0; i <= MPOL_LOCAL; i++) { - if (!strcmp(str, policy_types[i])) { - mode = i; + for (mode = 0; mode <= MPOL_LOCAL; mode++) { + if (!strcmp(str, policy_types[mode])) { break; } } - if (i > MPOL_LOCAL) + if (mode > MPOL_LOCAL) goto out; switch (mode) {