[v2,06/11] net/hns3: fix coverity codecheck

Message ID 20220601035251.16408-7-humin29@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Andrew Rybchenko
Headers
Series bugfix for hns3 PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

humin (Q) June 1, 2022, 3:52 a.m. UTC
  In bitwise operation, "val" should be an unsigned type. This patch
fixed it.

Fixes: 38b539d96eb6 ("net/hns3: support IEEE 1588 PTP")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/hns3/hns3_ptp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Andrew Rybchenko June 1, 2022, 8:32 a.m. UTC | #1
On 6/1/22 06:52, Min Hu (Connor) wrote:
> In bitwise operation, "val" should be an unsigned type. This patch
> fixed it.
> 
> Fixes: 38b539d96eb6 ("net/hns3: support IEEE 1588 PTP")
> Cc: stable@dpdk.org

Please, let me know coverity ID. No necessity to resend.
I'll add it on applying.

> 
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>   drivers/net/hns3/hns3_ptp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/hns3/hns3_ptp.c b/drivers/net/hns3/hns3_ptp.c
> index 1442241a4e..0b0061bba5 100644
> --- a/drivers/net/hns3/hns3_ptp.c
> +++ b/drivers/net/hns3/hns3_ptp.c
> @@ -81,7 +81,7 @@ hns3_timesync_configure(struct hns3_adapter *hns, bool en)
>   	struct hns3_hw *hw = &hns->hw;
>   	struct hns3_pf *pf = &hns->pf;
>   	struct hns3_cmd_desc desc;
> -	int val;
> +	uint32_t val;
>   	int ret;
>   
>   	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CFG_PTP_MODE, false);
  
Dongdong Liu June 6, 2022, 7:48 a.m. UTC | #2
Hi Andrew

Many thanks for your review.

I will take over Hu Min's current work and continue to do the upstream work.

On 2022/6/1 16:32, Andrew Rybchenko wrote:
> On 6/1/22 06:52, Min Hu (Connor) wrote:
>> In bitwise operation, "val" should be an unsigned type. This patch
>> fixed it.
>>
>> Fixes: 38b539d96eb6 ("net/hns3: support IEEE 1588 PTP")
>> Cc: stable@dpdk.org
>
> Please, let me know coverity ID. No necessity to resend.
> I'll add it on applying.

The code warning is checked by our internal code check tool,
does not have the coverity ID.

Thanks,
Dongdong
>
>>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>> ---
>>   drivers/net/hns3/hns3_ptp.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/hns3/hns3_ptp.c b/drivers/net/hns3/hns3_ptp.c
>> index 1442241a4e..0b0061bba5 100644
>> --- a/drivers/net/hns3/hns3_ptp.c
>> +++ b/drivers/net/hns3/hns3_ptp.c
>> @@ -81,7 +81,7 @@ hns3_timesync_configure(struct hns3_adapter *hns,
>> bool en)
>>       struct hns3_hw *hw = &hns->hw;
>>       struct hns3_pf *pf = &hns->pf;
>>       struct hns3_cmd_desc desc;
>> -    int val;
>> +    uint32_t val;
>>       int ret;
>>         hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CFG_PTP_MODE, false);
>
> .
>
  
Andrew Rybchenko June 8, 2022, 11:19 a.m. UTC | #3
Hi Dongdong,

On 6/6/22 10:48, Dongdong Liu wrote:
> Hi Andrew
> 
> Many thanks for your review.
> 
> I will take over Hu Min's current work and continue to do the upstream 
> work.
> 
> On 2022/6/1 16:32, Andrew Rybchenko wrote:
>> On 6/1/22 06:52, Min Hu (Connor) wrote:
>>> In bitwise operation, "val" should be an unsigned type. This patch
>>> fixed it.
>>>
>>> Fixes: 38b539d96eb6 ("net/hns3: support IEEE 1588 PTP")
>>> Cc: stable@dpdk.org
>>
>> Please, let me know coverity ID. No necessity to resend.
>> I'll add it on applying.
> 
> The code warning is checked by our internal code check tool,
> does not have the coverity ID.

Hm, the summary says coverity. Could you suggest how to rephrase it.

Thanks,
Andrew.
  
Dongdong Liu June 8, 2022, 12:04 p.m. UTC | #4
Hi Andrew
On 2022/6/8 19:19, Andrew Rybchenko wrote:
> Hi Dongdong,
>
> On 6/6/22 10:48, Dongdong Liu wrote:
>> Hi Andrew
>>
>> Many thanks for your review.
>>
>> I will take over Hu Min's current work and continue to do the upstream
>> work.
>>
>> On 2022/6/1 16:32, Andrew Rybchenko wrote:
>>> On 6/1/22 06:52, Min Hu (Connor) wrote:
>>>> In bitwise operation, "val" should be an unsigned type. This patch
>>>> fixed it.
>>>>
>>>> Fixes: 38b539d96eb6 ("net/hns3: support IEEE 1588 PTP")
>>>> Cc: stable@dpdk.org
>>>
>>> Please, let me know coverity ID. No necessity to resend.
>>> I'll add it on applying.
>>
>> The code warning is checked by our internal code check tool,
>> does not have the coverity ID.
>
> Hm, the summary says coverity. Could you suggest how to rephrase it.
Aha, the title is inaccurate.
How about change to "net/hns3: fix code check warning".

Thanks,
Dongdong
>
> Thanks,
> Andrew.
>
> .
>
  

Patch

diff --git a/drivers/net/hns3/hns3_ptp.c b/drivers/net/hns3/hns3_ptp.c
index 1442241a4e..0b0061bba5 100644
--- a/drivers/net/hns3/hns3_ptp.c
+++ b/drivers/net/hns3/hns3_ptp.c
@@ -81,7 +81,7 @@  hns3_timesync_configure(struct hns3_adapter *hns, bool en)
 	struct hns3_hw *hw = &hns->hw;
 	struct hns3_pf *pf = &hns->pf;
 	struct hns3_cmd_desc desc;
-	int val;
+	uint32_t val;
 	int ret;
 
 	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CFG_PTP_MODE, false);