DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bxnt: remove redundant null check
@ 2020-07-31  2:34 Gaurav Singh
  2020-07-31  5:03 ` Ajit Khaparde
  2020-08-06  3:52 ` Gaurav Singh
  0 siblings, 2 replies; 6+ messages in thread
From: Gaurav Singh @ 2020-07-31  2:34 UTC (permalink / raw)
  To: dev; +Cc: Gaurav Singh

vxlan_mask cannot be NULL since its already being accessed
before. Remove the redundant NULL check.

Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
---
 drivers/net/bnxt/bnxt_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 320b53d94..33a074387 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -554,7 +554,7 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
 			}
 
 			/* Check if VNI is masked. */
-			if (vxlan_spec && vxlan_mask) {
+			if (vxlan_mask) {
 				vni_masked =
 					!!memcmp(vxlan_mask->vni, vni_mask,
 						 RTE_DIM(vni_mask));
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bxnt: remove redundant null check
  2020-07-31  2:34 [dpdk-dev] [PATCH] net/bxnt: remove redundant null check Gaurav Singh
@ 2020-07-31  5:03 ` Ajit Khaparde
  2020-08-05 20:11   ` Thomas Monjalon
  2020-08-06  3:52 ` Gaurav Singh
  1 sibling, 1 reply; 6+ messages in thread
From: Ajit Khaparde @ 2020-07-31  5:03 UTC (permalink / raw)
  To: Gaurav Singh; +Cc: dpdk-dev

On Thu, Jul 30, 2020 at 7:35 PM Gaurav Singh <gaurav1086@gmail.com> wrote:

> vxlan_mask cannot be NULL since its already being accessed
> before. Remove the redundant NULL check.
>
> Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>


> ---
>  drivers/net/bnxt/bnxt_flow.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
> index 320b53d94..33a074387 100644
> --- a/drivers/net/bnxt/bnxt_flow.c
> +++ b/drivers/net/bnxt/bnxt_flow.c
> @@ -554,7 +554,7 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
>                         }
>
>                         /* Check if VNI is masked. */
> -                       if (vxlan_spec && vxlan_mask) {
> +                       if (vxlan_mask) {
>                                 vni_masked =
>                                         !!memcmp(vxlan_mask->vni, vni_mask,
>                                                  RTE_DIM(vni_mask));
> --
> 2.17.1
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bxnt: remove redundant null check
  2020-07-31  5:03 ` Ajit Khaparde
@ 2020-08-05 20:11   ` Thomas Monjalon
  2020-08-06  3:50     ` [dpdk-dev] [PATCH] net/bnxt: remove redundant null check in bnxt_validate_and_parse_flow_type Gaurav Singh
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2020-08-05 20:11 UTC (permalink / raw)
  To: Gaurav Singh, Ajit Khaparde; +Cc: dev

31/07/2020 07:03, Ajit Khaparde:
> On Thu, Jul 30, 2020 at 7:35 PM Gaurav Singh <gaurav1086@gmail.com> wrote:
> 
> > vxlan_mask cannot be NULL since its already being accessed
> > before. Remove the redundant NULL check.

Do you mean vxlan_spec?

> > Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
> >
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

The title has a typo: bxnt

> >                         /* Check if VNI is masked. */
> > -                       if (vxlan_spec && vxlan_mask) {
> > +                       if (vxlan_mask) {

This kind of implicit check is against the coding style.
Except for boolean variables, we should use == or !=

Ajit, please check details when reviewing, thanks.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH] net/bnxt: remove redundant null check in bnxt_validate_and_parse_flow_type
  2020-08-05 20:11   ` Thomas Monjalon
@ 2020-08-06  3:50     ` Gaurav Singh
  0 siblings, 0 replies; 6+ messages in thread
From: Gaurav Singh @ 2020-08-06  3:50 UTC (permalink / raw)
  To: dev; +Cc: Gaurav Singh

vxlan_spec cannot be NULL since its already being accessed
before. Remove the redundant NULL check.

Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
---
 drivers/net/bnxt/bnxt_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 320b53d94..c1c59bbe5 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -554,7 +554,7 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
 			}
 
 			/* Check if VNI is masked. */
-			if (vxlan_spec && vxlan_mask) {
+			if (vxlan_mask != NULL) {
 				vni_masked =
 					!!memcmp(vxlan_mask->vni, vni_mask,
 						 RTE_DIM(vni_mask));
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH] net/bnxt: remove redundant null check in bnxt_validate_and_parse_flow_type
  2020-07-31  2:34 [dpdk-dev] [PATCH] net/bxnt: remove redundant null check Gaurav Singh
  2020-07-31  5:03 ` Ajit Khaparde
@ 2020-08-06  3:52 ` Gaurav Singh
  2020-09-02  4:03   ` Ajit Khaparde
  1 sibling, 1 reply; 6+ messages in thread
From: Gaurav Singh @ 2020-08-06  3:52 UTC (permalink / raw)
  To: dev; +Cc: Gaurav Singh

vxlan_spec cannot be NULL since its already being accessed
before. Remove the redundant NULL check.

Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
---
 drivers/net/bnxt/bnxt_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 320b53d94..c1c59bbe5 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -554,7 +554,7 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
 			}
 
 			/* Check if VNI is masked. */
-			if (vxlan_spec && vxlan_mask) {
+			if (vxlan_mask != NULL) {
 				vni_masked =
 					!!memcmp(vxlan_mask->vni, vni_mask,
 						 RTE_DIM(vni_mask));
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bnxt: remove redundant null check in bnxt_validate_and_parse_flow_type
  2020-08-06  3:52 ` Gaurav Singh
@ 2020-09-02  4:03   ` Ajit Khaparde
  0 siblings, 0 replies; 6+ messages in thread
From: Ajit Khaparde @ 2020-09-02  4:03 UTC (permalink / raw)
  To: Gaurav Singh; +Cc: dpdk-dev

On Wed, Aug 5, 2020 at 8:52 PM Gaurav Singh <gaurav1086@gmail.com> wrote:

> vxlan_spec cannot be NULL since its already being accessed
> before. Remove the redundant NULL check.
>
> Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
>
Patch applied to dpdk-next-net-brcm. Thanks


> ---
>  drivers/net/bnxt/bnxt_flow.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
> index 320b53d94..c1c59bbe5 100644
> --- a/drivers/net/bnxt/bnxt_flow.c
> +++ b/drivers/net/bnxt/bnxt_flow.c
> @@ -554,7 +554,7 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
>                         }
>
>                         /* Check if VNI is masked. */
> -                       if (vxlan_spec && vxlan_mask) {
> +                       if (vxlan_mask != NULL) {
>                                 vni_masked =
>                                         !!memcmp(vxlan_mask->vni, vni_mask,
>                                                  RTE_DIM(vni_mask));
> --
> 2.17.1
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-02  4:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31  2:34 [dpdk-dev] [PATCH] net/bxnt: remove redundant null check Gaurav Singh
2020-07-31  5:03 ` Ajit Khaparde
2020-08-05 20:11   ` Thomas Monjalon
2020-08-06  3:50     ` [dpdk-dev] [PATCH] net/bnxt: remove redundant null check in bnxt_validate_and_parse_flow_type Gaurav Singh
2020-08-06  3:52 ` Gaurav Singh
2020-09-02  4:03   ` Ajit Khaparde

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).