All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] staging: wilc1000: remove cast on void pointers
@ 2016-02-13  6:49 Alison Schofield
  2016-02-13  6:51 ` [PATCH 1/4] staging: wilc1000: host_interface: " Alison Schofield
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Alison Schofield @ 2016-02-13  6:49 UTC (permalink / raw)
  To: outreachy-kernel

Patchset removes casts on void pointers in wilc1000.
The patchset is separated by .c file. 

Alison Schofield (4):
  staging: wilc1000: host_interface: remove cast on void pointers
  staging: wilc1000: linux_mon: remove cast on void pointer
  staging: wilc1000: linux_wlan: remove cast on void pointers
  staging: wilc1000: wilc_wfi_cfgoperations: remove cast on void
    pointers

 drivers/staging/wilc1000/host_interface.c         |  4 ++--
 drivers/staging/wilc1000/linux_mon.c              |  2 +-
 drivers/staging/wilc1000/linux_wlan.c             | 10 +++++-----
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 12 ++++++------
 4 files changed, 14 insertions(+), 14 deletions(-)

-- 
2.1.4



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] staging: wilc1000: host_interface: remove cast on void pointers
  2016-02-13  6:49 [PATCH 0/4] staging: wilc1000: remove cast on void pointers Alison Schofield
@ 2016-02-13  6:51 ` Alison Schofield
  2016-02-13  6:52 ` [PATCH 2/4] staging: wilc1000: linux_mon: remove cast on void pointer Alison Schofield
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Alison Schofield @ 2016-02-13  6:51 UTC (permalink / raw)
  To: outreachy-kernel

Remove cast on void pointers. C programming language guarantees
the conversion from void pointer to any other pointer type.

Coccinelle patch:
@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 5570707..94135f1 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -957,7 +957,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 		return result;
 	}
 
-	ptstrJoinBssParam = (struct join_bss_param *)pstrHostIFconnectAttr->params;
+	ptstrJoinBssParam = pstrHostIFconnectAttr->params;
 	if (!ptstrJoinBssParam) {
 		PRINT_ER("Required BSSID not found\n");
 		result = -ENOENT;
@@ -2679,7 +2679,7 @@ static int hostIFthread(void *pvArg)
 {
 	u32 u32Ret;
 	struct host_if_msg msg;
-	struct wilc *wilc = (struct wilc*)pvArg;
+	struct wilc *wilc = pvArg;
 	struct wilc_vif *vif;
 
 	memset(&msg, 0, sizeof(struct host_if_msg));
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] staging: wilc1000: linux_mon: remove cast on void pointer
  2016-02-13  6:49 [PATCH 0/4] staging: wilc1000: remove cast on void pointers Alison Schofield
  2016-02-13  6:51 ` [PATCH 1/4] staging: wilc1000: host_interface: " Alison Schofield
@ 2016-02-13  6:52 ` Alison Schofield
  2016-02-13  6:53 ` [PATCH 3/4] staging: wilc1000: linux_wlan: remove cast on void pointers Alison Schofield
  2016-02-13  6:54 ` [PATCH 4/4] staging: wilc1000: wilc_wfi_cfgoperations: " Alison Schofield
  3 siblings, 0 replies; 5+ messages in thread
From: Alison Schofield @ 2016-02-13  6:52 UTC (permalink / raw)
  To: outreachy-kernel

Remove cast on void pointer. C programming language guarantees
the conversion from void pointer to any other pointer type.

Coccinelle patch:
@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
---
 drivers/staging/wilc1000/linux_mon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index e9bb0ec..ba702b2 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -137,7 +137,7 @@ struct tx_complete_mon_data {
 
 static void mgmt_tx_complete(void *priv, int status)
 {
-	struct tx_complete_mon_data *pv_data = (struct tx_complete_mon_data *)priv;
+	struct tx_complete_mon_data *pv_data = priv;
 	u8 *buf =  pv_data->buff;
 
 	if (status == 1) {
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] staging: wilc1000: linux_wlan: remove cast on void pointers
  2016-02-13  6:49 [PATCH 0/4] staging: wilc1000: remove cast on void pointers Alison Schofield
  2016-02-13  6:51 ` [PATCH 1/4] staging: wilc1000: host_interface: " Alison Schofield
  2016-02-13  6:52 ` [PATCH 2/4] staging: wilc1000: linux_mon: remove cast on void pointer Alison Schofield
@ 2016-02-13  6:53 ` Alison Schofield
  2016-02-13  6:54 ` [PATCH 4/4] staging: wilc1000: wilc_wfi_cfgoperations: " Alison Schofield
  3 siblings, 0 replies; 5+ messages in thread
From: Alison Schofield @ 2016-02-13  6:53 UTC (permalink / raw)
  To: outreachy-kernel

Remove casts on void pointers. C programming language guarantees
the conversion from void pointer to any other pointer type.

Coccinelle patch:
@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
---
 drivers/staging/wilc1000/linux_wlan.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index c11830f..a731b46 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -61,7 +61,7 @@ static const struct net_device_ops wilc_netdev_ops = {
 static int dev_state_ev_handler(struct notifier_block *this,
 				unsigned long event, void *ptr)
 {
-	struct in_ifaddr *dev_iface = (struct in_ifaddr *)ptr;
+	struct in_ifaddr *dev_iface = ptr;
 	struct wilc_priv *priv;
 	struct host_if_drv *hif_drv;
 	struct net_device *dev;
@@ -144,7 +144,7 @@ static irqreturn_t isr_uh_routine(int irq, void *user_data)
 {
 	struct wilc_vif *vif;
 	struct wilc *wilc;
-	struct net_device *dev = (struct net_device *)user_data;
+	struct net_device *dev = user_data;
 
 	vif = netdev_priv(dev);
 	wilc = vif->wilc;
@@ -160,7 +160,7 @@ static irqreturn_t isr_bh_routine(int irq, void *userdata)
 {
 	struct wilc_vif *vif;
 	struct wilc *wilc;
-	struct net_device *dev = (struct net_device *)userdata;
+	struct net_device *dev = userdata;
 
 	vif = netdev_priv(userdata);
 	wilc = vif->wilc;
@@ -235,7 +235,7 @@ int wilc_lock_timeout(struct wilc *nic, void *vp, u32 timeout)
 	int error = -1;
 
 	if (vp)
-		error = down_timeout((struct semaphore *)vp,
+		error = down_timeout(vp,
 				     msecs_to_jiffies(timeout));
 	return error;
 }
@@ -1038,7 +1038,7 @@ static void wilc_set_multicast_list(struct net_device *dev)
 
 static void linux_wlan_tx_complete(void *priv, int status)
 {
-	struct tx_complete_data *pv_data = (struct tx_complete_data *)priv;
+	struct tx_complete_data *pv_data = priv;
 
 	dev_kfree_skb(pv_data->skb);
 	kfree(pv_data);
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] staging: wilc1000: wilc_wfi_cfgoperations: remove cast on void pointers
  2016-02-13  6:49 [PATCH 0/4] staging: wilc1000: remove cast on void pointers Alison Schofield
                   ` (2 preceding siblings ...)
  2016-02-13  6:53 ` [PATCH 3/4] staging: wilc1000: linux_wlan: remove cast on void pointers Alison Schofield
@ 2016-02-13  6:54 ` Alison Schofield
  3 siblings, 0 replies; 5+ messages in thread
