mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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 <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Ravikiran Thirumalai <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: David Rientjes <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
e17f74af35
commit
b4652e8429
1 changed files with 4 additions and 6 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue