mempolicy: lose unnecessary loop variable in mpol_parse_str()
We don't really need the extra variable 'i' in mpol_parse_str(). The only use is as the the loop variable. Then, it's assigned to 'mode'. Just use mode, and loose the 'uninitialized_var()' macro. Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com> Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk> Cc: Ravikiran Thirumalai <kiran@scalex86.org> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Christoph Lameter <cl@linux-foundation.org> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
e17f74af35
commit
b4652e8429
@@ -2148,12 +2148,11 @@ static const char * const policy_types[] =
|
|||||||
int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context)
|
int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context)
|
||||||
{
|
{
|
||||||
struct mempolicy *new = NULL;
|
struct mempolicy *new = NULL;
|
||||||
unsigned short uninitialized_var(mode);
|
unsigned short mode;
|
||||||
unsigned short uninitialized_var(mode_flags);
|
unsigned short uninitialized_var(mode_flags);
|
||||||
nodemask_t nodes;
|
nodemask_t nodes;
|
||||||
char *nodelist = strchr(str, ':');
|
char *nodelist = strchr(str, ':');
|
||||||
char *flags = strchr(str, '=');
|
char *flags = strchr(str, '=');
|
||||||
int i;
|
|
||||||
int err = 1;
|
int err = 1;
|
||||||
|
|
||||||
if (nodelist) {
|
if (nodelist) {
|
||||||
@@ -2169,13 +2168,12 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context)
|
|||||||
if (flags)
|
if (flags)
|
||||||
*flags++ = '\0'; /* terminate mode string */
|
*flags++ = '\0'; /* terminate mode string */
|
||||||
|
|
||||||
for (i = 0; i <= MPOL_LOCAL; i++) {
|
for (mode = 0; mode <= MPOL_LOCAL; mode++) {
|
||||||
if (!strcmp(str, policy_types[i])) {
|
if (!strcmp(str, policy_types[mode])) {
|
||||||
mode = i;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i > MPOL_LOCAL)
|
if (mode > MPOL_LOCAL)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
|
Reference in New Issue
Block a user