[dpdk-dev] net/avp: fix interrupt migration check

Message ID 20170428064903.19286-1-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Ferruh Yigit April 28, 2017, 6:49 a.m. UTC
  Bitwise OR within if statement is always true, fix bitwise operator.

Coverity issue: 1423906
Fixes: 82e140b84995 ("net/avp: handle interrupt migration")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/avp/avp_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Allain Legacy April 28, 2017, 10:52 a.m. UTC | #1
> -----Original Message-----
> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]
> Sent: Friday, April 28, 2017 2:49 AM
> To: Peters, Matt
> Cc: dev@dpdk.org; YIGIT, FERRUH
> Subject: [PATCH] net/avp: fix interrupt migration check
> 
> Bitwise OR within if statement is always true, fix bitwise operator.
> 
> Coverity issue: 1423906
> Fixes: 82e140b84995 ("net/avp: handle interrupt migration")
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
Thanks for catching this.

Acked-by: Allain Legacy <allain.legacy@windriver.com>
  
Ferruh Yigit April 28, 2017, 12:47 p.m. UTC | #2
On 4/28/2017 11:52 AM, Legacy, Allain wrote:
>> -----Original Message-----
>> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]
>> Sent: Friday, April 28, 2017 2:49 AM
>> To: Peters, Matt
>> Cc: dev@dpdk.org; YIGIT, FERRUH
>> Subject: [PATCH] net/avp: fix interrupt migration check
>>
>> Bitwise OR within if statement is always true, fix bitwise operator.
>>
>> Coverity issue: 1423906
>> Fixes: 82e140b84995 ("net/avp: handle interrupt migration")
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

> Acked-by: Allain Legacy <allain.legacy@windriver.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index 9ca2786..fe6849f 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -712,7 +712,7 @@  avp_dev_interrupt_handler(void *data)
 		RTE_PTR_ADD(registers,
 			    RTE_AVP_INTERRUPT_STATUS_OFFSET));
 
-	if (status | RTE_AVP_MIGRATION_INTERRUPT_MASK) {
+	if (status & RTE_AVP_MIGRATION_INTERRUPT_MASK) {
 		/* handle interrupt based on current status */
 		value = AVP_READ32(
 			RTE_PTR_ADD(registers,