From: Alison Schofield @ 2016-02-13  6:54 UTC (permalink / raw)
  To: outreachy-kernel

Remove cast on void pointers. C programming language guarantees
the conversion from void pointer to any other pointer type.

Coccinelle patch:
@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 97d1b80..81a2ee9 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -228,7 +228,7 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan)
 	int i;
 	int rssi = 0;
 
-	priv = (struct wilc_priv *)user_void;
+	priv = user_void;
 	wiphy = priv->dev->ieee80211_ptr->wiphy;
 
 	for (i = 0; i < last_scanned_cnt; i++) {
@@ -404,7 +404,7 @@ static void CfgScanResult(enum scan_event scan_event,
 	struct ieee80211_channel *channel;
 	struct cfg80211_bss *bss = NULL;
 
-	priv = (struct wilc_priv *)user_void;
+	priv = user_void;
 	if (priv->bCfgScanning) {
 		if (scan_event == SCAN_EVENT_NETWORK_FOUND) {
 			wiphy = priv->dev->ieee80211_ptr->wiphy;
@@ -525,7 +525,7 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent,
 
 	wilc_connecting = 0;
 
-	priv = (struct wilc_priv *)pUserVoid;
+	priv = pUserVoid;
 	dev = priv->dev;
 	vif = netdev_priv(dev);
 	wl = vif->wilc;
@@ -1713,7 +1713,7 @@ void WILC_WFI_p2p_rx (struct net_device *dev, u8 *buff, u32 size)
 
 static void WILC_WFI_mgmt_tx_complete(void *priv, int status)
 {
-	struct p2p_mgmt_data *pv_data = (struct p2p_mgmt_data *)priv;
+	struct p2p_mgmt_data *pv_data = priv;
 
 
 	kfree(pv_data->buff);
@@ -1724,7 +1724,7 @@ static void WILC_WFI_RemainOnChannelReady(void *pUserVoid)
 {
 	struct wilc_priv *priv;
 
-	priv = (struct wilc_priv *)pUserVoid;
+	priv = pUserVoid;
 
 	priv->bInP2PlistenState = true;
 
@@ -1739,7 +1739,7 @@ static void WILC_WFI_RemainOnChannelExpired(void *pUserVoid, u32 u32SessionID)
 {
 	struct wilc_priv *priv;
 
-	priv = (struct wilc_priv *)pUserVoid;
+	priv = pUserVoid;
 
 	if (u32SessionID == priv->strRemainOnChanParams.u32ListenSessionID) {
 		priv->bInP2PlistenState = false;
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-02-13  6:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-13  6:49 [PATCH 0/4] staging: wilc1000: remove cast on void pointers Alison Schofield
2016-02-13  6:51 ` [PATCH 1/4] staging: wilc1000: host_interface: " Alison Schofield
2016-02-13  6:52 ` [PATCH 2/4] staging: wilc1000: linux_mon: remove cast on void pointer Alison Schofield
2016-02-13  6:53 ` [PATCH 3/4] staging: wilc1000: linux_wlan: remove cast on void pointers Alison Schofield
2016-02-13  6:54 ` [PATCH 4/4] staging: wilc1000: wilc_wfi_cfgoperations: " Alison Schofield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.