* [PATCH][next] opa_vnic: fix check on record->event, incorrect operator used
@ 2019-04-04 10:04 Colin King
2019-04-04 11:23 ` Dennis Dalessandro
2019-04-04 11:36 ` Mukesh Ojha
0 siblings, 2 replies; 4+ messages in thread
From: Colin King @ 2019-04-04 10:04 UTC (permalink / raw)
To: Dennis Dalessandro, Niranjana Vishwanathapura, Doug Ledford,
Jason Gunthorpe, linux-rdma
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The check on record->event is always true because the wrong operator
is being used, used && instead of ||
Addresses-Coverity: ("Constant expression result")
Fixes: fae7a699a925 ("opa_vnic: Convert vport_idr to XArray")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c
index 76cd09410d9a..be5befd92d16 100644
--- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c
+++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c
@@ -869,7 +869,7 @@ static void opa_vnic_event(struct ib_event_handler *handler,
record->event, dev_name(&record->device->dev),
record->element.port_num);
- if (record->event != IB_EVENT_PORT_ERR ||
+ if (record->event != IB_EVENT_PORT_ERR &&
record->event != IB_EVENT_PORT_ACTIVE)
return;
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH][next] opa_vnic: fix check on record->event, incorrect operator used
2019-04-04 10:04 [PATCH][next] opa_vnic: fix check on record->event, incorrect operator used Colin King
@ 2019-04-04 11:23 ` Dennis Dalessandro
2019-04-04 11:32 ` Jason Gunthorpe
2019-04-04 11:36 ` Mukesh Ojha
1 sibling, 1 reply; 4+ messages in thread
From: Dennis Dalessandro @ 2019-04-04 11:23 UTC (permalink / raw)
To: Colin King, Niranjana Vishwanathapura, Doug Ledford,
Jason Gunthorpe, linux-rdma
Cc: kernel-janitors, linux-kernel
On 4/4/2019 6:04 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The check on record->event is always true because the wrong operator
> is being used, used && instead of ||
>
> Addresses-Coverity: ("Constant expression result")
> Fixes: fae7a699a925 ("opa_vnic: Convert vport_idr to XArray")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c
> index 76cd09410d9a..be5befd92d16 100644
> --- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c
> +++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c
> @@ -869,7 +869,7 @@ static void opa_vnic_event(struct ib_event_handler *handler,
> record->event, dev_name(&record->device->dev),
> record->element.port_num);
>
> - if (record->event != IB_EVENT_PORT_ERR ||
> + if (record->event != IB_EVENT_PORT_ERR &&
> record->event != IB_EVENT_PORT_ACTIVE)
> return;
>
>
Missed this in code review. Thanks!
Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][next] opa_vnic: fix check on record->event, incorrect operator used
2019-04-04 11:23 ` Dennis Dalessandro
@ 2019-04-04 11:32 ` Jason Gunthorpe
0 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2019-04-04 11:32 UTC (permalink / raw)
To: Dennis Dalessandro
Cc: Colin King, Niranjana Vishwanathapura, Doug Ledford, linux-rdma,
kernel-janitors, linux-kernel
On Thu, Apr 04, 2019 at 07:23:45AM -0400, Dennis Dalessandro wrote:
> On 4/4/2019 6:04 AM, Colin King wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > The check on record->event is always true because the wrong operator
> > is being used, used && instead of ||
> >
> > Addresses-Coverity: ("Constant expression result")
> > Fixes: fae7a699a925 ("opa_vnic: Convert vport_idr to XArray")
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c
> > index 76cd09410d9a..be5befd92d16 100644
> > +++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c
> > @@ -869,7 +869,7 @@ static void opa_vnic_event(struct ib_event_handler *handler,
> > record->event, dev_name(&record->device->dev),
> > record->element.port_num);
> > - if (record->event != IB_EVENT_PORT_ERR ||
> > + if (record->event != IB_EVENT_PORT_ERR &&
> > record->event != IB_EVENT_PORT_ACTIVE)
> > return;
> >
>
> Missed this in code review. Thanks!
>
> Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][next] opa_vnic: fix check on record->event, incorrect operator used
2019-04-04 10:04 [PATCH][next] opa_vnic: fix check on record->event, incorrect operator used Colin King
2019-04-04 11:23 ` Dennis Dalessandro
@ 2019-04-04 11:36 ` Mukesh Ojha
1 sibling, 0 replies; 4+ messages in thread
From: Mukesh Ojha @ 2019-04-04 11:36 UTC (permalink / raw)
To: Colin King, Dennis Dalessandro, Niranjana Vishwanathapura,
Doug Ledford, Jason Gunthorpe, linux-rdma
Cc: kernel-janitors, linux-kernel
On 4/4/2019 3:34 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The check on record->event is always true because the wrong operator
> is being used, used && instead of ||
>
> Addresses-Coverity: ("Constant expression result")
> Fixes: fae7a699a925 ("opa_vnic: Convert vport_idr to XArray")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Cheers,
-Mukesh
> ---
> drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c
> index 76cd09410d9a..be5befd92d16 100644
> --- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c
> +++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c
> @@ -869,7 +869,7 @@ static void opa_vnic_event(struct ib_event_handler *handler,
> record->event, dev_name(&record->device->dev),
> record->element.port_num);
>
> - if (record->event != IB_EVENT_PORT_ERR ||
> + if (record->event != IB_EVENT_PORT_ERR &&
> record->event != IB_EVENT_PORT_ACTIVE)
> return;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-04-04 11:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-04 10:04 [PATCH][next] opa_vnic: fix check on record->event, incorrect operator used Colin King
2019-04-04 11:23 ` Dennis Dalessandro
2019-04-04 11:32 ` Jason Gunthorpe
2019-04-04 11:36 ` Mukesh Ojha
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).