diff options
author | Yisheng Xie <xieyisheng1@huawei.com> | 2018-05-21 14:57:44 +0300 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2018-10-06 10:25:54 +0300 |
commit | 5bea4304eea790766dd45cdd328ee287df2ade75 (patch) | |
tree | bc72989c48e9b6a1b6673d32cd959481c5ab65af /drivers/net | |
parent | 136521cb9c2fc8aa7db836c9d5de9c91ba4a0979 (diff) | |
download | linux-5bea4304eea790766dd45cdd328ee287df2ade75.tar.xz |
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 <andy.shevchenko@gmail.com>
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c index de40752aa67e..3b6b3d8fb961 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c @@ -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) |