diff options
author | Vaishali Thakkar <vthakkar1994@gmail.com> | 2014-09-14 13:46:37 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-19 16:26:01 -0700 |
commit | 1703c17b8a02b7d1dd3080c4ce9d41a83e95a071 (patch) | |
tree | d067c1f3c35acc353e484f50c693dfa91d92ab31 /drivers/staging/rtl8188eu | |
parent | 16e614e85025d69c87e9ce80b9e1b5238f0f4479 (diff) | |
download | blackbird-obmc-linux-1703c17b8a02b7d1dd3080c4ce9d41a83e95a071.tar.gz blackbird-obmc-linux-1703c17b8a02b7d1dd3080c4ce9d41a83e95a071.zip |
Staging: rtl8188eu: os_dep: Compression of lines for immediate return
This patch compresses two lines in to a single line in file rtw_android.c
if immediate return statement is found. It also removes variable bytes_written 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: Vaishali Thakkar<vthakkar1994@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu')
-rw-r--r-- | drivers/staging/rtl8188eu/os_dep/rtw_android.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/staging/rtl8188eu/os_dep/rtw_android.c b/drivers/staging/rtl8188eu/os_dep/rtw_android.c index ca2736d60b62..1718229f6278 100644 --- a/drivers/staging/rtl8188eu/os_dep/rtw_android.c +++ b/drivers/staging/rtl8188eu/os_dep/rtw_android.c @@ -106,23 +106,18 @@ static int rtw_android_get_link_speed(struct net_device *net, char *command, int total_len) { struct adapter *padapter = (struct adapter *)rtw_netdev_priv(net); - int bytes_written; u16 link_speed; link_speed = rtw_get_cur_max_rate(padapter) / 10; - bytes_written = snprintf(command, total_len, "LinkSpeed %d", + return snprintf(command, total_len, "LinkSpeed %d", link_speed); - return bytes_written; } static int rtw_android_get_macaddr(struct net_device *net, char *command, int total_len) { - int bytes_written; - - bytes_written = snprintf(command, total_len, "Macaddr = %pM", + return snprintf(command, total_len, "Macaddr = %pM", net->dev_addr); - return bytes_written; } static int android_set_cntry(struct net_device *net, char *command, |