wifi: ath9k: Remove unnecessary (void*) conversions
authorWu Yunchuan <yunchuan@nfschina.com>
Wed, 22 Nov 2023 18:31:03 +0000 (20:31 +0200)
committerKalle Valo <quic_kvalo@quicinc.com>
Wed, 29 Nov 2023 11:28:05 +0000 (13:28 +0200)
No need cast (void *) to (struct owl_ctx *), (struct ath_hw *),
(struct cmd_buf *) or other types.

Signed-off-by: Wu Yunchuan <yunchuan@nfschina.com>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230919045226.524544-1-yunchuan@nfschina.com
drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c
drivers/net/wireless/ath/ath9k/common-init.c
drivers/net/wireless/ath/ath9k/common-spectral.c
drivers/net/wireless/ath/ath9k/debug.c
drivers/net/wireless/ath/ath9k/hif_usb.c
drivers/net/wireless/ath/ath9k/htc_drv_debug.c
drivers/net/wireless/ath/ath9k/htc_drv_init.c
drivers/net/wireless/ath/ath9k/htc_hst.c
drivers/net/wireless/ath/ath9k/init.c
drivers/net/wireless/ath/ath9k/link.c
drivers/net/wireless/ath/ath9k/pci.c

index 708c8969b503ab62848ecf19cb98d345b53dff09..a5eb43f3032013c6943039c15ce1962ec8c44617 100644 (file)
@@ -125,7 +125,7 @@ static void owl_rescan(struct pci_dev *pdev)
 
 static void owl_fw_cb(const struct firmware *fw, void *context)
 {
-       struct owl_ctx *ctx = (struct owl_ctx *)context;
+       struct owl_ctx *ctx = context;
 
        complete(&ctx->eeprom_load);
 
index 82de0fadbc956d0151a731fdbdb62edf881f86d3..7c13a1deb3acf1c1a1430a29a50f79bfb539e121 100644 (file)
@@ -124,7 +124,7 @@ static struct ieee80211_rate ath9k_legacy_rates[] = {
 
 int ath9k_cmn_init_channels_rates(struct ath_common *common)
 {
-       struct ath_hw *ah = (struct ath_hw *)common->ah;
+       struct ath_hw *ah = common->ah;
        void *channels;
 
        BUILD_BUG_ON(ARRAY_SIZE(ath9k_2ghz_chantable) +
index a5349c72c3321f8b9a39dd09ffd472d70fad201c..4b27445a5fb87d4c2b7167c270b99a2d8c588a7d 100644 (file)
@@ -471,7 +471,7 @@ int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_h
        u8 sample_buf[SPECTRAL_SAMPLE_MAX_LEN] = {0};
        struct ath_hw *ah = spec_priv->ah;
        struct ath_common *common = ath9k_hw_common(spec_priv->ah);
-       struct ath_softc *sc = (struct ath_softc *)common->priv;
+       struct ath_softc *sc = common->priv;
        u8 num_bins, *vdata = (u8 *)hdr;
        struct ath_radar_info *radar_info;
        int len = rs->rs_datalen;
index a0376a6787b8d0c8466d552f800f45686096c277..d84e3ee7b5d902cdfbdc0134ff635b12109f2029 100644 (file)
@@ -1376,7 +1376,7 @@ void ath9k_deinit_debug(struct ath_softc *sc)
 int ath9k_init_debug(struct ath_hw *ah)
 {
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath_softc *sc = (struct ath_softc *) common->priv;
+       struct ath_softc *sc = common->priv;
 
        sc->debug.debugfs_phy = debugfs_create_dir("ath9k",
                                                   sc->hw->wiphy->debugfsdir);
index 90cfe39aa433c939913c3ac5c8f0333a32ce1713..0c7841f952287f7915d2e92e04e277bfcbf76792 100644 (file)
@@ -70,7 +70,7 @@ static int __hif_usb_tx(struct hif_device_usb *hif_dev);
 
 static void hif_usb_regout_cb(struct urb *urb)
 {
-       struct cmd_buf *cmd = (struct cmd_buf *)urb->context;
+       struct cmd_buf *cmd = urb->context;
 
        switch (urb->status) {
        case 0:
@@ -134,7 +134,7 @@ static int hif_usb_send_regout(struct hif_device_usb *hif_dev,
 
 static void hif_usb_mgmt_cb(struct urb *urb)
 {
-       struct cmd_buf *cmd = (struct cmd_buf *)urb->context;
+       struct cmd_buf *cmd = urb->context;
        struct hif_device_usb *hif_dev;
        unsigned long flags;
        bool txok = true;
@@ -252,7 +252,7 @@ static inline void ath9k_skb_queue_complete(struct hif_device_usb *hif_dev,
 
 static void hif_usb_tx_cb(struct urb *urb)
 {
-       struct tx_buf *tx_buf = (struct tx_buf *) urb->context;
+       struct tx_buf *tx_buf = urb->context;
        struct hif_device_usb *hif_dev;
        bool txok = true;
 
@@ -687,7 +687,7 @@ invalid_pkt:
 
 static void ath9k_hif_usb_rx_cb(struct urb *urb)
 {
-       struct rx_buf *rx_buf = (struct rx_buf *)urb->context;
+       struct rx_buf *rx_buf = urb->context;
        struct hif_device_usb *hif_dev = rx_buf->hif_dev;
        struct sk_buff *skb = rx_buf->skb;
        int ret;
@@ -734,7 +734,7 @@ free:
 
 static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
 {
-       struct rx_buf *rx_buf = (struct rx_buf *)urb->context;
+       struct rx_buf *rx_buf = urb->context;
        struct hif_device_usb *hif_dev = rx_buf->hif_dev;
        struct sk_buff *skb = rx_buf->skb;
        int ret;
index 278ddc713fdc258de3c72c41f4a97fc7eacaf541..f7c6d9bc931196195cadb7ee0260b5caee0ad797 100644 (file)
@@ -482,7 +482,7 @@ void ath9k_htc_deinit_debug(struct ath9k_htc_priv *priv)
 int ath9k_htc_init_debug(struct ath_hw *ah)
 {
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
+       struct ath9k_htc_priv *priv = common->priv;
 
        priv->debug.debugfs_phy = debugfs_create_dir(KBUILD_MODNAME,
                                             priv->hw->wiphy->debugfsdir);
index dae3d9c7b640828ccb2656a4fa49902ced6f2d38..0aa5bdeb44a1b0bf605ddb1d67e46dd7e9f4302d 100644 (file)
@@ -63,12 +63,12 @@ static const struct ieee80211_tpt_blink ath9k_htc_tpt_blink[] = {
 
 static void ath9k_htc_op_ps_wakeup(struct ath_common *common)
 {
-       ath9k_htc_ps_wakeup((struct ath9k_htc_priv *) common->priv);
+       ath9k_htc_ps_wakeup(common->priv);
 }
 
 static void ath9k_htc_op_ps_restore(struct ath_common *common)
 {
-       ath9k_htc_ps_restore((struct ath9k_htc_priv *) common->priv);
+       ath9k_htc_ps_restore(common->priv);
 }
 
 static const struct ath_ps_ops ath9k_htc_ps_ops = {
@@ -235,7 +235,7 @@ static unsigned int ath9k_regread(void *hw_priv, u32 reg_offset)
 {
        struct ath_hw *ah = hw_priv;
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
+       struct ath9k_htc_priv *priv = common->priv;
        __be32 val, reg = cpu_to_be32(reg_offset);
        int r;
 
@@ -257,7 +257,7 @@ static void ath9k_multi_regread(void *hw_priv, u32 *addr,
 {
        struct ath_hw *ah = hw_priv;
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
+       struct ath9k_htc_priv *priv = common->priv;
        __be32 tmpaddr[8];
        __be32 tmpval[8];
        int i, ret;
@@ -282,7 +282,7 @@ static void ath9k_multi_regread(void *hw_priv, u32 *addr,
 
 static void ath9k_regwrite_multi(struct ath_common *common)
 {
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
+       struct ath9k_htc_priv *priv = common->priv;
        u32 rsp_status;
        int r;
 
@@ -303,7 +303,7 @@ static void ath9k_regwrite_single(void *hw_priv, u32 val, u32 reg_offset)
 {
        struct ath_hw *ah = hw_priv;
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
+       struct ath9k_htc_priv *priv = common->priv;
        const __be32 buf[2] = {
                cpu_to_be32(reg_offset),
                cpu_to_be32(val),
@@ -324,7 +324,7 @@ static void ath9k_regwrite_buffer(void *hw_priv, u32 val, u32 reg_offset)
 {
        struct ath_hw *ah = hw_priv;
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
+       struct ath9k_htc_priv *priv = common->priv;
 
        mutex_lock(&priv->wmi->multi_write_mutex);
 
@@ -347,7 +347,7 @@ static void ath9k_regwrite(void *hw_priv, u32 val, u32 reg_offset)
 {
        struct ath_hw *ah = hw_priv;
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
+       struct ath9k_htc_priv *priv = common->priv;
 
        if (atomic_read(&priv->wmi->mwrite_cnt))
                ath9k_regwrite_buffer(hw_priv, val, reg_offset);
@@ -359,7 +359,7 @@ static void ath9k_enable_regwrite_buffer(void *hw_priv)
 {
        struct ath_hw *ah = hw_priv;
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
+       struct ath9k_htc_priv *priv = common->priv;
 
        atomic_inc(&priv->wmi->mwrite_cnt);
 }
@@ -368,7 +368,7 @@ static void ath9k_regwrite_flush(void *hw_priv)
 {
        struct ath_hw *ah = hw_priv;
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
+       struct ath9k_htc_priv *priv = common->priv;
 
        atomic_dec(&priv->wmi->mwrite_cnt);
 
@@ -385,7 +385,7 @@ static void ath9k_reg_rmw_buffer(void *hw_priv,
 {
        struct ath_hw *ah = hw_priv;
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
+       struct ath9k_htc_priv *priv = common->priv;
        u32 rsp_status;
        int r;
 
@@ -423,7 +423,7 @@ static void ath9k_reg_rmw_flush(void *hw_priv)
 {
        struct ath_hw *ah = hw_priv;
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
+       struct ath9k_htc_priv *priv = common->priv;
        u32 rsp_status;
        int r;
 
@@ -455,7 +455,7 @@ static void ath9k_enable_rmw_buffer(void *hw_priv)
 {
        struct ath_hw *ah = hw_priv;
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
+       struct ath9k_htc_priv *priv = common->priv;
 
        if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags))
                return;
@@ -468,7 +468,7 @@ static void ath9k_reg_rmw_single(void *hw_priv,
 {
        struct ath_hw *ah = hw_priv;
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
+       struct ath9k_htc_priv *priv = common->priv;
        struct register_rmw buf, buf_ret;
        int ret;
 
@@ -490,7 +490,7 @@ static u32 ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr)
 {
        struct ath_hw *ah = hw_priv;
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
+       struct ath9k_htc_priv *priv = common->priv;
 
        if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags)) {
                u32 val;
@@ -518,7 +518,7 @@ static void ath_usb_read_cachesize(struct ath_common *common, int *csz)
 
 static bool ath_usb_eeprom_read(struct ath_common *common, u32 off, u16 *data)
 {
-       struct ath_hw *ah = (struct ath_hw *) common->ah;
+       struct ath_hw *ah = common->ah;
 
        (void)REG_READ(ah, AR5416_EEPROM_OFFSET + (off << AR5416_EEPROM_S));
 
@@ -970,7 +970,7 @@ int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev,
 
 err_init:
        ath9k_stop_wmi(priv);
-       hif_dev = (struct hif_device_usb *)htc_handle->hif_dev;
+       hif_dev = htc_handle->hif_dev;
        ath9k_hif_usb_dealloc_urbs(hif_dev);
        ath9k_destroy_wmi(priv);
 err_free:
@@ -988,7 +988,7 @@ void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug)
 
                ath9k_deinit_device(htc_handle->drv_priv);
                ath9k_stop_wmi(htc_handle->drv_priv);
-               ath9k_hif_usb_dealloc_urbs((struct hif_device_usb *)htc_handle->hif_dev);
+               ath9k_hif_usb_dealloc_urbs(htc_handle->hif_dev);
                ath9k_destroy_wmi(htc_handle->drv_priv);
                ieee80211_free_hw(htc_handle->drv_priv->hw);
        }
index 99667aba289df0c9aeac94c15e7b1992db8907e0..eb631fd3336d8d586a9290d3081e25ec64202d3f 100644 (file)
@@ -89,7 +89,7 @@ static void htc_process_target_rdy(struct htc_target *target,
                                   void *buf)
 {
        struct htc_endpoint *endpoint;
-       struct htc_ready_msg *htc_ready_msg = (struct htc_ready_msg *) buf;
+       struct htc_ready_msg *htc_ready_msg = buf;
 
        target->credit_size = be16_to_cpu(htc_ready_msg->credit_size);
 
index 4f00400c7ffb83545d461c623f055b73481efb02..7fad7e75af6a372525667386c3681842685c542a 100644 (file)
@@ -151,12 +151,12 @@ static void ath9k_deinit_softc(struct ath_softc *sc);
 
 static void ath9k_op_ps_wakeup(struct ath_common *common)
 {
-       ath9k_ps_wakeup((struct ath_softc *) common->priv);
+       ath9k_ps_wakeup(common->priv);
 }
 
 static void ath9k_op_ps_restore(struct ath_common *common)
 {
-       ath9k_ps_restore((struct ath_softc *) common->priv);
+       ath9k_ps_restore(common->priv);
 }
 
 static const struct ath_ps_ops ath9k_ps_ops = {
@@ -174,7 +174,7 @@ static void ath9k_iowrite32(void *hw_priv, u32 val, u32 reg_offset)
 {
        struct ath_hw *ah = hw_priv;
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath_softc *sc = (struct ath_softc *) common->priv;
+       struct ath_softc *sc = common->priv;
 
        if (NR_CPUS > 1 && ah->config.serialize_regmode == SER_REG_MODE_ON) {
                unsigned long flags;
@@ -189,7 +189,7 @@ static unsigned int ath9k_ioread32(void *hw_priv, u32 reg_offset)
 {
        struct ath_hw *ah = hw_priv;
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath_softc *sc = (struct ath_softc *) common->priv;
+       struct ath_softc *sc = common->priv;
        u32 val;
 
        if (NR_CPUS > 1 && ah->config.serialize_regmode == SER_REG_MODE_ON) {
@@ -229,7 +229,7 @@ static unsigned int ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 cl
 {
        struct ath_hw *ah = hw_priv;
        struct ath_common *common = ath9k_hw_common(ah);
-       struct ath_softc *sc = (struct ath_softc *) common->priv;
+       struct ath_softc *sc = common->priv;
        unsigned long flags;
        u32 val;
 
@@ -608,7 +608,7 @@ static int ath9k_nvmem_request_eeprom(struct ath_softc *sc)
        }
 
        /* devres manages the calibration values release on shutdown */
-       ah->nvmem_blob = (u16 *)devm_kmemdup(sc->dev, buf, len, GFP_KERNEL);
+       ah->nvmem_blob = devm_kmemdup(sc->dev, buf, len, GFP_KERNEL);
        kfree(buf);
        if (!ah->nvmem_blob)
                return -ENOMEM;
index 9d84003db800e9513f07ee85a4203dbb7636edf0..d1e5767aab3cbc2ee91018edadf89a223cf1d759 100644 (file)
@@ -304,7 +304,7 @@ fail_paprd:
 void ath_ani_calibrate(struct timer_list *t)
 {
        struct ath_common *common = from_timer(common, t, ani.timer);
-       struct ath_softc *sc = (struct ath_softc *)common->priv;
+       struct ath_softc *sc = common->priv;
        struct ath_hw *ah = sc->sc_ah;
        bool longcal = false;
        bool shortcal = false;
index 0633589b85c23a941f68782ca158439f72da24ab..e655cd8bbf94e1499bc6482ab50ea4404894f030 100644 (file)
@@ -781,7 +781,7 @@ static const struct pci_device_id ath_pci_id_table[] = {
 /* return bus cachesize in 4B word units */
 static void ath_pci_read_cachesize(struct ath_common *common, int *csz)
 {
-       struct ath_softc *sc = (struct ath_softc *) common->priv;
+       struct ath_softc *sc = common->priv;
        u8 u8tmp;
 
        pci_read_config_byte(to_pci_dev(sc->dev), PCI_CACHE_LINE_SIZE, &u8tmp);
@@ -799,7 +799,7 @@ static void ath_pci_read_cachesize(struct ath_common *common, int *csz)
 
 static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data)
 {
-       struct ath_hw *ah = (struct ath_hw *) common->ah;
+       struct ath_hw *ah = common->ah;
 
        common->ops->read(ah, AR5416_EEPROM_OFFSET + (off << AR5416_EEPROM_S));
 
@@ -820,7 +820,7 @@ static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data)
 /* Need to be called after we discover btcoex capabilities */
 static void ath_pci_aspm_init(struct ath_common *common)
 {
-       struct ath_softc *sc = (struct ath_softc *) common->priv;
+       struct ath_softc *sc = common->priv;
        struct ath_hw *ah = sc->sc_ah;
        struct pci_dev *pdev = to_pci_dev(sc->dev);
        struct pci_dev *parent;