* [Intel-wired-lan] [PATCH iwl-next 1/2] iavf: drop duplicate iavf_{add|del}_cloud_filter() calls
@ 2024-02-26 13:21 Alexey Kodanev
2024-02-26 13:21 ` [Intel-wired-lan] [PATCH iwl-next 2/2] i40e: remove unnecessary qv_info ptr NULL checks Alexey Kodanev
2024-02-26 22:30 ` [Intel-wired-lan] [PATCH iwl-next 1/2] iavf: drop duplicate iavf_{add|del}_cloud_filter() calls Ahmed Zaki
0 siblings, 2 replies; 4+ messages in thread
From: Alexey Kodanev @ 2024-02-26 13:21 UTC (permalink / raw)
To: intel-wired-lan; +Cc: Alexey Kodanev
There are currently two pairs of identical checks and calls
to iavf_{add|del}_cloud_filter().
Detected using the static analysis tool - Svace.
Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
---
drivers/net/ethernet/intel/iavf/iavf_main.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 335fd13e86f7..5097efa2e1cd 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -2170,19 +2170,10 @@ static int iavf_process_aq_command(struct iavf_adapter *adapter)
iavf_add_cloud_filter(adapter);
return 0;
}
-
- if (adapter->aq_required & IAVF_FLAG_AQ_DEL_CLOUD_FILTER) {
- iavf_del_cloud_filter(adapter);
- return 0;
- }
if (adapter->aq_required & IAVF_FLAG_AQ_DEL_CLOUD_FILTER) {
iavf_del_cloud_filter(adapter);
return 0;
}
- if (adapter->aq_required & IAVF_FLAG_AQ_ADD_CLOUD_FILTER) {
- iavf_add_cloud_filter(adapter);
- return 0;
- }
if (adapter->aq_required & IAVF_FLAG_AQ_ADD_FDIR_FILTER) {
iavf_add_fdir_filter(adapter);
return IAVF_SUCCESS;
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Intel-wired-lan] [PATCH iwl-next 2/2] i40e: remove unnecessary qv_info ptr NULL checks
2024-02-26 13:21 [Intel-wired-lan] [PATCH iwl-next 1/2] iavf: drop duplicate iavf_{add|del}_cloud_filter() calls Alexey Kodanev
@ 2024-02-26 13:21 ` Alexey Kodanev
2024-03-04 8:46 ` Pucha, HimasekharX Reddy
2024-02-26 22:30 ` [Intel-wired-lan] [PATCH iwl-next 1/2] iavf: drop duplicate iavf_{add|del}_cloud_filter() calls Ahmed Zaki
1 sibling, 1 reply; 4+ messages in thread
From: Alexey Kodanev @ 2024-02-26 13:21 UTC (permalink / raw)
To: intel-wired-lan; +Cc: Alexey Kodanev
The "qv_info" ptr cannot be NULL when it gets the address of
an element of the flexible array "qvlist_info->qv_info".
Detected using the static analysis tool - Svace.
Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
---
drivers/net/ethernet/intel/i40e/i40e_client.c | 4 ----
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 4 ----
2 files changed, 8 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c
index 306758428aef..b32071ee84af 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_client.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c
@@ -148,8 +148,6 @@ static void i40e_client_release_qvlist(struct i40e_info *ldev)
u32 reg_idx;
qv_info = &qvlist_info->qv_info[i];
- if (!qv_info)
- continue;
reg_idx = I40E_PFINT_LNKLSTN(qv_info->v_idx - 1);
wr32(&pf->hw, reg_idx, I40E_PFINT_LNKLSTN_FIRSTQ_INDX_MASK);
}
@@ -576,8 +574,6 @@ static int i40e_client_setup_qvlist(struct i40e_info *ldev,
for (i = 0; i < qvlist_info->num_vectors; i++) {
qv_info = &qvlist_info->qv_info[i];
- if (!qv_info)
- continue;
v_idx = qv_info->v_idx;
/* Validate vector id belongs to this client */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index b34c71770887..83a34e98bdc7 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -491,8 +491,6 @@ static void i40e_release_rdma_qvlist(struct i40e_vf *vf)
u32 v_idx, reg_idx, reg;
qv_info = &qvlist_info->qv_info[i];
- if (!qv_info)
- continue;
v_idx = qv_info->v_idx;
if (qv_info->ceq_idx != I40E_QUEUE_INVALID_IDX) {
/* Figure out the queue after CEQ and make that the
@@ -562,8 +560,6 @@ i40e_config_rdma_qvlist(struct i40e_vf *vf,
msix_vf = pf->hw.func_caps.num_msix_vectors_vf;
for (i = 0; i < qvlist_info->num_vectors; i++) {
qv_info = &qvlist_info->qv_info[i];
- if (!qv_info)
- continue;
/* Validate vector id belongs to this vf */
if (!i40e_vc_isvalid_vector_id(vf, qv_info->v_idx)) {
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Intel-wired-lan] [PATCH iwl-next 1/2] iavf: drop duplicate iavf_{add|del}_cloud_filter() calls
2024-02-26 13:21 [Intel-wired-lan] [PATCH iwl-next 1/2] iavf: drop duplicate iavf_{add|del}_cloud_filter() calls Alexey Kodanev
2024-02-26 13:21 ` [Intel-wired-lan] [PATCH iwl-next 2/2] i40e: remove unnecessary qv_info ptr NULL checks Alexey Kodanev
@ 2024-02-26 22:30 ` Ahmed Zaki
1 sibling, 0 replies; 4+ messages in thread
From: Ahmed Zaki @ 2024-02-26 22:30 UTC (permalink / raw)
To: Alexey Kodanev, intel-wired-lan
On 2024-02-26 6:21 a.m., Alexey Kodanev wrote:
> There are currently two pairs of identical checks and calls
> to iavf_{add|del}_cloud_filter().
>
> Detected using the static analysis tool - Svace.
>
> Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
> ---
> drivers/net/ethernet/intel/iavf/iavf_main.c | 9 ---------
> 1 file changed, 9 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index 335fd13e86f7..5097efa2e1cd 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> @@ -2170,19 +2170,10 @@ static int iavf_process_aq_command(struct iavf_adapter *adapter)
> iavf_add_cloud_filter(adapter);
> return 0;
> }
> -
> - if (adapter->aq_required & IAVF_FLAG_AQ_DEL_CLOUD_FILTER) {
> - iavf_del_cloud_filter(adapter);
> - return 0;
> - }
> if (adapter->aq_required & IAVF_FLAG_AQ_DEL_CLOUD_FILTER) {
> iavf_del_cloud_filter(adapter);
> return 0;
> }
> - if (adapter->aq_required & IAVF_FLAG_AQ_ADD_CLOUD_FILTER) {
> - iavf_add_cloud_filter(adapter);
> - return 0;
> - }
> if (adapter->aq_required & IAVF_FLAG_AQ_ADD_FDIR_FILTER) {
> iavf_add_fdir_filter(adapter);
> return IAVF_SUCCESS;
Thanks.
Reviewed-by: Ahmed Zaki <ahmed.zaki@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Intel-wired-lan] [PATCH iwl-next 2/2] i40e: remove unnecessary qv_info ptr NULL checks
2024-02-26 13:21 ` [Intel-wired-lan] [PATCH iwl-next 2/2] i40e: remove unnecessary qv_info ptr NULL checks Alexey Kodanev
@ 2024-03-04 8:46 ` Pucha, HimasekharX Reddy
0 siblings, 0 replies; 4+ messages in thread
From: Pucha, HimasekharX Reddy @ 2024-03-04 8:46 UTC (permalink / raw)
To: Alexey Kodanev, intel-wired-lan@lists.osuosl.org
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Alexey Kodanev
> Sent: Monday, February 26, 2024 6:51 PM
> To: intel-wired-lan@lists.osuosl.org
> Cc: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next 2/2] i40e: remove unnecessary qv_info ptr NULL checks
>
> The "qv_info" ptr cannot be NULL when it gets the address of
> an element of the flexible array "qvlist_info->qv_info".
>
> Detected using the static analysis tool - Svace.
>
> Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
> ---
> drivers/net/ethernet/intel/i40e/i40e_client.c | 4 ----
> drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 4 ----
> 2 files changed, 8 deletions(-)
>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-04 8:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-26 13:21 [Intel-wired-lan] [PATCH iwl-next 1/2] iavf: drop duplicate iavf_{add|del}_cloud_filter() calls Alexey Kodanev
2024-02-26 13:21 ` [Intel-wired-lan] [PATCH iwl-next 2/2] i40e: remove unnecessary qv_info ptr NULL checks Alexey Kodanev
2024-03-04 8:46 ` Pucha, HimasekharX Reddy
2024-02-26 22:30 ` [Intel-wired-lan] [PATCH iwl-next 1/2] iavf: drop duplicate iavf_{add|del}_cloud_filter() calls Ahmed Zaki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox