staging: wfx: remove unnecessary void pointer
PATCH 1/1 staging: wfx: remove unnecessary void pointer
Remove unnecessary void pointers.
Issue detected and solved by coccinelle tool.
semantic use
@@expression e ;@@
-(void*)(e)
+e
--- drivers/staging/wfx/bh.c | 2 +- drivers/staging/wfx/bus_sdio.c | 2 +- drivers/staging/wfx/bus_spi.c | 2 +- drivers/staging/wfx/sta.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/wfx/bh.c +1 -1
@@ -76,7 +76,7 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf) hif = (struct hif_msg *)skb->data;WARN (hif->encrypted &0x1 ,"unsupported encryption type" );if (hif->encrypted ==0x2 ) { -if (wfx_sl_decode (wdev, (void *)hif)) { +if (wfx_sl_decode (wdev, hif)) {dev_kfree_skb (skb);// If frame was a confirmation, expect trouble in next // exchange. However, it is harmless to fail to decode
drivers/staging/wfx/bus_sdio.c +1 -1
@@ -66,7 +66,7 @@ static int wfx_sdio_copy_to_io(void *priv, unsigned int reg_id,if (reg_id ==WFX_REG_IN_OUT_QUEUE ) sdio_addr |= bus->buf_id_tx <<7 ;// FIXME: discards 'const' qualifier for src - ret =sdio_memcpy_toio (bus->func, sdio_addr, (void *)src, count); + ret =sdio_memcpy_toio (bus->func, sdio_addr, src, count);if (!ret && reg_id ==WFX_REG_IN_OUT_QUEUE ) bus->buf_id_tx = (bus->buf_id_tx +1 ) %32 ;
drivers/staging/wfx/bus_spi.c +1 -1
@@ -90,7 +90,7 @@ static int wfx_spi_copy_to_io(void *priv, unsigned int addr,struct wfx_spi_priv *bus = priv;u16 regaddr = (addr <<12 ) | (count /2 );// FIXME: use a bounce buffer -u16 *src16 = (void *)src; +u16 *src16 = src;int ret, i;struct spi_message m;struct spi_transfer t_addr = {
drivers/staging/wfx/sta.c +1 -1
@@ -896,7 +896,7 @@ static int wfx_upload_beacon(struct wfx_vif *wvif)/* TODO: Distill probe resp; remove TIM and any other beacon-specific * IEs */ - mgmt = (void *)skb->data; + mgmt = skb->data; mgmt->frame_control =cpu_to_le16 (IEEE80211_FTYPE_MGMT |IEEE80211_STYPE_PROBE_RESP );
Signature · 1 line
2.21.0
Quoted 59 lines · On Monday 21 October 2019 14:24:49 CEST Jules Irenge wrote:
Remove unnecessary void pointers.
Issue detected and solved by coccinelle tool.
semantic use
@@expression e ;@@(quoted diff) +1
-1-(void*)(e) +eSigned-off-by Jules Irenge <[email protected]>--- drivers/staging/wfx/bh.c | 2 +- drivers/staging/wfx/bus_sdio.c | 2 +- drivers/staging/wfx/bus_spi.c | 2 +- drivers/staging/wfx/sta.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)drivers/staging/wfx/bh.c +1
-1@@ -76,7 +76,7 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf) hif = (struct hif_msg *)skb->data;WARN (hif->encrypted &0x1 ,"unsupported encryption type" );if (hif->encrypted ==0x2 ) { -if (wfx_sl_decode (wdev, (void *)hif)) { +if (wfx_sl_decode (wdev, hif)) {dev_kfree_skb (skb);// If frame was a confirmation, expect trouble in next // exchange. However, it is harmless to fail to decode drivers/staging/wfx/bus_sdio.c +1
-1@@ -66,7 +66,7 @@ static int wfx_sdio_copy_to_io(void *priv, unsigned int reg_id,if (reg_id ==WFX_REG_IN_OUT_QUEUE ) sdio_addr |= bus->buf_id_tx <<7 ;// FIXME: discards 'const' qualifier for src - ret =sdio_memcpy_toio (bus->func, sdio_addr, (void *)src, count); + ret =sdio_memcpy_toio (bus->func, sdio_addr, src, count);if (!ret && reg_id ==WFX_REG_IN_OUT_QUEUE ) bus->buf_id_tx = (bus->buf_id_tx +1 ) %32 ;drivers/staging/wfx/bus_spi.c +1
-1@@ -90,7 +90,7 @@ static int wfx_spi_copy_to_io(void *priv, unsigned int addr,struct wfx_spi_priv *bus = priv;u16 regaddr = (addr <<12 ) | (count /2 );// FIXME: use a bounce buffer -u16 *src16 = (void *)src; +u16 *src16 = src;int ret, i;struct spi_message m;struct spi_transfer t_addr = {drivers/staging/wfx/sta.c +0
-0
drivers/staging/wfx/sta.c static int wfx_upload_beacon(struct wfx_vif *wvif) · line 902
Quoted 8 lines
drivers/staging/wfx/sta.c +1
-1@@ -896,7 +896,7 @@ static int wfx_upload_beacon(struct wfx_vif *wvif)/* TODO: Distill probe resp; remove TIM and any other beacon-specific * IEs */ - mgmt = (void *)skb->data; + mgmt = skb->data; mgmt->frame_control =cpu_to_le16 (IEEE80211_FTYPE_MGMT |IEEE80211_STYPE_PROBE_RESP );
Hello Jules,
Thank you for your work.
Did you check that the code continue to compile without warnings after applying this patch?
Signature · 1 line
Jérôme Pouiller
Quoted 70 lines · Jerome Pouiller
Quoted 59 lines · On Monday 21 October 2019 14:24:49 CEST Jules Irenge wrote:
Remove unnecessary void pointers.
Issue detected and solved by coccinelle tool.
semantic use
@@expression e ;@@(quoted diff) +1
-1-(void*)(e) +eSigned-off-by Jules Irenge <[email protected]>--- drivers/staging/wfx/bh.c | 2 +- drivers/staging/wfx/bus_sdio.c | 2 +- drivers/staging/wfx/bus_spi.c | 2 +- drivers/staging/wfx/sta.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)drivers/staging/wfx/bh.c +1
-1@@ -76,7 +76,7 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf) hif = (struct hif_msg *)skb->data;WARN (hif->encrypted &0x1 ,"unsupported encryption type" );if (hif->encrypted ==0x2 ) { -if (wfx_sl_decode (wdev, (void *)hif)) { +if (wfx_sl_decode (wdev, hif)) {dev_kfree_skb (skb);// If frame was a confirmation, expect trouble in next // exchange. However, it is harmless to fail to decode drivers/staging/wfx/bus_sdio.c +1
-1@@ -66,7 +66,7 @@ static int wfx_sdio_copy_to_io(void *priv, unsigned int reg_id,if (reg_id ==WFX_REG_IN_OUT_QUEUE ) sdio_addr |= bus->buf_id_tx <<7 ;// FIXME: discards 'const' qualifier for src - ret =sdio_memcpy_toio (bus->func, sdio_addr, (void *)src, count); + ret =sdio_memcpy_toio (bus->func, sdio_addr, src, count);if (!ret && reg_id ==WFX_REG_IN_OUT_QUEUE ) bus->buf_id_tx = (bus->buf_id_tx +1 ) %32 ;drivers/staging/wfx/bus_spi.c +1
-1@@ -90,7 +90,7 @@ static int wfx_spi_copy_to_io(void *priv, unsigned int addr,struct wfx_spi_priv *bus = priv;u16 regaddr = (addr <<12 ) | (count /2 );// FIXME: use a bounce buffer -u16 *src16 = (void *)src; +u16 *src16 = src;int ret, i;struct spi_message m;struct spi_transfer t_addr = {drivers/staging/wfx/sta.c +0
-0drivers/staging/wfx/sta.c static int wfx_upload_beacon(struct wfx_vif *wvif) · line 902
Quoted 8 lines
drivers/staging/wfx/sta.c +1
-1@@ -896,7 +896,7 @@ static int wfx_upload_beacon(struct wfx_vif *wvif)/* TODO: Distill probe resp; remove TIM and any other beacon-specific * IEs */ - mgmt = (void *)skb->data; + mgmt = skb->data; mgmt->frame_control =cpu_to_le16 (IEEE80211_FTYPE_MGMT |IEEE80211_STYPE_PROBE_RESP );Hello Jules,
Quoted 9 lines
Thank you for your work.
Did you check that the code continue to compile without warnings after applying this patch?
Signature · 1 line
J�r�me Pouiller
No,
I just checked now and it does not compile complaining of missing pointer argument on wsl wfx_sl_encode function.
Thanks for the feedback.
Jules