[-next] dpaa_eth: use false and true for bool variables
diff mbox series

Message ID 1604405100-33255-1-git-send-email-zou_wei@huawei.com
State Accepted
Commit ebcaa207b48545f587b879ba1652a593ed9da187
Headers show
Series
  • [-next] dpaa_eth: use false and true for bool variables
Related show

Commit Message

Zou Wei Nov. 3, 2020, 12:05 p.m. UTC
Fix coccicheck warnings:

./dpaa_eth.c:2549:2-22: WARNING: Assignment of 0/1 to bool variable
./dpaa_eth.c:2562:2-22: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
---
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Madalin Bucur Nov. 3, 2020, 12:13 p.m. UTC | #1
> -----Original Message-----
> From: Zou Wei <zou_wei@huawei.com>
> Sent: 03 November 2020 14:05
> To: Madalin Bucur <madalin.bucur@nxp.com>; davem@davemloft.net;
> kuba@kernel.org
> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Zou Wei
> <zou_wei@huawei.com>
> Subject: [PATCH -next] dpaa_eth: use false and true for bool variables
> 
> Fix coccicheck warnings:
> 
> ./dpaa_eth.c:2549:2-22: WARNING: Assignment of 0/1 to bool variable
> ./dpaa_eth.c:2562:2-22: WARNING: Assignment of 0/1 to bool variable
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zou Wei <zou_wei@huawei.com>
> ---
>  drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> index d9c2859..31407c1 100644
> --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> @@ -2546,7 +2546,7 @@ static void dpaa_eth_napi_enable(struct dpaa_priv
> *priv)
>  	for_each_online_cpu(i) {
>  		percpu_priv = per_cpu_ptr(priv->percpu_priv, i);
> 
> -		percpu_priv->np.down = 0;
> +		percpu_priv->np.down = false;
>  		napi_enable(&percpu_priv->np.napi);
>  	}
>  }
> @@ -2559,7 +2559,7 @@ static void dpaa_eth_napi_disable(struct dpaa_priv
> *priv)
>  	for_each_online_cpu(i) {
>  		percpu_priv = per_cpu_ptr(priv->percpu_priv, i);
> 
> -		percpu_priv->np.down = 1;
> +		percpu_priv->np.down = true;
>  		napi_disable(&percpu_priv->np.napi);
>  	}
>  }
> --
> 2.6.2

Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Jakub Kicinski Nov. 5, 2020, 1:25 a.m. UTC | #2
On Tue, 3 Nov 2020 12:13:29 +0000 Madalin Bucur wrote:
> > Fix coccicheck warnings:
> > 
> > ./dpaa_eth.c:2549:2-22: WARNING: Assignment of 0/1 to bool variable
> > ./dpaa_eth.c:2562:2-22: WARNING: Assignment of 0/1 to bool variable
> > 
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: Zou Wei <zou_wei@huawei.com>
> 
> Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com>

Applied, thanks!

Patch
diff mbox series

diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index d9c2859..31407c1 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -2546,7 +2546,7 @@  static void dpaa_eth_napi_enable(struct dpaa_priv *priv)
 	for_each_online_cpu(i) {
 		percpu_priv = per_cpu_ptr(priv->percpu_priv, i);
 
-		percpu_priv->np.down = 0;
+		percpu_priv->np.down = false;
 		napi_enable(&percpu_priv->np.napi);
 	}
 }
@@ -2559,7 +2559,7 @@  static void dpaa_eth_napi_disable(struct dpaa_priv *priv)
 	for_each_online_cpu(i) {
 		percpu_priv = per_cpu_ptr(priv->percpu_priv, i);
 
-		percpu_priv->np.down = 1;
+		percpu_priv->np.down = true;
 		napi_disable(&percpu_priv->np.napi);
 	}
 }