Skip to content

Commit d6e71dd

Browse files
Wu Yunchuankvalo
authored andcommitted
wifi: ath9k: Remove unnecessary (void*) conversions
No need cast (void *) to (struct owl_ctx *), (struct ath_hw *), (struct cmd_buf *) or other types. Signed-off-by: Wu Yunchuan <[email protected]> Reviewed-by: Jeff Johnson <[email protected]> Acked-by: Toke Høiland-Jørgensen <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9f1eebf commit d6e71dd

File tree

11 files changed

+39
-39
lines changed

11 files changed

+39
-39
lines changed

drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static void owl_rescan(struct pci_dev *pdev)
125125

126126
static void owl_fw_cb(const struct firmware *fw, void *context)
127127
{
128-
struct owl_ctx *ctx = (struct owl_ctx *)context;
128+
struct owl_ctx *ctx = context;
129129

130130
complete(&ctx->eeprom_load);
131131

drivers/net/wireless/ath/ath9k/common-init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static struct ieee80211_rate ath9k_legacy_rates[] = {
124124

125125
int ath9k_cmn_init_channels_rates(struct ath_common *common)
126126
{
127-
struct ath_hw *ah = (struct ath_hw *)common->ah;
127+
struct ath_hw *ah = common->ah;
128128
void *channels;
129129

130130
BUILD_BUG_ON(ARRAY_SIZE(ath9k_2ghz_chantable) +

drivers/net/wireless/ath/ath9k/common-spectral.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_h
471471
u8 sample_buf[SPECTRAL_SAMPLE_MAX_LEN] = {0};
472472
struct ath_hw *ah = spec_priv->ah;
473473
struct ath_common *common = ath9k_hw_common(spec_priv->ah);
474-
struct ath_softc *sc = (struct ath_softc *)common->priv;
474+
struct ath_softc *sc = common->priv;
475475
u8 num_bins, *vdata = (u8 *)hdr;
476476
struct ath_radar_info *radar_info;
477477
int len = rs->rs_datalen;

drivers/net/wireless/ath/ath9k/debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ void ath9k_deinit_debug(struct ath_softc *sc)
13761376
int ath9k_init_debug(struct ath_hw *ah)
13771377
{
13781378
struct ath_common *common = ath9k_hw_common(ah);
1379-
struct ath_softc *sc = (struct ath_softc *) common->priv;
1379+
struct ath_softc *sc = common->priv;
13801380

13811381
sc->debug.debugfs_phy = debugfs_create_dir("ath9k",
13821382
sc->hw->wiphy->debugfsdir);

drivers/net/wireless/ath/ath9k/hif_usb.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static int __hif_usb_tx(struct hif_device_usb *hif_dev);
7070

7171
static void hif_usb_regout_cb(struct urb *urb)
7272
{
73-
struct cmd_buf *cmd = (struct cmd_buf *)urb->context;
73+
struct cmd_buf *cmd = urb->context;
7474

7575
switch (urb->status) {
7676
case 0:
@@ -134,7 +134,7 @@ static int hif_usb_send_regout(struct hif_device_usb *hif_dev,
134134

135135
static void hif_usb_mgmt_cb(struct urb *urb)
136136
{
137-
struct cmd_buf *cmd = (struct cmd_buf *)urb->context;
137+
struct cmd_buf *cmd = urb->context;
138138
struct hif_device_usb *hif_dev;
139139
unsigned long flags;
140140
bool txok = true;
@@ -252,7 +252,7 @@ static inline void ath9k_skb_queue_complete(struct hif_device_usb *hif_dev,
252252

253253
static void hif_usb_tx_cb(struct urb *urb)
254254
{
255-
struct tx_buf *tx_buf = (struct tx_buf *) urb->context;
255+
struct tx_buf *tx_buf = urb->context;
256256
struct hif_device_usb *hif_dev;
257257
bool txok = true;
258258

@@ -687,7 +687,7 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
687687

688688
static void ath9k_hif_usb_rx_cb(struct urb *urb)
689689
{
690-
struct rx_buf *rx_buf = (struct rx_buf *)urb->context;
690+
struct rx_buf *rx_buf = urb->context;
691691
struct hif_device_usb *hif_dev = rx_buf->hif_dev;
692692
struct sk_buff *skb = rx_buf->skb;
693693
int ret;
@@ -734,7 +734,7 @@ static void ath9k_hif_usb_rx_cb(struct urb *urb)
734734

735735
static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
736736
{
737-
struct rx_buf *rx_buf = (struct rx_buf *)urb->context;
737+
struct rx_buf *rx_buf = urb->context;
738738
struct hif_device_usb *hif_dev = rx_buf->hif_dev;
739739
struct sk_buff *skb = rx_buf->skb;
740740
int ret;

drivers/net/wireless/ath/ath9k/htc_drv_debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ void ath9k_htc_deinit_debug(struct ath9k_htc_priv *priv)
482482
int ath9k_htc_init_debug(struct ath_hw *ah)
483483
{
484484
struct ath_common *common = ath9k_hw_common(ah);
485-
struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
485+
struct ath9k_htc_priv *priv = common->priv;
486486

487487
priv->debug.debugfs_phy = debugfs_create_dir(KBUILD_MODNAME,
488488
priv->hw->wiphy->debugfsdir);

drivers/net/wireless/ath/ath9k/htc_drv_init.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ static const struct ieee80211_tpt_blink ath9k_htc_tpt_blink[] = {
6363

6464
static void ath9k_htc_op_ps_wakeup(struct ath_common *common)
6565
{
66-
ath9k_htc_ps_wakeup((struct ath9k_htc_priv *) common->priv);
66+
ath9k_htc_ps_wakeup(common->priv);
6767
}
6868

6969
static void ath9k_htc_op_ps_restore(struct ath_common *common)
7070
{
71-
ath9k_htc_ps_restore((struct ath9k_htc_priv *) common->priv);
71+
ath9k_htc_ps_restore(common->priv);
7272
}
7373

7474
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)
235235
{
236236
struct ath_hw *ah = hw_priv;
237237
struct ath_common *common = ath9k_hw_common(ah);
238-
struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
238+
struct ath9k_htc_priv *priv = common->priv;
239239
__be32 val, reg = cpu_to_be32(reg_offset);
240240
int r;
241241

@@ -257,7 +257,7 @@ static void ath9k_multi_regread(void *hw_priv, u32 *addr,
257257
{
258258
struct ath_hw *ah = hw_priv;
259259
struct ath_common *common = ath9k_hw_common(ah);
260-
struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
260+
struct ath9k_htc_priv *priv = common->priv;
261261
__be32 tmpaddr[8];
262262
__be32 tmpval[8];
263263
int i, ret;
@@ -282,7 +282,7 @@ static void ath9k_multi_regread(void *hw_priv, u32 *addr,
282282

283283
static void ath9k_regwrite_multi(struct ath_common *common)
284284
{
285-
struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
285+
struct ath9k_htc_priv *priv = common->priv;
286286
u32 rsp_status;
287287
int r;
288288

@@ -303,7 +303,7 @@ static void ath9k_regwrite_single(void *hw_priv, u32 val, u32 reg_offset)
303303
{
304304
struct ath_hw *ah = hw_priv;
305305
struct ath_common *common = ath9k_hw_common(ah);
306-
struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
306+
struct ath9k_htc_priv *priv = common->priv;
307307
const __be32 buf[2] = {
308308
cpu_to_be32(reg_offset),
309309
cpu_to_be32(val),
@@ -324,7 +324,7 @@ static void ath9k_regwrite_buffer(void *hw_priv, u32 val, u32 reg_offset)
324324
{
325325
struct ath_hw *ah = hw_priv;
326326
struct ath_common *common = ath9k_hw_common(ah);
327-
struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
327+
struct ath9k_htc_priv *priv = common->priv;
328328

329329
mutex_lock(&priv->wmi->multi_write_mutex);
330330

@@ -347,7 +347,7 @@ static void ath9k_regwrite(void *hw_priv, u32 val, u32 reg_offset)
347347
{
348348
struct ath_hw *ah = hw_priv;
349349
struct ath_common *common = ath9k_hw_common(ah);
350-
struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
350+
struct ath9k_htc_priv *priv = common->priv;
351351

352352
if (atomic_read(&priv->wmi->mwrite_cnt))
353353
ath9k_regwrite_buffer(hw_priv, val, reg_offset);
@@ -359,7 +359,7 @@ static void ath9k_enable_regwrite_buffer(void *hw_priv)
359359
{
360360
struct ath_hw *ah = hw_priv;
361361
struct ath_common *common = ath9k_hw_common(ah);
362-
struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
362+
struct ath9k_htc_priv *priv = common->priv;
363363

364364
atomic_inc(&priv->wmi->mwrite_cnt);
365365
}
@@ -368,7 +368,7 @@ static void ath9k_regwrite_flush(void *hw_priv)
368368
{
369369
struct ath_hw *ah = hw_priv;
370370
struct ath_common *common = ath9k_hw_common(ah);
371-
struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
371+
struct ath9k_htc_priv *priv = common->priv;
372372

373373
atomic_dec(&priv->wmi->mwrite_cnt);
374374

@@ -385,7 +385,7 @@ static void ath9k_reg_rmw_buffer(void *hw_priv,
385385
{
386386
struct ath_hw *ah = hw_priv;
387387
struct ath_common *common = ath9k_hw_common(ah);
388-
struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
388+
struct ath9k_htc_priv *priv = common->priv;
389389
u32 rsp_status;
390390
int r;
391391

@@ -423,7 +423,7 @@ static void ath9k_reg_rmw_flush(void *hw_priv)
423423
{
424424
struct ath_hw *ah = hw_priv;
425425
struct ath_common *common = ath9k_hw_common(ah);
426-
struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
426+
struct ath9k_htc_priv *priv = common->priv;
427427
u32 rsp_status;
428428
int r;
429429

@@ -455,7 +455,7 @@ static void ath9k_enable_rmw_buffer(void *hw_priv)
455455
{
456456
struct ath_hw *ah = hw_priv;
457457
struct ath_common *common = ath9k_hw_common(ah);
458-
struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
458+
struct ath9k_htc_priv *priv = common->priv;
459459

460460
if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags))
461461
return;
@@ -468,7 +468,7 @@ static void ath9k_reg_rmw_single(void *hw_priv,
468468
{
469469
struct ath_hw *ah = hw_priv;
470470
struct ath_common *common = ath9k_hw_common(ah);
471-
struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
471+
struct ath9k_htc_priv *priv = common->priv;
472472
struct register_rmw buf, buf_ret;
473473
int ret;
474474

@@ -490,7 +490,7 @@ static u32 ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr)
490490
{
491491
struct ath_hw *ah = hw_priv;
492492
struct ath_common *common = ath9k_hw_common(ah);
493-
struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
493+
struct ath9k_htc_priv *priv = common->priv;
494494

495495
if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags)) {
496496
u32 val;
@@ -518,7 +518,7 @@ static void ath_usb_read_cachesize(struct ath_common *common, int *csz)
518518

519519
static bool ath_usb_eeprom_read(struct ath_common *common, u32 off, u16 *data)
520520
{
521-
struct ath_hw *ah = (struct ath_hw *) common->ah;
521+
struct ath_hw *ah = common->ah;
522522

523523
(void)REG_READ(ah, AR5416_EEPROM_OFFSET + (off << AR5416_EEPROM_S));
524524

@@ -970,7 +970,7 @@ int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev,
970970

971971
err_init:
972972
ath9k_stop_wmi(priv);
973-
hif_dev = (struct hif_device_usb *)htc_handle->hif_dev;
973+
hif_dev = htc_handle->hif_dev;
974974
ath9k_hif_usb_dealloc_urbs(hif_dev);
975975
ath9k_destroy_wmi(priv);
976976
err_free:
@@ -988,7 +988,7 @@ void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug)
988988

989989
ath9k_deinit_device(htc_handle->drv_priv);
990990
ath9k_stop_wmi(htc_handle->drv_priv);
991-
ath9k_hif_usb_dealloc_urbs((struct hif_device_usb *)htc_handle->hif_dev);
991+
ath9k_hif_usb_dealloc_urbs(htc_handle->hif_dev);
992992
ath9k_destroy_wmi(htc_handle->drv_priv);
993993
ieee80211_free_hw(htc_handle->drv_priv->hw);
994994
}

drivers/net/wireless/ath/ath9k/htc_hst.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static void htc_process_target_rdy(struct htc_target *target,
8989
void *buf)
9090
{
9191
struct htc_endpoint *endpoint;
92-
struct htc_ready_msg *htc_ready_msg = (struct htc_ready_msg *) buf;
92+
struct htc_ready_msg *htc_ready_msg = buf;
9393

9494
target->credit_size = be16_to_cpu(htc_ready_msg->credit_size);
9595

drivers/net/wireless/ath/ath9k/init.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ static void ath9k_deinit_softc(struct ath_softc *sc);
151151

152152
static void ath9k_op_ps_wakeup(struct ath_common *common)
153153
{
154-
ath9k_ps_wakeup((struct ath_softc *) common->priv);
154+
ath9k_ps_wakeup(common->priv);
155155
}
156156

157157
static void ath9k_op_ps_restore(struct ath_common *common)
158158
{
159-
ath9k_ps_restore((struct ath_softc *) common->priv);
159+
ath9k_ps_restore(common->priv);
160160
}
161161

162162
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)
174174
{
175175
struct ath_hw *ah = hw_priv;
176176
struct ath_common *common = ath9k_hw_common(ah);
177-
struct ath_softc *sc = (struct ath_softc *) common->priv;
177+
struct ath_softc *sc = common->priv;
178178

179179
if (NR_CPUS > 1 && ah->config.serialize_regmode == SER_REG_MODE_ON) {
180180
unsigned long flags;
@@ -189,7 +189,7 @@ static unsigned int ath9k_ioread32(void *hw_priv, u32 reg_offset)
189189
{
190190
struct ath_hw *ah = hw_priv;
191191
struct ath_common *common = ath9k_hw_common(ah);
192-
struct ath_softc *sc = (struct ath_softc *) common->priv;
192+
struct ath_softc *sc = common->priv;
193193
u32 val;
194194

195195
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
229229
{
230230
struct ath_hw *ah = hw_priv;
231231
struct ath_common *common = ath9k_hw_common(ah);
232-
struct ath_softc *sc = (struct ath_softc *) common->priv;
232+
struct ath_softc *sc = common->priv;
233233
unsigned long flags;
234234
u32 val;
235235

@@ -608,7 +608,7 @@ static int ath9k_nvmem_request_eeprom(struct ath_softc *sc)
608608
}
609609

610610
/* devres manages the calibration values release on shutdown */
611-
ah->nvmem_blob = (u16 *)devm_kmemdup(sc->dev, buf, len, GFP_KERNEL);
611+
ah->nvmem_blob = devm_kmemdup(sc->dev, buf, len, GFP_KERNEL);
612612
kfree(buf);
613613
if (!ah->nvmem_blob)
614614
return -ENOMEM;

drivers/net/wireless/ath/ath9k/link.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ void ath_paprd_calibrate(struct work_struct *work)
304304
void ath_ani_calibrate(struct timer_list *t)
305305
{
306306
struct ath_common *common = from_timer(common, t, ani.timer);
307-
struct ath_softc *sc = (struct ath_softc *)common->priv;
307+
struct ath_softc *sc = common->priv;
308308
struct ath_hw *ah = sc->sc_ah;
309309
bool longcal = false;
310310
bool shortcal = false;

0 commit comments

Comments
 (0)