Commit 7356f429 authored by nohee ko's avatar nohee ko Committed by Greg Kroah-Hartman

staging: brcm80211: brcmfmac: replace KILL_PROC with send_sig()

logic optimization : replace KILL_PROC with send_sig()
Signed-off-by: default avatarNohee Ko <noheek@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4c71ebf4
...@@ -2340,20 +2340,20 @@ void dhd_detach(dhd_pub_t *dhdp) ...@@ -2340,20 +2340,20 @@ void dhd_detach(dhd_pub_t *dhdp)
} }
if (dhd->watchdog_tsk) { if (dhd->watchdog_tsk) {
KILL_PROC(dhd->watchdog_tsk->pid, SIGTERM); send_sig(SIGTERM, dhd->watchdog_tsk, 1);
kthread_stop(dhd->watchdog_tsk); kthread_stop(dhd->watchdog_tsk);
dhd->watchdog_tsk = NULL; dhd->watchdog_tsk = NULL;
} }
if (dhd->dpc_tsk) { if (dhd->dpc_tsk) {
KILL_PROC(dhd->dpc_tsk->pid, SIGTERM); send_sig(SIGTERM, dhd->dpc_tsk, 1);
kthread_stop(dhd->dpc_tsk); kthread_stop(dhd->dpc_tsk);
dhd->dpc_tsk = NULL; dhd->dpc_tsk = NULL;
} else } else
tasklet_kill(&dhd->tasklet); tasklet_kill(&dhd->tasklet);
if (dhd->sysioc_tsk) { if (dhd->sysioc_tsk) {
KILL_PROC(dhd->sysioc_tsk->pid, SIGTERM); send_sig(SIGTERM, dhd->sysioc_tsk, 1);
kthread_stop(dhd->sysioc_tsk); kthread_stop(dhd->sysioc_tsk);
dhd->sysioc_tsk = NULL; dhd->sysioc_tsk = NULL;
} }
......
...@@ -2849,7 +2849,7 @@ static s32 wl_create_event_handler(struct wl_priv *wl) ...@@ -2849,7 +2849,7 @@ static s32 wl_create_event_handler(struct wl_priv *wl)
static void wl_destroy_event_handler(struct wl_priv *wl) static void wl_destroy_event_handler(struct wl_priv *wl)
{ {
if (wl->event_tsk) { if (wl->event_tsk) {
KILL_PROC(wl->event_tsk->pid, SIGTERM); send_sig(SIGTERM, wl->event_tsk, 1);
kthread_stop(wl->event_tsk); kthread_stop(wl->event_tsk);
wl->event_tsk = NULL; wl->event_tsk = NULL;
} }
...@@ -2861,7 +2861,7 @@ static void wl_term_iscan(struct wl_priv *wl) ...@@ -2861,7 +2861,7 @@ static void wl_term_iscan(struct wl_priv *wl)
if (wl->iscan_on && iscan->tsk) { if (wl->iscan_on && iscan->tsk) {
iscan->state = WL_ISCAN_STATE_IDLE; iscan->state = WL_ISCAN_STATE_IDLE;
KILL_PROC(iscan->tsk->pid, SIGTERM); send_sig(SIGTERM, iscan->tsk, 1);
kthread_stop(iscan->tsk); kthread_stop(iscan->tsk);
iscan->tsk = NULL; iscan->tsk = NULL;
} }
...@@ -3793,7 +3793,6 @@ static s32 __wl_cfg80211_up(struct wl_priv *wl) ...@@ -3793,7 +3793,6 @@ static s32 __wl_cfg80211_up(struct wl_priv *wl)
static s32 __wl_cfg80211_down(struct wl_priv *wl) static s32 __wl_cfg80211_down(struct wl_priv *wl)
{ {
struct net_device *ndev = wl_to_ndev(wl);
s32 err = 0; s32 err = 0;
/* Check if cfg80211 interface is already down */ /* Check if cfg80211 interface is already down */
......
...@@ -3745,7 +3745,7 @@ void wl_iw_detach(void) ...@@ -3745,7 +3745,7 @@ void wl_iw_detach(void)
if (!iscan) if (!iscan)
return; return;
if (iscan->sysioc_tsk) { if (iscan->sysioc_tsk) {
KILL_PROC(iscan->sysioc_tsk->pid, SIGTERM); send_sig(SIGTERM, iscan->sysioc_tsk, 1);
kthread_stop(iscan->sysioc_tsk); kthread_stop(iscan->sysioc_tsk);
iscan->sysioc_tsk = NULL; iscan->sysioc_tsk = NULL;
} }
......
...@@ -35,11 +35,4 @@ ...@@ -35,11 +35,4 @@
#undef IP_TOS #undef IP_TOS
#include <asm/io.h> #include <asm/io.h>
#define KILL_PROC(pid, sig) \
do { \
struct task_struct *tsk; \
tsk = pid_task(find_vpid(pid), PIDTYPE_PID); \
if (tsk) \
send_sig(sig, tsk, 1); \
} while (0)
#endif /* _linuxver_h_ */ #endif /* _linuxver_h_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment