ath10k: coding style cleanup
cover ath10k: coding style cleanup
Michal Kazior (6):
ath10k: fix code style and add comments to tx code
ath10k: tweak ath10k_pci_diag_read_mem() prototype
ath10k: tweak ath10k_pci_diag_write_mem() prototype
ath10k: drop unnecessary else branch
ath10k: drop unnecessary else branch
ath10k: cleanup ath10k_pci_stop_intr()
drivers/net/wireless/ath/ath10k/htt_tx.c | 4 ++ drivers/net/wireless/ath/ath10k/pci.c | 68 +++++++++++++----------------- drivers/net/wireless/ath/ath10k/txrx.c | 4 +- 3 files changed, 37 insertions(+), 39 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 1/6 ath10k: fix code style and add comments to tx code
--- drivers/net/wireless/ath/ath10k/htt_tx.c | 4 ++++ drivers/net/wireless/ath/ath10k/txrx.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/htt_tx.c +4 -0
@@ -271,6 +271,8 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)memcpy (cmd->mgmt_tx.hdr, msdu->data,min ((int )msdu->len,HTT_MGMT_FRM_HDR_DOWNLOAD_LEN )); +/* refcount is decremented by HTC and HTT completions until it reaches +* zero and is freed */ skb_cb =ATH10K_SKB_CB (txdesc); skb_cb->htt.msdu_id = msdu_id; skb_cb->htt.refcount =2 ;
@@ -403,6 +405,8 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)memcpy (cmd->data_tx.prefetch, msdu->data, prefetch_len); +/* refcount is decremented by HTC and HTT completions until it reaches +* zero and is freed */ skb_cb =ATH10K_SKB_CB (txdesc); skb_cb->htt.msdu_id = msdu_id; skb_cb->htt.refcount =2 ;
drivers/net/wireless/ath/ath10k/txrx.c +3 -1
@@ -55,7 +55,9 @@ void ath10k_txrx_tx_unref(struct ath10k_htt *htt, struct sk_buff *txdesc)if (ATH10K_SKB_CB (txdesc)->htt.refcount ==0 )return ; -if (--ATH10K_SKB_CB (txdesc)->htt.refcount >0 ) +ATH10K_SKB_CB (txdesc)->htt.refcount--; + +if (ATH10K_SKB_CB (txdesc)->htt.refcount >0 )return ;if (txfrag) {
Signature · 1 line
1.7.9.5
PATCH 2/6 ath10k: tweak ath10k_pci_diag_read_mem() prototype
In reply to Michal KaziorIt reads not well defined data thus void pointer
seems a better match here.
--- drivers/net/wireless/ath/ath10k/pci.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +4 -5
@@ -98,7 +98,7 @@ static const struct ce_pipe_config target_ce_config_wlan[] = {* Caller must guarantee proper alignment, when applicable, and single user * at any moment. */ -static int ath10k_pci_diag_read_mem (struct ath10k *ar,u32 address,u8 *data, +static int ath10k_pci_diag_read_mem (struct ath10k *ar,u32 address,void *data,int nbytes) {struct ath10k_pci *ar_pci =ath10k_pci_priv (ar);
@@ -248,8 +248,7 @@ static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address, u32 *data {/* Assume range doesn't cross this boundary */ if (address >=DRAM_BASE_ADDRESS ) -return ath10k_pci_diag_read_mem (ar, address, (u8 *)data, -sizeof (u32)); +return ath10k_pci_diag_read_mem (ar, address, data,sizeof (u32));else {ath10k_pci_wake (ar); *data =ath10k_pci_read32 (ar, address);
@@ -692,7 +691,7 @@ static void ath10k_pci_hif_dump_area(struct ath10k *ar) host_addr =host_interest_item_address (HI_ITEM (hi_failure_state));if (ath10k_pci_diag_read_mem (ar, host_addr, - (u8 *) ®_dump_area,sizeof (u32)) !=0 ) { + ®_dump_area,sizeof (u32)) !=0 ) {ath10k_warn ("could not read hi_failure_state\n" );return ; }
@@ -700,7 +699,7 @@ static void ath10k_pci_hif_dump_area(struct ath10k *ar)ath10k_err ("target register Dump Location: 0x%08X\n" , reg_dump_area);if (ath10k_pci_diag_read_mem (ar, reg_dump_area, - (u8 *) ®_dump_values[0 ], + ®_dump_values[0 ],REG_DUMP_COUNT_QCA988X *sizeof (u32)) !=0 ) {ath10k_err ("could not dump FW Dump Area\n" );return ;
Signature · 1 line
1.7.9.5
PATCH 3/6 ath10k: tweak ath10k_pci_diag_write_mem() prototype
In reply to Michal KaziorIt doesn't modify the data argument thus const. It also is more suitable to use void pointer here since the payload type is not well defined.
--- drivers/net/wireless/ath/ath10k/pci.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +7 -7
@@ -257,8 +257,8 @@ static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address, u32 *data } } -static int ath10k_pci_diag_write_mem (struct ath10k *ar,u32 address,u8 *data, -int nbytes) +static int ath10k_pci_diag_write_mem (struct ath10k *ar,u32 address, +const void *data,int nbytes) {struct ath10k_pci *ar_pci =ath10k_pci_priv (ar);int ret =0 ;
@@ -395,8 +395,8 @@ static int ath10k_pci_diag_write_access(struct ath10k *ar, u32 address,/* Assume range doesn't cross this boundary */ if (address >=DRAM_BASE_ADDRESS ) {u32 data_buf = data; -return ath10k_pci_diag_write_mem (ar, address, (u8 *) &data_buf, -sizeof (u32)); +return ath10k_pci_diag_write_mem (ar, address, &data_buf, +sizeof (u32)); }else {ath10k_pci_wake (ar);ath10k_pci_write32 (ar, address, data);
@@ -1503,7 +1503,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) } ret =ath10k_pci_diag_write_mem (ar, pipe_cfg_targ_addr, - (u8 *) target_ce_config_wlan, + target_ce_config_wlan,sizeof (target_ce_config_wlan));if (ret !=0 ) {
@@ -1526,7 +1526,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) } ret =ath10k_pci_diag_write_mem (ar, svc_to_pipe_map, - (u8 *) target_service_to_ce_map_wlan, + target_service_to_ce_map_wlan,sizeof (target_service_to_ce_map_wlan));if (ret !=0 ) {ath10k_err ("Failed to write svc/pipe map: %d\n" , ret);
@@ -1545,7 +1545,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) ret =ath10k_pci_diag_write_mem (ar, pcie_state_targ_addr + offsetof(struct pcie_state , config_flags), - (u8 *) &pcie_config_flags, + &pcie_config_flags,sizeof (pcie_config_flags));if (ret !=0 ) {ath10k_err ("Failed to write pcie config_flags: %d\n" , ret);
Signature · 1 line
1.7.9.5
PATCH 4/6 ath10k: drop unnecessary else branch
In reply to Michal Kazior--- drivers/net/wireless/ath/ath10k/pci.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +11 -15
@@ -249,12 +249,11 @@ static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address, u32 *data/* Assume range doesn't cross this boundary */ if (address >=DRAM_BASE_ADDRESS )return ath10k_pci_diag_read_mem (ar, address, data,sizeof (u32)); -else { -ath10k_pci_wake (ar); - *data =ath10k_pci_read32 (ar, address); -ath10k_pci_sleep (ar); -return 0 ; - } + +ath10k_pci_wake (ar); + *data =ath10k_pci_read32 (ar, address); +ath10k_pci_sleep (ar); +return 0 ; } static int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
@@ -393,17 +392,14 @@ static int ath10k_pci_diag_write_access(struct ath10k *ar, u32 address, u32 data) {/* Assume range doesn't cross this boundary */ -if (address >=DRAM_BASE_ADDRESS ) { -u32 data_buf = data; -return ath10k_pci_diag_write_mem (ar, address, &data_buf, +if (address >=DRAM_BASE_ADDRESS ) +return ath10k_pci_diag_write_mem (ar, address, &data,sizeof (u32)); - }else { -ath10k_pci_wake (ar); -ath10k_pci_write32 (ar, address, data); -ath10k_pci_sleep (ar); -return 0 ; - } +ath10k_pci_wake (ar); +ath10k_pci_write32 (ar, address, data); +ath10k_pci_sleep (ar); +return 0 ; }static bool ath10k_pci_target_is_awake (struct ath10k *ar)
Signature · 1 line
1.7.9.5
PATCH 5/6 ath10k: drop unnecessary else branch
In reply to Michal Kaziorath10k_pci_{sleep,wake} do refcounting and the
awake sections can be nested.
--- drivers/net/wireless/ath/ath10k/pci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +2 -3
@@ -1650,7 +1650,6 @@ static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar)if (fw_indicator &FW_IND_EVENT_PENDING ) {/* ACK: clear Target-side pending event */ ath10k_pci_write32 (ar, fw_indicator_address, fw_indicator & ~FW_IND_EVENT_PENDING ); -ath10k_pci_sleep (ar);if (ar_pci->started)ath10k_pci_hif_dump_area (ar);
@@ -1661,9 +1660,9 @@ static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar)*/ ath10k_warn ("early firmware event indicated\n" ); } - }else { -ath10k_pci_sleep (ar); } + +ath10k_pci_sleep (ar); }static const struct ath10k_hif_ops ath10k_pci_hif_ops = {
Signature · 1 line
1.7.9.5
PATCH 6/6 ath10k: cleanup ath10k_pci_stop_intr()
In reply to Michal Kazior--- drivers/net/wireless/ath/ath10k/pci.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +7 -9
@@ -1937,18 +1937,16 @@ exit:static void ath10k_pci_stop_intr (struct ath10k *ar) { -int i;struct ath10k_pci *ar_pci =ath10k_pci_priv (ar); +int i; -if (ar_pci->num_msi_intrs >0 ) { -/* MSI interrupt(s) */ -for (i =0 ; i < ar_pci->num_msi_intrs; i++) -free_irq (ar_pci->pdev->irq + i, ar); - ar_pci->num_msi_intrs =0 ; +/* There's at least one interrupt irregardless whether its legacy INTR +* or MSI or MSI-X */ +for (i =0 ; i <min (1 , ar_pci->num_msi_intrs); i++) +free_irq (ar_pci->pdev->irq + i, ar); + +if (ar_pci->num_msi_intrs >0 )pci_disable_msi (ar_pci->pdev); - }else -/* Legacy PCI line interrupt */ -free_irq (ar_pci->pdev->irq, ar); }static int ath10k_pci_reset_target (struct ath10k *ar)
Signature · 1 line
1.7.9.5
PATCH v2 6/6 ath10k: cleanup ath10k_pci_stop_intr()
Quoted 1 line · Michal Kazior
Signed-off-by Michal Kazior <[email protected]>
[...]
drivers/net/wireless/ath/ath10k/pci.c exit: · line 1946
Quoted 4 lines
drivers/net/wireless/ath/ath10k/pci.c +4
-0+/* There's at least one interrupt irregardless whether its legacy INTR +* or MSI or MSI-X */ +for (i =0 ; i <min (1 , ar_pci->num_msi_intrs); i++) +free_irq (ar_pci->pdev->irq + i, ar);
I'm not sure about this. If num_msi_intrs is 5 we still free only the first irq? Did I understood this correctly?
Signature · 1 line
Kalle Valo
PATCH 6/6 ath10k: cleanup ath10k_pci_stop_intr()
Quoted 6 lines · Kalle Valo
Quoted 1 line · Michal Kazior
Signed-off-by Michal Kazior <[email protected]>[...]
Quoted 7 lines
drivers/net/wireless/ath/ath10k/pci.c exit: · line 1946
Quoted 4 lines
drivers/net/wireless/ath/ath10k/pci.c +4
-0+/* There's at least one interrupt irregardless whether its legacy INTR +* or MSI or MSI-X */ +for (i =0 ; i <min (1 , ar_pci->num_msi_intrs); i++) +free_irq (ar_pci->pdev->irq + i, ar);I'm not sure about this. If
num_msi_intrsis 5 we still free only the first irq? Did I understood this correctly?
Oh my! This is supposed to be max(). Good catch, thanks!
-- Pozdrawiam / Best regards, Michal Kazior.
v2 cover ath10k: coding style cleanup
In reply to Michal Kaziorv2: fixed patch #6
Michal Kazior (6):
ath10k: fix code style and add comments to tx code
ath10k: tweak ath10k_pci_diag_read_mem() prototype
ath10k: tweak ath10k_pci_diag_write_mem() prototype
ath10k: drop unnecessary else branch
ath10k: drop unnecessary else branch
ath10k: cleanup ath10k_pci_stop_intr()
drivers/net/wireless/ath/ath10k/htt_tx.c | 4 ++ drivers/net/wireless/ath/ath10k/pci.c | 68 +++++++++++++----------------- drivers/net/wireless/ath/ath10k/txrx.c | 4 +- 3 files changed, 37 insertions(+), 39 deletions(-)
Signature · 1 line
1.7.9.5
PATCH v2 1/6 ath10k: fix code style and add comments to tx code
--- drivers/net/wireless/ath/ath10k/htt_tx.c | 4 ++++ drivers/net/wireless/ath/ath10k/txrx.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/htt_tx.c +4 -0
@@ -271,6 +271,8 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)memcpy (cmd->mgmt_tx.hdr, msdu->data,min ((int )msdu->len,HTT_MGMT_FRM_HDR_DOWNLOAD_LEN )); +/* refcount is decremented by HTC and HTT completions until it reaches +* zero and is freed */ skb_cb =ATH10K_SKB_CB (txdesc); skb_cb->htt.msdu_id = msdu_id; skb_cb->htt.refcount =2 ;
@@ -403,6 +405,8 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)memcpy (cmd->data_tx.prefetch, msdu->data, prefetch_len); +/* refcount is decremented by HTC and HTT completions until it reaches +* zero and is freed */ skb_cb =ATH10K_SKB_CB (txdesc); skb_cb->htt.msdu_id = msdu_id; skb_cb->htt.refcount =2 ;
drivers/net/wireless/ath/ath10k/txrx.c +3 -1
@@ -55,7 +55,9 @@ void ath10k_txrx_tx_unref(struct ath10k_htt *htt, struct sk_buff *txdesc)if (ATH10K_SKB_CB (txdesc)->htt.refcount ==0 )return ; -if (--ATH10K_SKB_CB (txdesc)->htt.refcount >0 ) +ATH10K_SKB_CB (txdesc)->htt.refcount--; + +if (ATH10K_SKB_CB (txdesc)->htt.refcount >0 )return ;if (txfrag) {
Signature · 1 line
1.7.9.5
PATCH v2 2/6 ath10k: tweak ath10k_pci_diag_read_mem() prototype
In reply to Michal KaziorIt reads not well defined data thus void pointer
seems a better match here.
--- drivers/net/wireless/ath/ath10k/pci.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +4 -5
@@ -98,7 +98,7 @@ static const struct ce_pipe_config target_ce_config_wlan[] = {* Caller must guarantee proper alignment, when applicable, and single user * at any moment. */ -static int ath10k_pci_diag_read_mem (struct ath10k *ar,u32 address,u8 *data, +static int ath10k_pci_diag_read_mem (struct ath10k *ar,u32 address,void *data,int nbytes) {struct ath10k_pci *ar_pci =ath10k_pci_priv (ar);
@@ -248,8 +248,7 @@ static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address, u32 *data {/* Assume range doesn't cross this boundary */ if (address >=DRAM_BASE_ADDRESS ) -return ath10k_pci_diag_read_mem (ar, address, (u8 *)data, -sizeof (u32)); +return ath10k_pci_diag_read_mem (ar, address, data,sizeof (u32));else {ath10k_pci_wake (ar); *data =ath10k_pci_read32 (ar, address);
@@ -692,7 +691,7 @@ static void ath10k_pci_hif_dump_area(struct ath10k *ar) host_addr =host_interest_item_address (HI_ITEM (hi_failure_state));if (ath10k_pci_diag_read_mem (ar, host_addr, - (u8 *) ®_dump_area,sizeof (u32)) !=0 ) { + ®_dump_area,sizeof (u32)) !=0 ) {ath10k_warn ("could not read hi_failure_state\n" );return ; }
@@ -700,7 +699,7 @@ static void ath10k_pci_hif_dump_area(struct ath10k *ar)ath10k_err ("target register Dump Location: 0x%08X\n" , reg_dump_area);if (ath10k_pci_diag_read_mem (ar, reg_dump_area, - (u8 *) ®_dump_values[0 ], + ®_dump_values[0 ],REG_DUMP_COUNT_QCA988X *sizeof (u32)) !=0 ) {ath10k_err ("could not dump FW Dump Area\n" );return ;
Signature · 1 line
1.7.9.5
PATCH v2 3/6 ath10k: tweak ath10k_pci_diag_write_mem() prototype
In reply to Michal KaziorIt doesn't modify the data argument thus const. It also is more suitable to use void pointer here since the payload type is not well defined.
--- drivers/net/wireless/ath/ath10k/pci.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +7 -7
@@ -257,8 +257,8 @@ static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address, u32 *data } } -static int ath10k_pci_diag_write_mem (struct ath10k *ar,u32 address,u8 *data, -int nbytes) +static int ath10k_pci_diag_write_mem (struct ath10k *ar,u32 address, +const void *data,int nbytes) {struct ath10k_pci *ar_pci =ath10k_pci_priv (ar);int ret =0 ;
@@ -395,8 +395,8 @@ static int ath10k_pci_diag_write_access(struct ath10k *ar, u32 address,/* Assume range doesn't cross this boundary */ if (address >=DRAM_BASE_ADDRESS ) {u32 data_buf = data; -return ath10k_pci_diag_write_mem (ar, address, (u8 *) &data_buf, -sizeof (u32)); +return ath10k_pci_diag_write_mem (ar, address, &data_buf, +sizeof (u32)); }else {ath10k_pci_wake (ar);ath10k_pci_write32 (ar, address, data);
@@ -1503,7 +1503,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) } ret =ath10k_pci_diag_write_mem (ar, pipe_cfg_targ_addr, - (u8 *) target_ce_config_wlan, + target_ce_config_wlan,sizeof (target_ce_config_wlan));if (ret !=0 ) {
@@ -1526,7 +1526,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) } ret =ath10k_pci_diag_write_mem (ar, svc_to_pipe_map, - (u8 *) target_service_to_ce_map_wlan, + target_service_to_ce_map_wlan,sizeof (target_service_to_ce_map_wlan));if (ret !=0 ) {ath10k_err ("Failed to write svc/pipe map: %d\n" , ret);
@@ -1545,7 +1545,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) ret =ath10k_pci_diag_write_mem (ar, pcie_state_targ_addr + offsetof(struct pcie_state , config_flags), - (u8 *) &pcie_config_flags, + &pcie_config_flags,sizeof (pcie_config_flags));if (ret !=0 ) {ath10k_err ("Failed to write pcie config_flags: %d\n" , ret);
Signature · 1 line
1.7.9.5
PATCH v2 4/6 ath10k: drop unnecessary else branch
In reply to Michal Kazior--- drivers/net/wireless/ath/ath10k/pci.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +11 -15
@@ -249,12 +249,11 @@ static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address, u32 *data/* Assume range doesn't cross this boundary */ if (address >=DRAM_BASE_ADDRESS )return ath10k_pci_diag_read_mem (ar, address, data,sizeof (u32)); -else { -ath10k_pci_wake (ar); - *data =ath10k_pci_read32 (ar, address); -ath10k_pci_sleep (ar); -return 0 ; - } + +ath10k_pci_wake (ar); + *data =ath10k_pci_read32 (ar, address); +ath10k_pci_sleep (ar); +return 0 ; } static int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
@@ -393,17 +392,14 @@ static int ath10k_pci_diag_write_access(struct ath10k *ar, u32 address, u32 data) {/* Assume range doesn't cross this boundary */ -if (address >=DRAM_BASE_ADDRESS ) { -u32 data_buf = data; -return ath10k_pci_diag_write_mem (ar, address, &data_buf, +if (address >=DRAM_BASE_ADDRESS ) +return ath10k_pci_diag_write_mem (ar, address, &data,sizeof (u32)); - }else { -ath10k_pci_wake (ar); -ath10k_pci_write32 (ar, address, data); -ath10k_pci_sleep (ar); -return 0 ; - } +ath10k_pci_wake (ar); +ath10k_pci_write32 (ar, address, data); +ath10k_pci_sleep (ar); +return 0 ; }static bool ath10k_pci_target_is_awake (struct ath10k *ar)
Signature · 1 line
1.7.9.5
PATCH v2 5/6 ath10k: drop unnecessary else branch
In reply to Michal Kaziorath10k_pci_{sleep,wake} do refcounting and the
awake sections can be nested.
--- drivers/net/wireless/ath/ath10k/pci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +2 -3
@@ -1650,7 +1650,6 @@ static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar)if (fw_indicator &FW_IND_EVENT_PENDING ) {/* ACK: clear Target-side pending event */ ath10k_pci_write32 (ar, fw_indicator_address, fw_indicator & ~FW_IND_EVENT_PENDING ); -ath10k_pci_sleep (ar);if (ar_pci->started)ath10k_pci_hif_dump_area (ar);
@@ -1661,9 +1660,9 @@ static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar)*/ ath10k_warn ("early firmware event indicated\n" ); } - }else { -ath10k_pci_sleep (ar); } + +ath10k_pci_sleep (ar); }static const struct ath10k_hif_ops ath10k_pci_hif_ops = {
Signature · 1 line
1.7.9.5
PATCH v2 6/6 ath10k: cleanup ath10k_pci_stop_intr()
In reply to Michal Kazior---
v2: fix loop by using max()
drivers/net/wireless/ath/ath10k/pci.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +7 -9
@@ -1937,18 +1937,16 @@ exit:static void ath10k_pci_stop_intr (struct ath10k *ar) { -int i;struct ath10k_pci *ar_pci =ath10k_pci_priv (ar); +int i; -if (ar_pci->num_msi_intrs >0 ) { -/* MSI interrupt(s) */ -for (i =0 ; i < ar_pci->num_msi_intrs; i++) -free_irq (ar_pci->pdev->irq + i, ar); - ar_pci->num_msi_intrs =0 ; +/* There's at least one interrupt irregardless whether its legacy INTR +* or MSI or MSI-X */ +for (i =0 ; i <max (1 , ar_pci->num_msi_intrs); i++) +free_irq (ar_pci->pdev->irq + i, ar); + +if (ar_pci->num_msi_intrs >0 )pci_disable_msi (ar_pci->pdev); - }else -/* Legacy PCI line interrupt */ -free_irq (ar_pci->pdev->irq, ar); }static int ath10k_pci_reset_target (struct ath10k *ar)
Signature · 1 line
1.7.9.5
v2 cover ath10k: coding style cleanup
In reply to Michal KaziorQuoted 9 lines · Michal Kazior
v2: fixed patch #6
Michal Kazior (6):
ath10k: fix code style and add comments to tx code
ath10k: tweakath10k_pci_diag_read_mem()prototype
ath10k: tweakath10k_pci_diag_write_mem()prototype
ath10k: drop unnecessary else branch
ath10k: drop unnecessary else branch
ath10k: cleanupath10k_pci_stop_intr()
Thanks, all applied.
Signature · 1 line
Kalle Valo