ath10k: checkpatch fixes from v3.17
cover ath10k: checkpatch fixes from v3.17
Hi,
some fixes to recently added checkpatch warnings. Please review.
Kalle
---
Kalle Valo (10):
ath10k: fix parenthesis alignment warning in ath10k_htt_rx_alloc()
ath10k: fix checkpatch warnings about parenthesis alignment
ath10k: fix use of multiple blank lines
ath10k: fix missing a blank line after declarations
ath10k: fix space after a cast style errors
ath10k: don't use return on void functions
ath10k: else is not generally useful after a break or return
ath10k: miscellaneous checkpatch fixes
ath10k: reformat help text in ath10k_read_simulate_fw_crash()
ath10k: use ether_addr_copy()
drivers/net/wireless/ath/ath10k/bmi.h | 1 drivers/net/wireless/ath/ath10k/ce.c | 2 - drivers/net/wireless/ath/ath10k/ce.h | 13 ++--- drivers/net/wireless/ath/ath10k/debug.c | 33 ++++++-------- drivers/net/wireless/ath/ath10k/hif.h | 1 drivers/net/wireless/ath/ath10k/htc.c | 10 +--- drivers/net/wireless/ath/ath10k/htc.h | 1 drivers/net/wireless/ath/ath10k/htt.c | 2 - drivers/net/wireless/ath/ath10k/htt.h | 3 - drivers/net/wireless/ath/ath10k/htt_rx.c | 52 +++++++++++---------- drivers/net/wireless/ath/ath10k/htt_tx.c | 2 - drivers/net/wireless/ath/ath10k/mac.c | 45 ++++++++---------- drivers/net/wireless/ath/ath10k/pci.c | 37 ++++++++------- drivers/net/wireless/ath/ath10k/rx_desc.h | 1 drivers/net/wireless/ath/ath10k/targaddrs.h | 1 drivers/net/wireless/ath/ath10k/txrx.c | 2 - drivers/net/wireless/ath/ath10k/wmi.c | 66 ++++++++++++++------------- drivers/net/wireless/ath/ath10k/wmi.h | 17 ++----- 18 files changed, 132 insertions(+), 157 deletions(-)
PATCH 1/10 ath10k: fix parenthesis alignment warning in ath10k_htt_rx_alloc()
Fixes checkpatch warning:
ath10k/htt_rx.c:519: CHECK: Alignment should match open parenthesis
--- drivers/net/wireless/ath/ath10k/htt_rx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +4 -3
@@ -488,6 +488,7 @@ int ath10k_htt_rx_alloc(struct ath10k_htt *htt)struct ath10k *ar = htt->ar;dma_addr_t paddr;void *vaddr; +size_t size;struct timer_list *timer = &htt->rx_ring.refill_retry_timer; htt->rx_ring.size =ath10k_htt_rx_ring_size (htt);
@@ -515,9 +516,9 @@ int ath10k_htt_rx_alloc(struct ath10k_htt *htt)if (!htt->rx_ring.netbufs_ring) goto err_netbuf; - vaddr =dma_alloc_coherent (htt->ar->dev, - (htt->rx_ring.size *sizeof (htt->rx_ring.paddrs_ring)), - &paddr,GFP_DMA ); + size = htt->rx_ring.size *sizeof (htt->rx_ring.paddrs_ring); + + vaddr =dma_alloc_coherent (htt->ar->dev, size, &paddr,GFP_DMA );if (!vaddr) goto err_dma_ring;
PATCH 2/10 ath10k: fix checkpatch warnings about parenthesis alignment
In reply to Kalle ValoCHECK: Alignment should match open parenthesis
--- drivers/net/wireless/ath/ath10k/ce.h | 10 +++++----- drivers/net/wireless/ath/ath10k/debug.c | 15 ++++++++------- drivers/net/wireless/ath/ath10k/htc.c | 2 +- drivers/net/wireless/ath/ath10k/htt.c | 2 +- drivers/net/wireless/ath/ath10k/htt_rx.c | 12 ++++++------ drivers/net/wireless/ath/ath10k/mac.c | 13 +++++++------ drivers/net/wireless/ath/ath10k/pci.c | 14 +++++++------- drivers/net/wireless/ath/ath10k/wmi.c | 30 ++++++++++++++++-------------- drivers/net/wireless/ath/ath10k/wmi.h | 8 ++++---- 9 files changed, 55 insertions(+), 51 deletions(-)
drivers/net/wireless/ath/ath10k/ce.h +5 -5
@@ -189,10 +189,10 @@ int ath10k_ce_completed_recv_next(struct ath10k_ce_pipe *ce_state,* Pops 1 completed send buffer from Source ring. */ int ath10k_ce_completed_send_next (struct ath10k_ce_pipe *ce_state, -void **per_transfer_contextp, -u32 *bufferp, -unsigned int *nbytesp, -unsigned int *transfer_idp); +void **per_transfer_contextp, +u32 *bufferp, +unsigned int *nbytesp, +unsigned int *transfer_idp);/*==================CE Engine Initialization=======================*/
@@ -202,7 +202,7 @@ int ath10k_ce_init_pipe(struct ath10k *ar, unsigned int ce_id, void (*recv_cb)(struct ath10k_ce_pipe *));void ath10k_ce_deinit_pipe (struct ath10k *ar,unsigned int ce_id);int ath10k_ce_alloc_pipe (struct ath10k *ar,int ce_id, -const struct ce_attr *attr); +const struct ce_attr *attr);void ath10k_ce_free_pipe (struct ath10k *ar,int ce_id);/*==================CE Engine Shutdown=======================*/
drivers/net/wireless/ath/ath10k/debug.c +8 -7
@@ -645,7 +645,8 @@ static ssize_t ath10k_write_simulate_fw_crash(struct file *file,* firmware variants in order to force a firmware crash. */ ret =ath10k_wmi_vdev_set_param (ar,0x7fff , - ar->wmi.vdev_param->rts_threshold,0 ); + ar->wmi.vdev_param->rts_threshold, +0 ); }else if (!strcmp (buf,"assert" )) {ath10k_info (ar,"simulating firmware assert crash\n" ); ret =ath10k_debug_fw_assert (ar);
@@ -867,8 +868,8 @@ static void ath10k_debug_htt_stats_dwork(struct work_struct *work) }static ssize_t ath10k_read_htt_stats_mask (struct file *file, -char __user *user_buf, -size_t count,loff_t *ppos) +char __user *user_buf, +size_t count,loff_t *ppos) {struct ath10k *ar = file->private_data;char buf[32 ];
@@ -880,8 +881,8 @@ static ssize_t ath10k_read_htt_stats_mask(struct file *file, }static ssize_t ath10k_write_htt_stats_mask (struct file *file, -const char __user *user_buf, -size_t count,loff_t *ppos) +const char __user *user_buf, +size_t count,loff_t *ppos) {struct ath10k *ar = file->private_data;unsigned long mask;
@@ -986,8 +987,8 @@ static const struct file_operations fops_htt_max_amsdu_ampdu = { };static ssize_t ath10k_read_fw_dbglog (struct file *file, -char __user *user_buf, -size_t count,loff_t *ppos) +char __user *user_buf, +size_t count,loff_t *ppos) {struct ath10k *ar = file->private_data;unsigned int len;
drivers/net/wireless/ath/ath10k/htc.c +1 -1
@@ -569,7 +569,7 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc)ath10k_hif_send_complete_check (htc->ar, i,1 ); status =wait_for_completion_timeout (&htc->ctl_resp, -ATH10K_HTC_WAIT_TIMEOUT_HZ ); +ATH10K_HTC_WAIT_TIMEOUT_HZ );if (status ==0 ) status = -ETIMEDOUT ;
drivers/net/wireless/ath/ath10k/htt.c +1 -1
@@ -101,7 +101,7 @@ int ath10k_htt_setup(struct ath10k_htt *htt)return status; status =wait_for_completion_timeout (&htt->target_version_received, -HTT_TARGET_VERSION_TIMEOUT_HZ ); +HTT_TARGET_VERSION_TIMEOUT_HZ );if (status <=0 ) {ath10k_warn (ar,"htt version request timed out\n" );return -ETIMEDOUT ;
drivers/net/wireless/ath/ath10k/htt_rx.c +6 -6
@@ -626,7 +626,7 @@ static struct ieee80211_hdr *ath10k_htt_rx_skb_get_hdr(struct sk_buff *skb) rxd = (void *)skb->data -sizeof (*rxd); fmt =MS (__le32_to_cpu (rxd->msdu_start.info1), -RX_MSDU_START_INFO1_DECAP_FORMAT ); +RX_MSDU_START_INFO1_DECAP_FORMAT );if (fmt ==RX_MSDU_DECAP_RAW )return (void *)skb->data;
@@ -915,7 +915,7 @@ static void ath10k_htt_rx_amsdu(struct ath10k_htt *htt, rxd = (void *)skb->data -sizeof (*rxd); enctype =MS (__le32_to_cpu (rxd->mpdu_start.info0), -RX_MPDU_START_INFO0_ENCRYPT_TYPE ); +RX_MPDU_START_INFO0_ENCRYPT_TYPE ); hdr = (struct ieee80211_hdr *)rxd->rx_hdr_status; hdr_len =ieee80211_hdrlen (hdr->frame_control);
@@ -1030,9 +1030,9 @@ static void ath10k_htt_rx_msdu(struct ath10k_htt *htt, rxd = (void *)skb->data -sizeof (*rxd); fmt =MS (__le32_to_cpu (rxd->msdu_start.info1), -RX_MSDU_START_INFO1_DECAP_FORMAT ); +RX_MSDU_START_INFO1_DECAP_FORMAT ); enctype =MS (__le32_to_cpu (rxd->mpdu_start.info0), -RX_MPDU_START_INFO0_ENCRYPT_TYPE ); +RX_MPDU_START_INFO0_ENCRYPT_TYPE ); hdr = (struct ieee80211_hdr *)rxd->rx_hdr_status; hdr_len =ieee80211_hdrlen (hdr->frame_control);
@@ -1333,7 +1333,7 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt, }static void ath10k_htt_rx_frag_handler (struct ath10k_htt *htt, -struct htt_rx_fragment_indication *frag) +struct htt_rx_fragment_indication *frag) {struct ath10k *ar = htt->ar;struct sk_buff *msdu_head, *msdu_tail;
@@ -1379,7 +1379,7 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt, tkip_mic_err = !!(attention &RX_ATTENTION_FLAGS_TKIP_MIC_ERR ); decrypt_err = !!(attention &RX_ATTENTION_FLAGS_DECRYPT_ERR ); fmt =MS (__le32_to_cpu (rxd->msdu_start.info1), -RX_MSDU_START_INFO1_DECAP_FORMAT ); +RX_MSDU_START_INFO1_DECAP_FORMAT );if (fmt !=RX_MSDU_DECAP_RAW ) {ath10k_warn (ar,"we dont support non-raw fragmented rx yet\n" );
drivers/net/wireless/ath/ath10k/mac.c +7 -6
@@ -896,7 +896,7 @@ static int ath10k_vdev_stop(struct ath10k_vif *arvif) }static void ath10k_control_beaconing (struct ath10k_vif *arvif, -struct ieee80211_bss_conf *info) +struct ieee80211_bss_conf *info) {struct ath10k *ar = arvif->ar;int ret =0 ;
@@ -1106,9 +1106,9 @@ static void ath10k_peer_assoc_h_crypto(struct ath10k *ar, ies =rcu_dereference (bss->ies); wpaie =cfg80211_find_vendor_ie (WLAN_OUI_MICROSOFT , -WLAN_OUI_TYPE_MICROSOFT_WPA , - ies->data, - ies->len); +WLAN_OUI_TYPE_MICROSOFT_WPA , + ies->data, + ies->len);rcu_read_unlock ();cfg80211_put_bss (ar->hw->wiphy, bss); }
@@ -1291,7 +1291,8 @@ static int ath10k_peer_assoc_qos_ap(struct ath10k *ar,sta->listen_interval - mac80211 patch required. Currently use 10 seconds */ ret =ath10k_wmi_set_ap_ps_param (ar, arvif->vdev_id, sta->addr, -WMI_AP_PS_PEER_PARAM_AGEOUT_TIME ,10 ); +WMI_AP_PS_PEER_PARAM_AGEOUT_TIME , +10 );if (ret) {ath10k_warn (ar,"failed to set ap ps peer param ageout time for vdev %i: %d\n" , arvif->vdev_id, ret);
@@ -3568,7 +3569,7 @@ exit: }static int ath10k_conf_tx_uapsd (struct ath10k *ar,struct ieee80211_vif *vif, -u16 ac,bool enable) +u16 ac,bool enable) {struct ath10k_vif *arvif =ath10k_vif_to_arvif (vif);u32 value =0 ;
drivers/net/wireless/ath/ath10k/pci.c +7 -7
@@ -527,7 +527,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data, address); ret =ath10k_ce_send (ce_diag,NULL , (u32 )address, nbytes,0 , -0 ); +0 );if (ret) goto done;
@@ -1106,7 +1106,7 @@ static int ath10k_pci_hif_map_service_to_pipe(struct ath10k *ar, }static void ath10k_pci_hif_get_default_pipe (struct ath10k *ar, -u8 *ul_pipe,u8 *dl_pipe) +u8 *ul_pipe,u8 *dl_pipe) {int ul_is_polled, dl_is_polled;
@@ -1476,8 +1476,8 @@ static int ath10k_pci_init_config(struct ath10k *ar) } ret =ath10k_pci_diag_write_mem (ar, pipe_cfg_targ_addr, - target_ce_config_wlan, -sizeof (target_ce_config_wlan)); + target_ce_config_wlan, +sizeof (target_ce_config_wlan));if (ret !=0 ) {ath10k_err (ar,"Failed to write pipe cfg: %d\n" , ret);
@@ -1500,8 +1500,8 @@ static int ath10k_pci_init_config(struct ath10k *ar) } ret =ath10k_pci_diag_write_mem (ar, svc_to_pipe_map, - target_service_to_ce_map_wlan, -sizeof (target_service_to_ce_map_wlan)); + target_service_to_ce_map_wlan, +sizeof (target_service_to_ce_map_wlan));if (ret !=0 ) {ath10k_err (ar,"Failed to write svc/pipe map: %d\n" , ret);return ret;
@@ -2160,7 +2160,7 @@ static int ath10k_pci_init_irq(struct ath10k *ar)if (ath10k_pci_irq_mode ==ATH10K_PCI_IRQ_AUTO ) { ar_pci->num_msi_intrs =MSI_NUM_REQUEST ; ret =pci_enable_msi_range (ar_pci->pdev, ar_pci->num_msi_intrs, - ar_pci->num_msi_intrs); + ar_pci->num_msi_intrs);if (ret >0 )return 0 ;
drivers/net/wireless/ath/ath10k/wmi.c +16 -14
@@ -1859,9 +1859,10 @@ static void ath10k_wmi_event_dfs(struct ath10k *ar, } } -static void ath10k_wmi_event_spectral_scan (struct ath10k *ar, -struct wmi_single_phyerr_rx_event *event, -u64 tsf) +static void +ath10k_wmi_event_spectral_scan (struct ath10k *ar, +struct wmi_single_phyerr_rx_event *event, +u64 tsf) {int buf_len, tlv_len, res, i =0 ;struct phyerr_tlv *tlv;
@@ -1989,7 +1990,7 @@ static void ath10k_wmi_event_roam(struct ath10k *ar, struct sk_buff *skb) }static void ath10k_wmi_event_profile_match (struct ath10k *ar, -struct sk_buff *skb) +struct sk_buff *skb) {ath10k_dbg (ar,ATH10K_DBG_WMI ,"WMI_PROFILE_MATCH\n" ); }
@@ -2040,13 +2041,13 @@ static void ath10k_wmi_event_wlan_profile_data(struct ath10k *ar, }static void ath10k_wmi_event_rtt_measurement_report (struct ath10k *ar, -struct sk_buff *skb) +struct sk_buff *skb) {ath10k_dbg (ar,ATH10K_DBG_WMI ,"WMI_RTT_MEASUREMENT_REPORT_EVENTID\n" ); }static void ath10k_wmi_event_tsf_measurement_report (struct ath10k *ar, -struct sk_buff *skb) +struct sk_buff *skb) {ath10k_dbg (ar,ATH10K_DBG_WMI ,"WMI_TSF_MEASUREMENT_REPORT_EVENTID\n" ); }
@@ -2082,7 +2083,7 @@ static void ath10k_wmi_event_pdev_ftm_intg(struct ath10k *ar, }static void ath10k_wmi_event_gtk_offload_status (struct ath10k *ar, -struct sk_buff *skb) +struct sk_buff *skb) {ath10k_dbg (ar,ATH10K_DBG_WMI ,"WMI_GTK_OFFLOAD_STATUS_EVENTID\n" ); }
@@ -2106,7 +2107,7 @@ static void ath10k_wmi_event_addba_complete(struct ath10k *ar, }static void ath10k_wmi_event_vdev_install_key_complete (struct ath10k *ar, -struct sk_buff *skb) +struct sk_buff *skb) {ath10k_dbg (ar,ATH10K_DBG_WMI ,"WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID\n" ); }
@@ -2130,7 +2131,7 @@ static void ath10k_wmi_event_vdev_resume_req(struct ath10k *ar, }static int ath10k_wmi_alloc_host_mem (struct ath10k *ar,u32 req_id, -u32 num_units,u32 unit_len) +u32 num_units,u32 unit_len) {dma_addr_t paddr;u32 pool_size;
@@ -3520,9 +3521,10 @@ int ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id)return ath10k_wmi_cmd_send (ar, skb, ar->wmi.cmd->vdev_delete_cmdid); } -static int ath10k_wmi_vdev_start_restart (struct ath10k *ar, -const struct wmi_vdev_start_request_arg *arg, -u32 cmd_id) +static int +ath10k_wmi_vdev_start_restart (struct ath10k *ar, +const struct wmi_vdev_start_request_arg *arg, +u32 cmd_id) {struct wmi_vdev_start_request_cmd *cmd;struct sk_buff *skb;
@@ -3603,7 +3605,7 @@ int ath10k_wmi_vdev_start(struct ath10k *ar, }int ath10k_wmi_vdev_restart (struct ath10k *ar, -const struct wmi_vdev_start_request_arg *arg) +const struct wmi_vdev_start_request_arg *arg) {u32 cmd_id = ar->wmi.cmd->vdev_restart_request_cmdid;
@@ -4172,7 +4174,7 @@ static void ath10k_wmi_pdev_set_wmm_param(struct wmi_wmm_params *params, }int ath10k_wmi_pdev_set_wmm_params (struct ath10k *ar, -const struct wmi_pdev_set_wmm_params_arg *arg) +const struct wmi_pdev_set_wmm_params_arg *arg) {struct wmi_pdev_set_wmm_params *cmd;struct sk_buff *skb;
drivers/net/wireless/ath/ath10k/wmi.h +4 -4
@@ -4776,11 +4776,11 @@ int ath10k_wmi_vdev_spectral_conf(struct ath10k *ar,int ath10k_wmi_vdev_spectral_enable (struct ath10k *ar,u32 vdev_id,u32 trigger,u32 enable);int ath10k_wmi_peer_create (struct ath10k *ar,u32 vdev_id, -const u8 peer_addr[ETH_ALEN ]); +const u8 peer_addr[ETH_ALEN ]);int ath10k_wmi_peer_delete (struct ath10k *ar,u32 vdev_id, -const u8 peer_addr[ETH_ALEN ]); +const u8 peer_addr[ETH_ALEN ]);int ath10k_wmi_peer_flush (struct ath10k *ar,u32 vdev_id, -const u8 peer_addr[ETH_ALEN ],u32 tid_bitmap); +const u8 peer_addr[ETH_ALEN ],u32 tid_bitmap);int ath10k_wmi_peer_set_param (struct ath10k *ar,u32 vdev_id,const u8 *peer_addr,enum wmi_peer_param param_id,u32 param_value);
@@ -4797,7 +4797,7 @@ int ath10k_wmi_scan_chan_list(struct ath10k *ar, const struct wmi_scan_chan_list_arg *arg);int ath10k_wmi_beacon_send_ref_nowait (struct ath10k_vif *arvif);int ath10k_wmi_pdev_set_wmm_params (struct ath10k *ar, -const struct wmi_pdev_set_wmm_params_arg *arg); +const struct wmi_pdev_set_wmm_params_arg *arg);int ath10k_wmi_request_stats (struct ath10k *ar,enum wmi_stats_id stats_id);int ath10k_wmi_force_fw_hang (struct ath10k *ar,enum wmi_force_fw_hang_type type,u32 delay_ms);
PATCH 3/10 ath10k: fix use of multiple blank lines
In reply to Kalle ValoFixes checkpatch warnings:
CHECK: Please don't use multiple blank lines
--- drivers/net/wireless/ath/ath10k/bmi.h | 1 - drivers/net/wireless/ath/ath10k/ce.c | 2 -- drivers/net/wireless/ath/ath10k/ce.h | 3 --- drivers/net/wireless/ath/ath10k/hif.h | 1 - drivers/net/wireless/ath/ath10k/htc.h | 1 - drivers/net/wireless/ath/ath10k/htt.h | 2 -- drivers/net/wireless/ath/ath10k/htt_rx.c | 1 - drivers/net/wireless/ath/ath10k/htt_tx.c | 1 - drivers/net/wireless/ath/ath10k/mac.c | 4 ---- drivers/net/wireless/ath/ath10k/rx_desc.h | 1 - drivers/net/wireless/ath/ath10k/targaddrs.h | 1 - drivers/net/wireless/ath/ath10k/wmi.c | 2 -- drivers/net/wireless/ath/ath10k/wmi.h | 9 --------- 13 files changed, 29 deletions(-)
drivers/net/wireless/ath/ath10k/bmi.h +0 -1
@@ -177,7 +177,6 @@ struct bmi_target_info {u32 type; }; -/* in msec */ #define BMI_COMMUNICATION_TIMEOUT_HZ (1*HZ)
drivers/net/wireless/ath/ath10k/ce.c +0 -2
@@ -260,7 +260,6 @@ static inline void ath10k_ce_engine_int_status_clear(struct ath10k *ar,ath10k_pci_write32 (ar, ce_ctrl_addr +HOST_IS_ADDRESS , mask); } -/* * Guts of ath10k_ce_send, used by both ath10k_ce_send and * ath10k_ce_sendlist_send.
@@ -385,7 +384,6 @@ int ath10k_ce_num_free_src_entries(struct ath10k_ce_pipe *pipe)return delta; } -int __ath10k_ce_rx_num_free_bufs (struct ath10k_ce_pipe *pipe) {struct ath10k *ar = pipe->ar;
drivers/net/wireless/ath/ath10k/ce.h +0 -3
@@ -20,7 +20,6 @@#include "hif.h" -/* Maximum number of Copy Engine's supported */ #define CE_COUNT_MAX 8#define CE_HTT_H2T_MSG_SRC_NENTRIES 4096
@@ -37,7 +36,6 @@struct ath10k_ce_pipe ; -#define CE_DESC_FLAGS_GATHER (1 << 0)#define CE_DESC_FLAGS_BYTE_SWAP (1 << 1)#define CE_DESC_FLAGS_META_DATA_MASK 0xFFFC
@@ -383,7 +381,6 @@ struct ce_attr {#define DST_WATERMARK_HIGH_RESET 0#define DST_WATERMARK_ADDRESS 0x0050 -static inline u32 ath10k_ce_base_address (unsigned int ce_id) {return CE0_BASE_ADDRESS + (CE1_BASE_ADDRESS -CE0_BASE_ADDRESS ) * ce_id;
drivers/net/wireless/ath/ath10k/hif.h +0 -1
@@ -91,7 +91,6 @@ struct ath10k_hif_ops {int (*resume)(struct ath10k *ar); }; -static inline int ath10k_hif_tx_sg (struct ath10k *ar,u8 pipe_id,struct ath10k_hif_sg_item *items,int n_items)
drivers/net/wireless/ath/ath10k/htc.h +0 -1
@@ -214,7 +214,6 @@ struct ath10k_htc_frame {struct ath10k_htc_record trailer[0 ]; } __packed__aligned(4) ; -/*******************/ /* Host-side stuff */ /*******************/
drivers/net/wireless/ath/ath10k/htt.h +0 -2
@@ -265,7 +265,6 @@ enum htt_mgmt_tx_status {/*=== target -> host messages ===============================================*/ -enum htt_t2h_msg_type {HTT_T2H_MSG_TYPE_VERSION_CONF =0x0 ,HTT_T2H_MSG_TYPE_RX_IND =0x1 ,
@@ -1148,7 +1147,6 @@ struct htt_resp { }; } __packed; -/*** host side structures follow ***/ struct htt_tx_done {
drivers/net/wireless/ath/ath10k/htt_rx.c +0 -1
@@ -42,7 +42,6 @@/* when under memory pressure rx ring refill may fail and needs a retry */ #define HTT_RX_RING_REFILL_RETRY_MS 50 -static int ath10k_htt_rx_get_csum_state (struct sk_buff *skb);static void ath10k_htt_txrx_compl_task (unsigned long ptr);
drivers/net/wireless/ath/ath10k/htt_tx.c +0 -1
@@ -377,7 +377,6 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)int msdu_id =-1 ;int res; - res =ath10k_htt_tx_inc_pending (htt);if (res) goto err;
drivers/net/wireless/ath/ath10k/mac.c +0 -4
@@ -225,7 +225,6 @@ static int ath10k_clear_vdev_key(struct ath10k_vif *arvif,return first_errno; } -/*********************/ /* General utilities */ /*********************/
@@ -1262,7 +1261,6 @@ static int ath10k_peer_assoc_qos_ap(struct ath10k *ar, uapsd |=WMI_AP_PS_UAPSD_AC0_DELIVERY_EN |WMI_AP_PS_UAPSD_AC0_TRIGGER_EN ; -if (sta->max_sp <MAX_WMI_AP_PS_PEER_PARAM_MAX_SP ) max_sp = sta->max_sp;
@@ -1316,7 +1314,6 @@ static void ath10k_peer_assoc_h_vht(struct ath10k *ar, arg->peer_flags |=WMI_PEER_VHT ; arg->peer_vht_caps = vht_cap->cap; - ampdu_factor = (vht_cap->cap &IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK ) >>IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT ;
@@ -4715,7 +4712,6 @@ static struct ieee80211_sta_ht_cap ath10k_get_ht_cap(struct ath10k *ar)return ht_cap; } -static void ath10k_get_arvif_iter (void *data,u8 *mac,struct ieee80211_vif *vif) {
drivers/net/wireless/ath/ath10k/rx_desc.h +0 -1
@@ -839,7 +839,6 @@ struct rx_ppdu_start {* Reserved: HW should fill with 0, FW should ignore. */ -#define RX_PPDU_END_FLAGS_PHY_ERR (1 << 0)#define RX_PPDU_END_FLAGS_RX_LOCATION (1 << 1)#define RX_PPDU_END_FLAGS_TXBF_H_INFO (1 << 2)
drivers/net/wireless/ath/ath10k/targaddrs.h +0 -1
@@ -284,7 +284,6 @@ Fw Mode/SubMode Mask#define HI_OPTION_ALL_FW_SUBMODE_MASK 0xFF00#define HI_OPTION_ALL_FW_SUBMODE_SHIFT 0x8 -/* hi_option_flag2 options */ #define HI_OPTION_OFFLOAD_AMSDU 0x01#define HI_OPTION_DFS_SUPPORT 0x02/* Enable DFS support */
drivers/net/wireless/ath/ath10k/wmi.c +0 -2
@@ -1511,7 +1511,6 @@ static u32 ath10k_p2p_calc_noa_ie_len(struct wmi_p2p_noa_info *noa)u8 opp_ps_info = noa->ctwindow_oppps;bool opps_enabled = !!(opp_ps_info &WMI_P2P_OPPPS_ENABLE_BIT ); -if (!noa_descriptors && !opps_enabled)return len;
@@ -1568,7 +1567,6 @@ cleanup:kfree (old_data); } -static void ath10k_wmi_event_host_swba (struct ath10k *ar,struct sk_buff *skb) {struct wmi_host_swba_event *ev;
drivers/net/wireless/ath/ath10k/wmi.h +0 -9
@@ -1269,7 +1269,6 @@ enum wmi_channel_change_cause {WMI_HT_CAP_RX_STBC | \ WMI_HT_CAP_LDPC) -/* * WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information * field. The fields not defined here are not supported, or reserved.
@@ -1471,7 +1470,6 @@ struct wmi_service_ready_event_10x {struct wlan_host_mem_req mem_reqs[1 ]; } __packed; -#define WMI_SERVICE_READY_TIMEOUT_HZ (5*HZ)#define WMI_UNIFIED_READY_TIMEOUT_HZ (5*HZ)
@@ -2125,7 +2123,6 @@ struct wmi_start_scan_cmd_10x {*/ } __packed; -struct wmi_ssid_arg {int len;const u8 *ssid;
@@ -2186,7 +2183,6 @@ struct wmi_start_scan_arg {/* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */ #define WMI_SCAN_CLASS_MASK 0xFF000000 -enum wmi_stop_scan_type {WMI_SCAN_STOP_ONE =0x00000000 ,/* stop by scan_id */ WMI_SCAN_STOP_VDEV_ALL =0x01000000 ,/* stop by vdev_id */
@@ -2371,7 +2367,6 @@ struct wmi_single_phyerr_rx_hdr {__le32 nf_list_1;__le32 nf_list_2; -/* Length of the frame */ __le32 buf_len; } __packed;
@@ -2473,7 +2468,6 @@ struct phyerr_fft_report {#define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_MASK 0x000000FF#define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_LSB 0 -struct phyerr_tlv {__le16 len;u8 tag;
@@ -2504,7 +2498,6 @@ struct wmi_echo_cmd {__le32 value; } __packed; -struct wmi_pdev_set_regdomain_cmd {__le32 reg_domain;__le32 reg_domain_2G;
@@ -2553,7 +2546,6 @@ struct wmi_pdev_set_quiet_cmd {__le32 enabled; } __packed; -/* * 802.11g protection mode. */
@@ -4291,7 +4283,6 @@ struct wmi_tbtt_offset_event {__le32 tbttoffset_list[WMI_MAX_AP_VDEV ]; } __packed; -struct wmi_peer_create_cmd {__le32 vdev_id;struct wmi_mac_addr peer_macaddr;
PATCH 4/10 ath10k: fix missing a blank line after declarations
In reply to Kalle ValoFixes checkpatch warnings:
WARNING: Missing a blank line after declarations
Please note that some of the cases I fixed by moving the variable declarations to the beginning of the function, which is the preferred style in ath10k.
--- drivers/net/wireless/ath/ath10k/htt_rx.c | 10 +++++++--- drivers/net/wireless/ath/ath10k/mac.c | 6 ++---- drivers/net/wireless/ath/ath10k/wmi.c | 8 ++++++-- 3 files changed, 15 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +7 -3
@@ -222,6 +222,7 @@ static void ath10k_htt_rx_msdu_buff_replenish(struct ath10k_htt *htt)static void ath10k_htt_rx_ring_refill_retry (unsigned long arg) {struct ath10k_htt *htt = (struct ath10k_htt *)arg; +ath10k_htt_rx_msdu_buff_replenish (htt); }
@@ -313,7 +314,7 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt, {struct ath10k *ar = htt->ar;int msdu_len, msdu_chaining =0 ; -struct sk_buff *msdu; +struct sk_buff *msdu, *next;struct htt_rx_desc *rx_desc;lockdep_assert_held (&htt->rx_ring.lock);
@@ -450,7 +451,7 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt, msdu->next =NULL ;break ; }else { -struct sk_buff *next =ath10k_htt_rx_netbuf_pop (htt); + next =ath10k_htt_rx_netbuf_pop (htt); msdu->next = next; msdu = next; }
@@ -479,6 +480,7 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt,static void ath10k_htt_rx_replenish_task (unsigned long ptr) {struct ath10k_htt *htt = (struct ath10k_htt *)ptr; +ath10k_htt_rx_msdu_buff_replenish (htt); }
@@ -636,8 +638,10 @@ static struct ieee80211_hdr *ath10k_htt_rx_skb_get_hdr(struct sk_buff *skb)/* This function only applies for first msdu in an msdu chain */ static bool ath10k_htt_rx_hdr_is_amsdu (struct ieee80211_hdr *hdr) { +u8 *qc; +if (ieee80211_is_data_qos (hdr->frame_control)) { -u8 *qc =ieee80211_get_qos_ctl (hdr); + qc =ieee80211_get_qos_ctl (hdr);if (qc[0 ] &0x80 )return true; }
drivers/net/wireless/ath/ath10k/mac.c +2 -4
@@ -1157,6 +1157,7 @@ static void ath10k_peer_assoc_h_ht(struct ath10k *ar, {const struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;int i, n; +u32 stbc;lockdep_assert_held (&ar->conf_mutex);
@@ -1193,7 +1194,6 @@ static void ath10k_peer_assoc_h_ht(struct ath10k *ar, }if (ht_cap->cap &IEEE80211_HT_CAP_RX_STBC ) { -u32 stbc; stbc = ht_cap->cap &IEEE80211_HT_CAP_RX_STBC ; stbc = stbc >>IEEE80211_HT_CAP_RX_STBC_SHIFT ; stbc = stbc <<WMI_RC_RX_STBC_FLAG_S ;
@@ -3011,7 +3011,7 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,struct ath10k *ar = hw->priv;struct ath10k_vif *arvif =ath10k_vif_to_arvif (vif);int ret =0 ; -u32 vdev_param, pdev_param; +u32 vdev_param, pdev_param, slottime, preamble;mutex_lock (&ar->conf_mutex);
@@ -3132,7 +3132,6 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, }if (changed &BSS_CHANGED_ERP_SLOT ) { -u32 slottime;if (info->use_short_slot) slottime =WMI_VDEV_SLOT_TIME_SHORT ;/* 9us */
@@ -3151,7 +3150,6 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, }if (changed &BSS_CHANGED_ERP_PREAMBLE ) { -u32 preamble;if (info->use_short_preamble) preamble =WMI_VDEV_PREAMBLE_SHORT ;else
drivers/net/wireless/ath/ath10k/wmi.c +6 -2
@@ -612,6 +612,7 @@ static struct wmi_cmd_map wmi_10_2_cmd_map = {int ath10k_wmi_wait_for_service_ready (struct ath10k *ar) {int ret; + ret =wait_for_completion_timeout (&ar->wmi.service_ready,WMI_SERVICE_READY_TIMEOUT_HZ );return ret;
@@ -620,6 +621,7 @@ int ath10k_wmi_wait_for_service_ready(struct ath10k *ar)int ath10k_wmi_wait_for_unified_ready (struct ath10k *ar) {int ret; + ret =wait_for_completion_timeout (&ar->wmi.unified_ready,WMI_UNIFIED_READY_TIMEOUT_HZ );return ret;
@@ -1384,6 +1386,8 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,struct ieee80211_tim_ie *tim;u8 *ies, *ie;u8 ie_len, pvm_len; +__le32 t; +u32 v;/* if next SWBA has no tim_changed the tim_bitmap is garbage. * we must copy the bitmap upon change and reuse it later */
@@ -1394,8 +1398,8 @@ static void ath10k_wmi_update_tim(struct ath10k *ar, sizeof(bcn_info->tim_info.tim_bitmap));for (i =0 ; i <sizeof (arvif->u.ap.tim_bitmap); i++) { -__le32 t = bcn_info->tim_info.tim_bitmap[i /4 ]; -u32 v =__le32_to_cpu (t); + t = bcn_info->tim_info.tim_bitmap[i /4 ]; + v =__le32_to_cpu (t); arvif->u.ap.tim_bitmap[i] = (v >> ((i %4 ) *8 )) &0xFF ; }
PATCH 5/10 ath10k: fix space after a cast style errors
In reply to Kalle ValoFixes checkpatch warnings:
CHECK: No space is necessary after a cast
--- drivers/net/wireless/ath/ath10k/pci.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +7 -7
@@ -340,8 +340,8 @@ static void ath10k_pci_disable_and_clear_legacy_irq(struct ath10k *ar)/* IMPORTANT: this extra read transaction is required to * flush the posted write buffer. */ - (void )ath10k_pci_read32 (ar,SOC_CORE_BASE_ADDRESS + -PCIE_INTR_ENABLE_ADDRESS ); + (void )ath10k_pci_read32 (ar,SOC_CORE_BASE_ADDRESS + +PCIE_INTR_ENABLE_ADDRESS ); }static void ath10k_pci_enable_legacy_irq (struct ath10k *ar)
@@ -352,8 +352,8 @@ static void ath10k_pci_enable_legacy_irq(struct ath10k *ar)/* IMPORTANT: this extra read transaction is required to * flush the posted write buffer. */ - (void )ath10k_pci_read32 (ar,SOC_CORE_BASE_ADDRESS + -PCIE_INTR_ENABLE_ADDRESS ); + (void )ath10k_pci_read32 (ar,SOC_CORE_BASE_ADDRESS + +PCIE_INTR_ENABLE_ADDRESS ); }static inline const char *ath10k_pci_get_irq_method (struct ath10k *ar)
@@ -547,7 +547,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data, goto done; } -if (buf != (u32 ) address) { +if (buf != (u32 )address) { ret = -EIO ; goto done; }
@@ -695,7 +695,7 @@ static int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,* Request CE to send caller-supplied data that * was copied to bounce buffer to Target(!) address. */ - ret =ath10k_ce_send (ce_diag,NULL , (u32 ) ce_data, + ret =ath10k_ce_send (ce_diag,NULL , (u32 )ce_data, nbytes,0 ,0 );if (ret !=0 ) goto done;
@@ -1624,7 +1624,7 @@ static int ath10k_pci_ce_init(struct ath10k *ar)continue ; } - pipe_info->buf_sz = (size_t ) (attr->src_sz_max); + pipe_info->buf_sz = (size_t )(attr->src_sz_max); }return 0 ;
PATCH 6/10 ath10k: don't use return on void functions
In reply to Kalle ValoFixes a checkpatch warning:
WARNING: void function return statements are not generally useful
--- drivers/net/wireless/ath/ath10k/htt_tx.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireless/ath/ath10k/htt_tx.c +0 -1
@@ -154,7 +154,6 @@ void ath10k_htt_tx_free(struct ath10k_htt *htt)kfree (htt->pending_tx);kfree (htt->used_msdu_ids);dma_pool_destroy (htt->tx_pool); -return ; }void ath10k_htt_htc_tx_complete (struct ath10k *ar,struct sk_buff *skb)
PATCH 7/10 ath10k: else is not generally useful after a break or return
In reply to Kalle ValoFixes checkpatch warnings:
WARNING: else is not generally useful after a break or return
--- drivers/net/wireless/ath/ath10k/debug.c | 4 ++-- drivers/net/wireless/ath/ath10k/htt_rx.c | 12 ++++++------ drivers/net/wireless/ath/ath10k/mac.c | 12 ++++++------ drivers/net/wireless/ath/ath10k/pci.c | 7 ++++--- 4 files changed, 18 insertions(+), 17 deletions(-)
drivers/net/wireless/ath/ath10k/debug.c +2 -2
@@ -1180,8 +1180,8 @@ int ath10k_debug_register(struct ath10k *ar)if (IS_ERR_OR_NULL (ar->debug.debugfs_phy)) {if (IS_ERR (ar->debug.debugfs_phy))return PTR_ERR (ar->debug.debugfs_phy); -else -return -ENOMEM ; + +return -ENOMEM ; } INIT_DELAYED_WORK(&ar->debug.htt_stats_dwork,
drivers/net/wireless/ath/ath10k/htt_rx.c +6 -6
@@ -450,11 +450,11 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt,if (last_msdu) { msdu->next =NULL ;break ; - }else { - next =ath10k_htt_rx_netbuf_pop (htt); - msdu->next = next; - msdu = next; } + + next =ath10k_htt_rx_netbuf_pop (htt); + msdu->next = next; + msdu = next; } *tail_msdu = msdu;
@@ -631,8 +631,8 @@ static struct ieee80211_hdr *ath10k_htt_rx_skb_get_hdr(struct sk_buff *skb)if (fmt ==RX_MSDU_DECAP_RAW )return (void *)skb->data; -else -return (void *)skb->data -RX_HTT_HDR_STATUS_LEN ; + +return (void *)skb->data -RX_HTT_HDR_STATUS_LEN ; }/* This function only applies for first msdu in an msdu chain */
drivers/net/wireless/ath/ath10k/mac.c +6 -6
@@ -698,8 +698,8 @@ static int ath10k_monitor_recalc(struct ath10k *ar)if (should_start)return ath10k_monitor_start (ar); -else -return ath10k_monitor_stop (ar); + +return ath10k_monitor_stop (ar); }static int ath10k_recalc_rtscts_prot (struct ath10k_vif *arvif)
@@ -4065,8 +4065,8 @@ ath10k_bitrate_mask_nss(const struct cfg80211_bitrate_mask *mask,continue ; else if (mask->control[band].ht_mcs[i] == 0x00) break; - else - return false; + +return false; } ht_nss = i;
@@ -4077,8 +4077,8 @@ ath10k_bitrate_mask_nss(const struct cfg80211_bitrate_mask *mask,continue ; else if (mask->control[band].vht_mcs[i] == 0x0000) break; - else - return false; + +return false; } vht_nss = i;
drivers/net/wireless/ath/ath10k/pci.c +4 -3
@@ -362,10 +362,11 @@ static inline const char *ath10k_pci_get_irq_method(struct ath10k *ar)if (ar_pci->num_msi_intrs >1 )return "msi-x" ; -else if (ar_pci->num_msi_intrs ==1 ) + +if (ar_pci->num_msi_intrs ==1 )return "msi" ; -else -return "legacy" ; + +return "legacy" ; }static int __ath10k_pci_rx_post_buf (struct ath10k_pci_pipe *pipe)
PATCH 8/10 ath10k: miscellaneous checkpatch fixes
In reply to Kalle ValoFixes checkpatch warnings:
ath10k/htc.c:49: WARNING: Possible unnecessary 'out of memory' message ath10k/htc.c:810: WARNING: Possible unnecessary 'out of memory' message ath10k/htt.h:1034: CHECK: Please use a blank line after function/struct/union/enum declarations ath10k/htt_rx.c:135: CHECK: Unnecessary parentheses around htt->rx_ring.alloc_idx.vaddr ath10k/htt_rx.c:173: CHECK: Unnecessary parentheses around htt->rx_ring.alloc_idx.vaddr ath10k/pci.c:633: WARNING: macros should not use a trailing semicolon ath10k/wmi.c:3594: WARNING: quoted string split across lines
--- drivers/net/wireless/ath/ath10k/htc.c | 8 ++------ drivers/net/wireless/ath/ath10k/htt.h | 1 + drivers/net/wireless/ath/ath10k/htt_rx.c | 4 ++-- drivers/net/wireless/ath/ath10k/pci.c | 2 +- drivers/net/wireless/ath/ath10k/wmi.c | 4 ++-- 5 files changed, 8 insertions(+), 11 deletions(-)
drivers/net/wireless/ath/ath10k/htc.c +2 -6
@@ -45,10 +45,8 @@ static struct sk_buff *ath10k_htc_build_tx_ctrl_skb(void *ar)struct ath10k_skb_cb *skb_cb; skb =dev_alloc_skb (ATH10K_HTC_CONTROL_BUFFER_SIZE ); -if (!skb) { -ath10k_warn (ar,"Unable to allocate ctrl skb\n" ); +if (!skb)return NULL ; - }skb_reserve (skb,20 );/* FIXME: why 20 bytes? */ WARN_ONCE ((unsigned long )skb->data &3 ,"unaligned skb" );
@@ -806,10 +804,8 @@ struct sk_buff *ath10k_htc_alloc_skb(struct ath10k *ar, int size)struct sk_buff *skb; skb =dev_alloc_skb (size +sizeof (struct ath10k_htc_hdr )); -if (!skb) { -ath10k_warn (ar,"could not allocate HTC tx skb\n" ); +if (!skb)return NULL ; - }skb_reserve (skb,sizeof (struct ath10k_htc_hdr ));
drivers/net/wireless/ath/ath10k/htt.h +1 -0
@@ -1031,6 +1031,7 @@ static inline struct htt_stats_conf_item *htt_stats_conf_next_item( {return (void *)item +sizeof (*item) +roundup (item->length,4 ); } +/* * host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank *
drivers/net/wireless/ath/ath10k/htt_rx.c +2 -2
@@ -132,7 +132,7 @@ static int __ath10k_htt_rx_ring_fill_n(struct ath10k_htt *htt, int num)dma_addr_t paddr;int ret =0 , idx; - idx =__le32_to_cpu (*(htt->rx_ring.alloc_idx.vaddr)); + idx =__le32_to_cpu (*htt->rx_ring.alloc_idx.vaddr);while (num >0 ) { skb =dev_alloc_skb (HTT_RX_BUF_SIZE +HTT_RX_DESC_ALIGN );if (!skb) {
@@ -170,7 +170,7 @@ static int __ath10k_htt_rx_ring_fill_n(struct ath10k_htt *htt, int num) } fail: - *(htt->rx_ring.alloc_idx.vaddr) =__cpu_to_le32 (idx); + *htt->rx_ring.alloc_idx.vaddr =__cpu_to_le32 (idx);return ret; }
drivers/net/wireless/ath/ath10k/pci.c +1 -1
@@ -631,7 +631,7 @@ static int __ath10k_pci_diag_read_hi(struct ath10k *ar, void *dest, }#define ath10k_pci_diag_read_hi (ar, dest, src, len) \ - __ath10k_pci_diag_read_hi(ar, dest, HI_ITEM(src), len); + __ath10k_pci_diag_read_hi(ar, dest, HI_ITEM(src), len)static int ath10k_pci_diag_write_mem (struct ath10k *ar,u32 address,const void *data,int nbytes)
drivers/net/wireless/ath/ath10k/wmi.c +2 -2
@@ -3590,8 +3590,8 @@ ath10k_wmi_vdev_start_restart(struct ath10k *ar, cmd->chan.antenna_max = arg->channel.max_antenna_gain;ath10k_dbg (ar,ATH10K_DBG_WMI , -"wmi vdev %s id 0x%x flags: 0x%0X, freq %d, mode %d, " -"ch_flags: 0x%0X, max_power: %d\n" , cmdname, arg->vdev_id, +"wmi vdev %s id 0x%x flags: 0x%0X, freq %d, mode %d, ch_flags: 0x%0X, max_power: %d\n" , + cmdname, arg->vdev_id, flags, arg->channel.freq, arg->channel.mode, cmd->chan.flags, arg->channel.max_power);
PATCH 9/10 ath10k: reformat help text in ath10k_read_simulate_fw_crash()
In reply to Kalle ValoMakes it more readable and fixes checkpatch warnings:
drivers/net/wireless/ath/ath10k/debug.c:593: WARNING: quoted string split across lines drivers/net/wireless/ath/ath10k/debug.c:594: WARNING: quoted string split across lines drivers/net/wireless/ath/ath10k/debug.c:595: WARNING: quoted string split across lines drivers/net/wireless/ath/ath10k/debug.c:596: WARNING: quoted string split across lines drivers/net/wireless/ath/ath10k/debug.c:597: WARNING: quoted string split across lines drivers/net/wireless/ath/ath10k/debug.c:599: WARNING: quoted string split across lines drivers/net/wireless/ath/ath10k/debug.c:600: WARNING: quoted string split across lines
--- drivers/net/wireless/ath/ath10k/debug.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath10k/debug.c +5 -9
@@ -589,15 +589,11 @@ static ssize_t ath10k_read_simulate_fw_crash(struct file *file,char __user *user_buf, size_t count, loff_t *ppos) { - const char buf[] = "To simulate firmware crash write one of the" -" keywords to this file:\n `soft` - this will send" -" WMI_FORCE_FW_HANG_ASSERT to firmware if FW" -" supports that command.\n `hard` - this will send" -" to firmware command with illegal parameters" -" causing firmware crash.\n" -"`assert` - this will send special illegal parameter" -" to firmware to cause assert failure" -" and crash.\n" ; + const char buf[] = +"To simulate firmware crash write one of the keywords to this file:\n" +"`soft` - this will send WMI_FORCE_FW_HANG_ASSERT to firmware if FW supports that command.\n" +"`hard` - this will send to firmware command with illegal parameters causing firmware crash.\n" +"`assert` - this will send special illegal parameter to firmware to cause assert failure and crash.\n" ;return simple_read_from_buffer (user_buf, count, ppos, buf,strlen (buf)); }
PATCH 10/10 ath10k: use ether_addr_copy()
In reply to Kalle ValoAs suggeested by checkpatch:
WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)
In wmi.c I had to change due to sparse warnings copying of struct wmi_mac_addr from form &cmd->peer_macaddr.addr to cmd->peer_macaddr.addr. In ath10k_wmi_set_ap_ps_param() I also added the missing ".addr" to the copy command.
--- drivers/net/wireless/ath/ath10k/htt_rx.c | 8 ++++---- drivers/net/wireless/ath/ath10k/mac.c | 10 +++++----- drivers/net/wireless/ath/ath10k/txrx.c | 2 +- drivers/net/wireless/ath/ath10k/wmi.c | 22 +++++++++++----------- 4 files changed, 21 insertions(+), 21 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +4 -4
@@ -954,8 +954,8 @@ static void ath10k_htt_rx_amsdu(struct ath10k_htt *htt,/* pull decapped header and copy SA & DA */ hdr = (struct ieee80211_hdr *)skb->data; hdr_len =ath10k_htt_rx_nwifi_hdrlen (hdr); -memcpy (da,ieee80211_get_DA (hdr),ETH_ALEN ); -memcpy (sa,ieee80211_get_SA (hdr),ETH_ALEN ); +ether_addr_copy (da,ieee80211_get_DA (hdr)); +ether_addr_copy (sa,ieee80211_get_SA (hdr));skb_pull (skb, hdr_len);/* push original 802.11 header */
@@ -972,8 +972,8 @@ static void ath10k_htt_rx_amsdu(struct ath10k_htt *htt,/* original 802.11 header has a different DA and in * case of 4addr it may also have different SA */ -memcpy (ieee80211_get_DA (hdr), da,ETH_ALEN ); -memcpy (ieee80211_get_SA (hdr), sa,ETH_ALEN ); +ether_addr_copy (ieee80211_get_DA (hdr), da); +ether_addr_copy (ieee80211_get_SA (hdr), sa);break ;case RX_MSDU_DECAP_ETHERNET2_DIX :/* strip ethernet header and insert decapped 802.11
drivers/net/wireless/ath/ath10k/mac.c +5 -5
@@ -199,7 +199,7 @@ static int ath10k_clear_vdev_key(struct ath10k_vif *arvif,list_for_each_entry (peer, &ar->peers, list) {for (i =0 ; i <ARRAY_SIZE (peer->keys); i++) {if (peer->keys[i] == key) { -memcpy (addr, peer->addr,ETH_ALEN ); +ether_addr_copy (addr, peer->addr); peer->keys[i] =NULL ;break ; }
@@ -930,7 +930,7 @@ static void ath10k_control_beaconing(struct ath10k_vif *arvif,return ; arvif->aid =0 ; -memcpy (arvif->bssid, info->bssid,ETH_ALEN ); +ether_addr_copy (arvif->bssid, info->bssid); ret =ath10k_wmi_vdev_up (arvif->ar, arvif->vdev_id, arvif->aid, arvif->bssid);
@@ -1050,7 +1050,7 @@ static void ath10k_peer_assoc_h_basic(struct ath10k *ar, {lockdep_assert_held (&ar->conf_mutex); -memcpy (arg->addr, sta->addr,ETH_ALEN ); +ether_addr_copy (arg->addr, sta->addr); arg->vdev_id = arvif->vdev_id; arg->peer_aid = sta->aid; arg->peer_flags |=WMI_PEER_AUTH ;
@@ -1524,7 +1524,7 @@ static void ath10k_bss_assoc(struct ieee80211_hw *hw, arvif->vdev_id, bss_conf->bssid, bss_conf->aid); arvif->aid = bss_conf->aid; -memcpy (arvif->bssid, bss_conf->bssid,ETH_ALEN ); +ether_addr_copy (arvif->bssid, bss_conf->bssid); ret =ath10k_wmi_vdev_up (ar, arvif->vdev_id, arvif->aid, arvif->bssid);if (ret) {
@@ -3090,7 +3090,7 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,* this is never erased as we it for crypto key * clearing; this is FW requirement */ -memcpy (arvif->bssid, info->bssid,ETH_ALEN ); +ether_addr_copy (arvif->bssid, info->bssid); ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d start %pM\n",
drivers/net/wireless/ath/ath10k/txrx.c +1 -1
@@ -178,7 +178,7 @@ void ath10k_peer_map_event(struct ath10k_htt *htt, goto exit; peer->vdev_id = ev->vdev_id; -memcpy (peer->addr, ev->addr,ETH_ALEN ); +ether_addr_copy (peer->addr, ev->addr);list_add (&peer->list, &ar->peers);wake_up (&ar->peer_mapping_wq); }
drivers/net/wireless/ath/ath10k/wmi.c +11 -11
@@ -794,7 +794,7 @@ int ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *skb) cmd->hdr.tx_power =0 ; cmd->hdr.buf_len =__cpu_to_le32 (buf_len); -memcpy (cmd->hdr.peer_macaddr.addr,ieee80211_get_DA (hdr),ETH_ALEN ); +ether_addr_copy (cmd->hdr.peer_macaddr.addr,ieee80211_get_DA (hdr));memcpy (cmd->buf, skb->data, skb->len); ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi mgmt tx skb %p len %d ftype %02x stype %02x\n",
@@ -2350,7 +2350,7 @@ static int ath10k_wmi_ready_event_rx(struct ath10k *ar, struct sk_buff *skb)if (WARN_ON (skb->len <sizeof (*ev)))return -EINVAL ; -memcpy (ar->mac_addr, ev->mac_addr.addr,ETH_ALEN ); +ether_addr_copy (ar->mac_addr, ev->mac_addr.addr); ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi event ready sw_version %u abi_version %u mac_addr %pM status %d skb->len %i ev-sz %zu\n",
@@ -3496,7 +3496,7 @@ int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id, cmd->vdev_id =__cpu_to_le32 (vdev_id); cmd->vdev_type =__cpu_to_le32 (type); cmd->vdev_subtype =__cpu_to_le32 (subtype); -memcpy (cmd->vdev_macaddr.addr, macaddr,ETH_ALEN ); +ether_addr_copy (cmd->vdev_macaddr.addr, macaddr); ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI vdev create: id %d type %d subtype %d macaddr %pM\n",
@@ -3643,7 +3643,7 @@ int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid, const u8 *bssid) cmd = (struct wmi_vdev_up_cmd *)skb->data; cmd->vdev_id =__cpu_to_le32 (vdev_id); cmd->vdev_assoc_id =__cpu_to_le32 (aid); -memcpy (&cmd->vdev_bssid.addr, bssid,ETH_ALEN ); +ether_addr_copy (cmd->vdev_bssid.addr, bssid); ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi mgmt vdev up id 0x%x assoc id %d bssid %pM\n",
@@ -3724,7 +3724,7 @@ int ath10k_wmi_vdev_install_key(struct ath10k *ar, cmd->key_rxmic_len =__cpu_to_le32 (arg->key_rxmic_len);if (arg->macaddr) -memcpy (cmd->peer_macaddr.addr, arg->macaddr,ETH_ALEN ); +ether_addr_copy (cmd->peer_macaddr.addr, arg->macaddr);if (arg->key_data)memcpy (cmd->key_data, arg->key_data, arg->key_len);
@@ -3803,7 +3803,7 @@ int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id, cmd = (struct wmi_peer_create_cmd *)skb->data; cmd->vdev_id =__cpu_to_le32 (vdev_id); -memcpy (cmd->peer_macaddr.addr, peer_addr,ETH_ALEN ); +ether_addr_copy (cmd->peer_macaddr.addr, peer_addr); ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi peer create vdev_id %d peer_addr %pM\n",
@@ -3823,7 +3823,7 @@ int ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id, cmd = (struct wmi_peer_delete_cmd *)skb->data; cmd->vdev_id =__cpu_to_le32 (vdev_id); -memcpy (cmd->peer_macaddr.addr, peer_addr,ETH_ALEN ); +ether_addr_copy (cmd->peer_macaddr.addr, peer_addr); ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi peer delete vdev_id %d peer_addr %pM\n",
@@ -3844,7 +3844,7 @@ int ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id, cmd = (struct wmi_peer_flush_tids_cmd *)skb->data; cmd->vdev_id =__cpu_to_le32 (vdev_id); cmd->peer_tid_bitmap =__cpu_to_le32 (tid_bitmap); -memcpy (cmd->peer_macaddr.addr, peer_addr,ETH_ALEN ); +ether_addr_copy (cmd->peer_macaddr.addr, peer_addr); ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi peer flush vdev_id %d peer_addr %pM tids %08x\n",
@@ -3867,7 +3867,7 @@ int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id, cmd->vdev_id =__cpu_to_le32 (vdev_id); cmd->param_id =__cpu_to_le32 (param_id); cmd->param_value =__cpu_to_le32 (param_value); -memcpy (&cmd->peer_macaddr.addr, peer_addr,ETH_ALEN ); +ether_addr_copy (cmd->peer_macaddr.addr, peer_addr); ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi vdev %d peer 0x%pM set param %d value %d\n",
@@ -3938,7 +3938,7 @@ int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac, cmd->vdev_id =__cpu_to_le32 (vdev_id); cmd->param_id =__cpu_to_le32 (param_id); cmd->param_value =__cpu_to_le32 (value); -memcpy (&cmd->peer_macaddr, mac,ETH_ALEN ); +ether_addr_copy (cmd->peer_macaddr.addr, mac); ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi ap ps param vdev_id 0x%X param %d value %d mac_addr %pM\n",
@@ -4022,7 +4022,7 @@ ath10k_wmi_peer_assoc_fill(struct ath10k *ar, void *buf, cmd->peer_vht_caps =__cpu_to_le32 (arg->peer_vht_caps); cmd->peer_phymode =__cpu_to_le32 (arg->peer_phymode); -memcpy (cmd->peer_macaddr.addr, arg->addr,ETH_ALEN ); +ether_addr_copy (cmd->peer_macaddr.addr, arg->addr); cmd->peer_legacy_rates.num_rates =__cpu_to_le32 (arg->peer_legacy_rates.num_rates);
Quoted 8 lines · Kalle Valo
Hi,
some fixes to recently added checkpatch warnings. Please review.
Kalle
---
Quoted 11 lines
Kalle Valo (10):
ath10k: fix parenthesis alignment warning inath10k_htt_rx_alloc()
ath10k: fix checkpatch warnings about parenthesis alignment
ath10k: fix use of multiple blank lines
ath10k: fix missing a blank line after declarations
ath10k: fix space after a cast style errors
ath10k: don't use return on void functions
ath10k: else is not generally useful after a break or return
ath10k: miscellaneous checkpatch fixes
ath10k: reformat help text inath10k_read_simulate_fw_crash()
ath10k: useether_addr_copy()
All ten applied.
Signature · 1 line
Kalle Valo