File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -2711,12 +2711,11 @@ static const char * const policy_modes[] =
2711
2711
int mpol_parse_str (char * str , struct mempolicy * * mpol )
2712
2712
{
2713
2713
struct mempolicy * new = NULL ;
2714
- unsigned short mode ;
2715
2714
unsigned short mode_flags ;
2716
2715
nodemask_t nodes ;
2717
2716
char * nodelist = strchr (str , ':' );
2718
2717
char * flags = strchr (str , '=' );
2719
- int err = 1 ;
2718
+ int err = 1 , mode ;
2720
2719
2721
2720
if (nodelist ) {
2722
2721
/* NUL-terminate mode or flags string */
@@ -2731,12 +2730,8 @@ int mpol_parse_str(char *str, struct mempolicy **mpol)
2731
2730
if (flags )
2732
2731
* flags ++ = '\0' ; /* terminate mode string */
2733
2732
2734
- for (mode = 0 ; mode < MPOL_MAX ; mode ++ ) {
2735
- if (!strcmp (str , policy_modes [mode ])) {
2736
- break ;
2737
- }
2738
- }
2739
- if (mode >= MPOL_MAX )
2733
+ mode = match_string (policy_modes , MPOL_MAX , str );
2734
+ if (mode < 0 )
2740
2735
goto out ;
2741
2736
2742
2737
switch (mode ) {
You can’t perform that action at this time.
0 commit comments