mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 22:37:45 -04:00
iwlwifi: mvm: use match_string() helper
match_string() returns the index of an array for a matching string, which can be used intead of open coded variant. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Yisheng Xie <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
This commit is contained in:
1 parent
136521cb9c
commit
5bea4304ee
1 file changed
+4
-9
@@ -666,16 +666,11 @@ iwl_dbgfs_bt_force_ant_write(struct iwl_mvm *mvm, char *buf,
|
||||
};
|
||||
int ret, bt_force_ant_mode;
|
||||
|
||||
for (bt_force_ant_mode = 0;
|
||||
bt_force_ant_mode < ARRAY_SIZE(modes_str);
|
||||
bt_force_ant_mode++) {
|
||||
if (!strcmp(buf, modes_str[bt_force_ant_mode]))
|
||||
break;
|
||||
}
|
||||
|
||||
if (bt_force_ant_mode >= ARRAY_SIZE(modes_str))
|
||||
return -EINVAL;
|
||||
ret = match_string(modes_str, ARRAY_SIZE(modes_str), buf);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
bt_force_ant_mode = ret;
|
||||
ret = 0;
|
||||
mutex_lock(&mvm->mutex);
|
||||
if (mvm->bt_force_ant_mode == bt_force_ant_mode)
|
||||
|
||||
Reference in new issue
Block a user