@@ -6368,9 +6368,16 @@ static void hns_roce_v2_int_mask_enable(struct hns_roce_dev *hr_dev,
6368
6368
roce_write (hr_dev , ROCEE_VF_ABN_INT_CFG_REG , enable_flag );
6369
6369
}
6370
6370
6371
- static void hns_roce_v2_destroy_eqc (struct hns_roce_dev * hr_dev , u32 eqn )
6371
+ static void free_eq_buf (struct hns_roce_dev * hr_dev , struct hns_roce_eq * eq )
6372
+ {
6373
+ hns_roce_mtr_destroy (hr_dev , & eq -> mtr );
6374
+ }
6375
+
6376
+ static void hns_roce_v2_destroy_eqc (struct hns_roce_dev * hr_dev ,
6377
+ struct hns_roce_eq * eq )
6372
6378
{
6373
6379
struct device * dev = hr_dev -> dev ;
6380
+ int eqn = eq -> eqn ;
6374
6381
int ret ;
6375
6382
u8 cmd ;
6376
6383
@@ -6381,12 +6388,9 @@ static void hns_roce_v2_destroy_eqc(struct hns_roce_dev *hr_dev, u32 eqn)
6381
6388
6382
6389
ret = hns_roce_destroy_hw_ctx (hr_dev , cmd , eqn & HNS_ROCE_V2_EQN_M );
6383
6390
if (ret )
6384
- dev_err (dev , "[mailbox cmd] destroy eqc(%u) failed.\n" , eqn );
6385
- }
6391
+ dev_err (dev , "[mailbox cmd] destroy eqc(%d) failed.\n" , eqn );
6386
6392
6387
- static void free_eq_buf (struct hns_roce_dev * hr_dev , struct hns_roce_eq * eq )
6388
- {
6389
- hns_roce_mtr_destroy (hr_dev , & eq -> mtr );
6393
+ free_eq_buf (hr_dev , eq );
6390
6394
}
6391
6395
6392
6396
static void init_eq_config (struct hns_roce_dev * hr_dev , struct hns_roce_eq * eq )
@@ -6733,7 +6737,7 @@ static int hns_roce_v2_init_eq_table(struct hns_roce_dev *hr_dev)
6733
6737
6734
6738
err_create_eq_fail :
6735
6739
for (i -= 1 ; i >= 0 ; i -- )
6736
- free_eq_buf (hr_dev , & eq_table -> eq [i ]);
6740
+ hns_roce_v2_destroy_eqc (hr_dev , & eq_table -> eq [i ]);
6737
6741
kfree (eq_table -> eq );
6738
6742
6739
6743
return ret ;
@@ -6753,11 +6757,8 @@ static void hns_roce_v2_cleanup_eq_table(struct hns_roce_dev *hr_dev)
6753
6757
__hns_roce_free_irq (hr_dev );
6754
6758
destroy_workqueue (hr_dev -> irq_workq );
6755
6759
6756
- for (i = 0 ; i < eq_num ; i ++ ) {
6757
- hns_roce_v2_destroy_eqc (hr_dev , i );
6758
-
6759
- free_eq_buf (hr_dev , & eq_table -> eq [i ]);
6760
- }
6760
+ for (i = 0 ; i < eq_num ; i ++ )
6761
+ hns_roce_v2_destroy_eqc (hr_dev , & eq_table -> eq [i ]);
6761
6762
6762
6763
kfree (eq_table -> eq );
6763
6764
}
0 commit comments