Skip to content

Commit 1b590af

Browse files
simransinghalgregkh
authored andcommitted
staging: rtl8723bs: rtw_cmd: Compress lines for immediate return
Compress two lines into a single line if immediate return statement is found. It also removes variable cmd_obj as it is no longer needed. It is done using script Coccinelle. And coccinelle uses following semantic patch for this compression function: @@ expression ret; identifier f; @@ -ret = +return f(...); -return ret; Signed-off-by: Simran Singhal <[email protected]> Link: https://lore.kernel.org/r/20200325212253.GA8175@simran-Inspiron-5558 Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f465b0a commit 1b590af

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

drivers/staging/rtl8723bs/core/rtw_cmd.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,7 @@ int rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
362362

363363
struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv)
364364
{
365-
struct cmd_obj *cmd_obj;
366-
367-
cmd_obj = _rtw_dequeue_cmd(&pcmdpriv->cmd_queue);
368-
369-
return cmd_obj;
365+
return _rtw_dequeue_cmd(&pcmdpriv->cmd_queue);
370366
}
371367

372368
void rtw_free_cmd_obj(struct cmd_obj *pcmd)

0 commit comments

Comments
 (0)