diff options
author | Nishka Dasgupta <nishkadg.linux@gmail.com> | 2019-07-12 11:58:05 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-07-22 07:34:12 +0200 |
commit | 53055d6a915cb1753334dc18d6249f8b4ac62d88 (patch) | |
tree | 1a9486f4ce955590c33485b87722975a296b7541 /drivers/staging/wlan-ng | |
parent | aef29ca497f005fe3cd38aefc77639dc551bbd18 (diff) |
staging: wlan-ng: Remove function hfa384x_docmd_wait()
As hfa384x_docmd is only called by hfa384x_docmd_wait, and
hfa384x_docmd_wait always passes 4 constant arguments (DOWAIT,
NULL, NULL, NULL) to hfa384x_docmd, these constant parameters may be
removed from hfa384x_docmd and their values used directly instead.
Remove check for one of these constant parameters of hfa384x_docmd as
it is no longer necessary.
Remove hfa384x_docmd_wait as it does nothing except call hfa384x_docmd.
Modify call sites of hfa384x_docmd_wait to call hfa384x_docmd instead.
Change type of hfa384x_docmd to inline to match type of former
hfa384x_docmd_wait.
Issue found with Coccinelle.
Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712062807.9361-8-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wlan-ng')
-rw-r--r-- | drivers/staging/wlan-ng/hfa384x_usb.c | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index ce1a9ee995a0..c469b89948e6 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -226,11 +226,9 @@ usbctlx_get_rridresult(const struct hfa384x_usb_rridresp *rridresp, /*---------------------------------------------------*/ /* Low level req/resp CTLX formatters and submitters */ -static int +static inline int hfa384x_docmd(struct hfa384x *hw, - enum cmd_mode mode, - struct hfa384x_metacmd *cmd, - ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data); + struct hfa384x_metacmd *cmd); static int hfa384x_dorrid(struct hfa384x *hw, @@ -820,12 +818,6 @@ static void hfa384x_cb_status(struct hfa384x *hw, } } -static inline int hfa384x_docmd_wait(struct hfa384x *hw, - struct hfa384x_metacmd *cmd) -{ - return hfa384x_docmd(hw, DOWAIT, cmd, NULL, NULL, NULL); -} - static inline int hfa384x_dormem_wait(struct hfa384x *hw, u16 page, u16 offset, void *data, unsigned int len) @@ -873,7 +865,7 @@ int hfa384x_cmd_initialize(struct hfa384x *hw) cmd.parm1 = 0; cmd.parm2 = 0; - result = hfa384x_docmd_wait(hw, &cmd); + result = hfa384x_docmd(hw, &cmd); pr_debug("cmdresp.init: status=0x%04x, resp0=0x%04x, resp1=0x%04x, resp2=0x%04x\n", cmd.result.status, @@ -919,7 +911,7 @@ int hfa384x_cmd_disable(struct hfa384x *hw, u16 macport) cmd.parm1 = 0; cmd.parm2 = 0; - return hfa384x_docmd_wait(hw, &cmd); + return hfa384x_docmd(hw, &cmd); } /*---------------------------------------------------------------- @@ -953,7 +945,7 @@ int hfa384x_cmd_enable(struct hfa384x *hw, u16 macport) cmd.parm1 = 0; cmd.parm2 = 0; - return hfa384x_docmd_wait(hw, &cmd); + return hfa384x_docmd(hw, &cmd); } /*---------------------------------------------------------------- @@ -996,7 +988,7 @@ int hfa384x_cmd_monitor(struct hfa384x *hw, u16 enable) cmd.parm1 = 0; cmd.parm2 = 0; - return hfa384x_docmd_wait(hw, &cmd); + return hfa384x_docmd(hw, &cmd); } /*---------------------------------------------------------------- @@ -1053,7 +1045,7 @@ int hfa384x_cmd_download(struct hfa384x *hw, u16 mode, u16 lowaddr, cmd.parm1 = highaddr; cmd.parm2 = codelen; - return hfa384x_docmd_wait(hw, &cmd); + return hfa384x_docmd(hw, &cmd); } /*---------------------------------------------------------------- @@ -1213,13 +1205,8 @@ cleanup: * * Arguments: * hw device structure - * mode DOWAIT or DOASYNC * cmd cmd structure. Includes all arguments and result * data points. All in host order. in host order - * cmdcb command-specific callback - * usercb user callback for async calls, NULL for DOWAIT calls - * usercb_data user supplied data pointer for async calls, NULL - * for DOWAIT calls * * Returns: * 0 success @@ -1235,11 +1222,9 @@ cleanup: * process *---------------------------------------------------------------- */ -static int +static inline int hfa384x_docmd(struct hfa384x *hw, - enum cmd_mode mode, - struct hfa384x_metacmd *cmd, - ctlx_cmdcb_t cmdcb, ctlx_usercb_t usercb, void *usercb_data) + struct hfa384x_metacmd *cmd) { int result; struct hfa384x_usbctlx *ctlx; @@ -1262,15 +1247,15 @@ hfa384x_docmd(struct hfa384x *hw, pr_debug("cmdreq: cmd=0x%04x parm0=0x%04x parm1=0x%04x parm2=0x%04x\n", cmd->cmd, cmd->parm0, cmd->parm1, cmd->parm2); - ctlx->reapable = mode; - ctlx->cmdcb = cmdcb; - ctlx->usercb = usercb; - ctlx->usercb_data = usercb_data; + ctlx->reapable = DOWAIT; + ctlx->cmdcb = NULL; + ctlx->usercb = NULL; + ctlx->usercb_data = NULL; result = hfa384x_usbctlx_submit(hw, ctlx); if (result != 0) { kfree(ctlx); - } else if (mode == DOWAIT) { + } else { struct usbctlx_cmd_completor cmd_completor; struct usbctlx_completor *completor; |