diff mbox series

[wireless,-next] wireless/ath10k: simplify the return expression of ath10k_ahb_chip_reset()

Message ID 20201210140204.1774-1-zhengyongjun3@huawei.com
State New
Headers show
Series [wireless,-next] wireless/ath10k: simplify the return expression of ath10k_ahb_chip_reset() | expand

Commit Message

Zheng Yongjun Dec. 10, 2020, 2:02 p.m. UTC
Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/net/wireless/ath/ath10k/ahb.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Kalle Valo Dec. 10, 2020, 2:37 p.m. UTC | #1
Zheng Yongjun <zhengyongjun3@huawei.com> writes:

> Simplify the return expression.
>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
>  drivers/net/wireless/ath/ath10k/ahb.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/ahb.c b/drivers/net/wireless/ath/ath10k/ahb.c
> index 05a61975c83f..0ba31c0bbd24 100644
> --- a/drivers/net/wireless/ath/ath10k/ahb.c
> +++ b/drivers/net/wireless/ath/ath10k/ahb.c
> @@ -598,16 +598,10 @@ static int ath10k_ahb_prepare_device(struct ath10k *ar)
>  
>  static int ath10k_ahb_chip_reset(struct ath10k *ar)
>  {
> -	int ret;
> -
>  	ath10k_ahb_halt_chip(ar);
>  	ath10k_ahb_clock_disable(ar);
>  
> -	ret = ath10k_ahb_prepare_device(ar);
> -	if (ret)
> -		return ret;
> -
> -	return 0;
> +	return ath10k_ahb_prepare_device(ar);
>  }
>  
>  static int ath10k_ahb_wake_target_cpu(struct ath10k *ar)

I prefer the original style, easier to add new code to the function.
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath10k/ahb.c b/drivers/net/wireless/ath/ath10k/ahb.c
index 05a61975c83f..0ba31c0bbd24 100644
--- a/drivers/net/wireless/ath/ath10k/ahb.c
+++ b/drivers/net/wireless/ath/ath10k/ahb.c
@@ -598,16 +598,10 @@  static int ath10k_ahb_prepare_device(struct ath10k *ar)
 
 static int ath10k_ahb_chip_reset(struct ath10k *ar)
 {
-	int ret;
-
 	ath10k_ahb_halt_chip(ar);
 	ath10k_ahb_clock_disable(ar);
 
-	ret = ath10k_ahb_prepare_device(ar);
-	if (ret)
-		return ret;
-
-	return 0;
+	return ath10k_ahb_prepare_device(ar);
 }
 
 static int ath10k_ahb_wake_target_cpu(struct ath10k *ar)