Message ID | 20201209092835.20630-1-zhengyongjun3@huawei.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [wireless] iwlwifi: fw: simplify the iwl_fw_dbg_collect_trig() | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Not a local patch |
Zheng Yongjun <zhengyongjun3@huawei.com> writes: > Simplify the return expression. > > Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> > --- > drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c > index ab4a8b942c81..9393fcb62076 100644 > --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c > +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c > @@ -2558,7 +2558,7 @@ int iwl_fw_dbg_collect_trig(struct iwl_fw_runtime *fwrt, > struct iwl_fw_dbg_trigger_tlv *trigger, > const char *fmt, ...) > { > - int ret, len = 0; > + int len = 0; > char buf[64]; > > if (iwl_trans_dbg_ini_valid(fwrt->trans)) > @@ -2580,13 +2580,8 @@ int iwl_fw_dbg_collect_trig(struct iwl_fw_runtime *fwrt, > len = strlen(buf) + 1; > } > > - ret = iwl_fw_dbg_collect(fwrt, le32_to_cpu(trigger->id), buf, len, > + return iwl_fw_dbg_collect(fwrt, le32_to_cpu(trigger->id), buf, len, > trigger); > - > - if (ret) > - return ret; > - > - return 0; > } > IWL_EXPORT_SYMBOL(iwl_fw_dbg_collect_trig); Up to Luca of course, but I prefer the original style.
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c index ab4a8b942c81..9393fcb62076 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c @@ -2558,7 +2558,7 @@ int iwl_fw_dbg_collect_trig(struct iwl_fw_runtime *fwrt, struct iwl_fw_dbg_trigger_tlv *trigger, const char *fmt, ...) { - int ret, len = 0; + int len = 0; char buf[64]; if (iwl_trans_dbg_ini_valid(fwrt->trans)) @@ -2580,13 +2580,8 @@ int iwl_fw_dbg_collect_trig(struct iwl_fw_runtime *fwrt, len = strlen(buf) + 1; } - ret = iwl_fw_dbg_collect(fwrt, le32_to_cpu(trigger->id), buf, len, + return iwl_fw_dbg_collect(fwrt, le32_to_cpu(trigger->id), buf, len, trigger); - - if (ret) - return ret; - - return 0; } IWL_EXPORT_SYMBOL(iwl_fw_dbg_collect_trig);
Simplify the return expression. Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> --- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)