From: navin patidar Date: Thu, 10 Jul 2014 03:42:04 +0000 (+0530) Subject: staging: rtl8188eu: Remove members cmd_[allocated,]_buf from struct cmd_priv X-Git-Tag: firefly_0821_release~176^2~3491^2~1056 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=caeadfb0219e5fb6d4a1ee8ce5b61301560a014b;p=firefly-linux-kernel-4.4.55.git staging: rtl8188eu: Remove members cmd_[allocated,]_buf from struct cmd_priv Signed-off-by: navin patidar Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index aff252859b01..7d34315e99f3 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -32,39 +32,18 @@ No irqsave is necessary. int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) { - int res = _SUCCESS; - - sema_init(&(pcmdpriv->cmd_queue_sema), 0); - /* sema_init(&(pcmdpriv->cmd_done_sema), 0); */ sema_init(&(pcmdpriv->terminate_cmdthread_sema), 0); - _rtw_init_queue(&(pcmdpriv->cmd_queue)); - /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */ - pcmdpriv->cmd_seq = 1; - - pcmdpriv->cmd_allocated_buf = kzalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ, GFP_KERNEL); - - if (pcmdpriv->cmd_allocated_buf == NULL) { - res = _FAIL; - goto exit; - } - - pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ((size_t)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ-1)); - -exit: - return res; + return _SUCCESS; } void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) { - if (pcmdpriv) { - kfree(pcmdpriv->cmd_allocated_buf); - } } /* @@ -192,7 +171,6 @@ int rtw_cmd_thread(void *context) { u8 ret; struct cmd_obj *pcmd; - u8 *pcmdbuf; u8 (*cmd_hdl)(struct adapter *padapter, u8 *pbuf); void (*pcmd_callback)(struct adapter *dev, struct cmd_obj *pcmd); struct adapter *padapter = (struct adapter *)context; @@ -200,8 +178,6 @@ int rtw_cmd_thread(void *context) allow_signal(SIGTERM); - pcmdbuf = pcmdpriv->cmd_buf; - pcmdpriv->cmdthd_running = true; up(&pcmdpriv->terminate_cmdthread_sema); @@ -234,15 +210,11 @@ _next: goto post_process; } - pcmd->cmdsz = round_up(pcmd->cmdsz, 4); - - memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz); - if (pcmd->cmdcode < ARRAY_SIZE(wlancmds)) { cmd_hdl = wlancmds[pcmd->cmdcode].h2cfuns; if (cmd_hdl) { - ret = cmd_hdl(pcmd->padapter, pcmdbuf); + ret = cmd_hdl(pcmd->padapter, pcmd->parmbuf); pcmd->res = ret; } diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index d8817108fe82..08b371d9246d 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -48,8 +48,6 @@ struct cmd_priv { struct semaphore terminate_cmdthread_sema; struct __queue cmd_queue; u8 cmd_seq; - u8 *cmd_buf; /* shall be non-paged, and 4 bytes aligned */ - u8 *cmd_allocated_buf; u8 cmdthd_running; struct adapter *padapter; };