Commit 1b590af9 authored by Simran Singhal's avatar Simran Singhal Committed by Greg Kroah-Hartman

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: default avatarSimran Singhal <singhalsimran0@gmail.com>
Link: https://lore.kernel.org/r/20200325212253.GA8175@simran-Inspiron-5558Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f465b0a4
......@@ -362,11 +362,7 @@ int rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv)
{
struct cmd_obj *cmd_obj;
cmd_obj = _rtw_dequeue_cmd(&pcmdpriv->cmd_queue);
return cmd_obj;
return _rtw_dequeue_cmd(&pcmdpriv->cmd_queue);
}
void rtw_free_cmd_obj(struct cmd_obj *pcmd)
......
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