diff mbox series

[net-next] net: freescale: dpaa: simplify the return dpaa_eth_refill_bpools()

Message ID 20201209092107.20306-1-zhengyongjun3@huawei.com (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: freescale: dpaa: simplify the return dpaa_eth_refill_bpools() | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 18 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Zheng Yongjun Dec. 9, 2020, 9:21 a.m. UTC
Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Madalin Bucur (OSS) Dec. 9, 2020, 9:24 a.m. UTC | #1
> -----Original Message-----
> From: Zheng Yongjun <zhengyongjun3@huawei.com>
> Sent: 09 December 2020 11:21
> To: davem@davemloft.net; netdev@vger.kernel.org
> Cc: kuba@kernel.org; linux-kernel@vger.kernel.org; Madalin Bucur
> <madalin.bucur@nxp.com>; Zheng Yongjun <zhengyongjun3@huawei.com>
> Subject: [PATCH net-next] net: freescale: dpaa: simplify the return
> dpaa_eth_refill_bpools()
> 
> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
>  drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> index cb7c028b1bf5..edc8222d96dc 100644
> --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> @@ -1599,17 +1599,13 @@ static int dpaa_eth_refill_bpools(struct dpaa_priv
> *priv)
>  {
>  	struct dpaa_bp *dpaa_bp;
>  	int *countptr;
> -	int res;
> 
>  	dpaa_bp = priv->dpaa_bp;
>  	if (!dpaa_bp)
>  		return -EINVAL;
>  	countptr = this_cpu_ptr(dpaa_bp->percpu_count);
> -	res  = dpaa_eth_refill_bpool(dpaa_bp, countptr);
> -	if (res)
> -		return res;
> 
> -	return 0;
> +	return dpaa_eth_refill_bpool(dpaa_bp, countptr);
>  }
> 
>  /* Cleanup function for outgoing frame descriptors that were built on Tx
> path,
> --
> 2.22.0

Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
David Miller Dec. 10, 2020, 1:12 a.m. UTC | #2
From: Zheng Yongjun <zhengyongjun3@huawei.com>
Date: Wed, 9 Dec 2020 17:21:07 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>

Applied.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index cb7c028b1bf5..edc8222d96dc 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -1599,17 +1599,13 @@  static int dpaa_eth_refill_bpools(struct dpaa_priv *priv)
 {
 	struct dpaa_bp *dpaa_bp;
 	int *countptr;
-	int res;
 
 	dpaa_bp = priv->dpaa_bp;
 	if (!dpaa_bp)
 		return -EINVAL;
 	countptr = this_cpu_ptr(dpaa_bp->percpu_count);
-	res  = dpaa_eth_refill_bpool(dpaa_bp, countptr);
-	if (res)
-		return res;
 
-	return 0;
+	return dpaa_eth_refill_bpool(dpaa_bp, countptr);
 }
 
 /* Cleanup function for outgoing frame descriptors that were built on Tx path,