net/bxnt: remove redundant null check
PATCH 1/1 net/bxnt: remove redundant null check
vxlan_mask cannot be NULL since its already being accessed before. Remove the redundant NULL check.
--- drivers/net/bnxt/bnxt_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/bnxt_flow.c +1 -1
@@ -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));
Signature · 1 line
2.17.1
Quoted 5 lines · Gaurav Singh
vxlan_maskcannot be NULL since its already being accessed before. Remove the redundant NULL check.Signed-off-by Gaurav Singh <[email protected]>
Quoted 21 lines
--- drivers/net/bnxt/bnxt_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/bnxt/bnxt_flow.c +1
-2@@ -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
31/07/2020 07:03, Ajit Khaparde:
Quoted 4 lines · Gaurav Singh
Quoted 3 lines
vxlan_maskcannot be NULL since its already being accessed before. Remove the redundant NULL check.
Do you mean vxlan_spec?
Quoted 3 lines
Quoted 2 lines
Signed-off-by Gaurav Singh <[email protected]>Acked-by Ajit Khaparde <[email protected]>
The title has a typo: bxnt
Quoted 3 lines
drivers/net/bnxt/bnxt_flow.c bnxt_validate_and_parse_flow_type(struct bnxt *bp, · line 557
Quoted 3 lines
/* Check if VNI is masked. */drivers/net/bnxt/bnxt_flow.c +1
-1-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.
PATCH 1/1 net/bnxt: remove redundant null check in bnxt_validate_and_parse_flow_type
vxlan_spec cannot be NULL since its already being accessed before. Remove the redundant NULL check.
--- drivers/net/bnxt/bnxt_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/bnxt_flow.c +1 -1
@@ -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));
Signature · 1 line
2.17.1
PATCH 1/1 net/bnxt: remove redundant null check in bnxt_validate_and_parse_flow_type
In reply to Gaurav Singhvxlan_spec cannot be NULL since its already being accessed before. Remove the redundant NULL check.
--- drivers/net/bnxt/bnxt_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/bnxt_flow.c +1 -1
@@ -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));
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH] net/bnxt: remove redundant null check in bnxt_validate_and_parse_flow_type
Quoted 5 lines · Gaurav Singh
vxlan_speccannot be NULL since its already being accessed before. Remove the redundant NULL check.Signed-off-by Gaurav Singh <[email protected]>
Patch applied to dpdk-next-net-brcm. Thanks
Quoted 21 lines
--- drivers/net/bnxt/bnxt_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/bnxt/bnxt_flow.c +1
-2@@ -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