2020-11-07 06:57:49

by Kaixu Xia

[permalink] [raw]
Subject: [PATCH] net/mlx4: Assign boolean values to a bool variable

From: Kaixu Xia <[email protected]>

Fix the following coccinelle warnings:

./drivers/net/ethernet/mellanox/mlx4/en_rx.c:687:1-17: WARNING: Assignment of 0/1 to bool variable

Reported-by: Tosk Robot <[email protected]>
Signed-off-by: Kaixu Xia <[email protected]>
---
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 502d1b97855c..b0f79a5151cf 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -684,7 +684,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
xdp_prog = rcu_dereference(ring->xdp_prog);
xdp.rxq = &ring->xdp_rxq;
xdp.frame_sz = priv->frag_info[0].frag_stride;
- doorbell_pending = 0;
+ doorbell_pending = false;

/* We assume a 1:1 mapping between CQEs and Rx descriptors, so Rx
* descriptor offset can be deduced from the CQE index instead of
--
2.20.0


2020-11-08 08:22:23

by Tariq Toukan

[permalink] [raw]
Subject: Re: [PATCH] net/mlx4: Assign boolean values to a bool variable



On 11/7/2020 8:53 AM, [email protected] wrote:
> From: Kaixu Xia <[email protected]>
>
> Fix the following coccinelle warnings:
>

Hi Kaixu,

Which coccinelle version gave this warning?


> ./drivers/net/ethernet/mellanox/mlx4/en_rx.c:687:1-17: WARNING: Assignment of 0/1 to bool variable
>
> Reported-by: Tosk Robot <[email protected]>
> Signed-off-by: Kaixu Xia <[email protected]>
> ---
> drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> index 502d1b97855c..b0f79a5151cf 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> @@ -684,7 +684,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
> xdp_prog = rcu_dereference(ring->xdp_prog);
> xdp.rxq = &ring->xdp_rxq;
> xdp.frame_sz = priv->frag_info[0].frag_stride;
> - doorbell_pending = 0;
> + doorbell_pending = false;
>
> /* We assume a 1:1 mapping between CQEs and Rx descriptors, so Rx
> * descriptor offset can be deduced from the CQE index instead of
>

2020-11-09 07:11:50

by Kaixu Xia

[permalink] [raw]
Subject: Re: [PATCH] net/mlx4: Assign boolean values to a bool variable



On 2020/11/8 16:20, Tariq Toukan wrote:
>
>
> On 11/7/2020 8:53 AM, [email protected] wrote:
>> From: Kaixu Xia <[email protected]>
>>
>> Fix the following coccinelle warnings:
>>
>
> Hi Kaixu,
>
> Which coccinelle version gave this warning?

Hi Tariq,

The version is coccinelle-1.0.7.

Thanks,
Kaixu
>
>
>> ./drivers/net/ethernet/mellanox/mlx4/en_rx.c:687:1-17: WARNING: Assignment of 0/1 to bool variable
>>
>> Reported-by: Tosk Robot <[email protected]>
>> Signed-off-by: Kaixu Xia <[email protected]>
>> ---
>>   drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
>> index 502d1b97855c..b0f79a5151cf 100644
>> --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
>> +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
>> @@ -684,7 +684,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
>>       xdp_prog = rcu_dereference(ring->xdp_prog);
>>       xdp.rxq = &ring->xdp_rxq;
>>       xdp.frame_sz = priv->frag_info[0].frag_stride;
>> -    doorbell_pending = 0;
>> +    doorbell_pending = false;
>>         /* We assume a 1:1 mapping between CQEs and Rx descriptors, so Rx
>>        * descriptor offset can be deduced from the CQE index instead of
>>
>

--
kaixuxia

2020-11-09 09:37:24

by Tariq Toukan

[permalink] [raw]
Subject: Re: [PATCH] net/mlx4: Assign boolean values to a bool variable



On 11/9/2020 9:07 AM, kaixuxia wrote:
>
>
> On 2020/11/8 16:20, Tariq Toukan wrote:
>>
>>
>> On 11/7/2020 8:53 AM, [email protected] wrote:
>>> From: Kaixu Xia <[email protected]>
>>>
>>> Fix the following coccinelle warnings:
>>>
>>
>> Hi Kaixu,
>>
>> Which coccinelle version gave this warning?
>
> Hi Tariq,
>
> The version is coccinelle-1.0.7.
>
> Thanks,
> Kaixu
>>
>>
>>> ./drivers/net/ethernet/mellanox/mlx4/en_rx.c:687:1-17: WARNING: Assignment of 0/1 to bool variable
>>>
>>> Reported-by: Tosk Robot <[email protected]>
>>> Signed-off-by: Kaixu Xia <[email protected]>


Reviewed-by: Tariq Toukan <[email protected]>

Thanks,
Tariq

2020-11-10 01:40:36

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH] net/mlx4: Assign boolean values to a bool variable

On Mon, 9 Nov 2020 11:33:17 +0200 Tariq Toukan wrote:
> >>> ./drivers/net/ethernet/mellanox/mlx4/en_rx.c:687:1-17: WARNING: Assignment of 0/1 to bool variable
> >>>
> >>> Reported-by: Tosk Robot <[email protected]>
> >>> Signed-off-by: Kaixu Xia <[email protected]>
>
> Reviewed-by: Tariq Toukan <[email protected]>

Applied, thanks.