diff options
author | Rehas Sachdeva <aquannie@gmail.com> | 2016-09-20 03:46:37 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-20 07:41:51 -0400 |
commit | 106d43f18819f69784ddf216b5f05a84a03c0d38 (patch) | |
tree | cb61ca665b70006b08b6aaa0c191bffa53ef31cf /drivers/staging | |
parent | dc0283c7bc85669a52963d38553411d30a19a2f2 (diff) |
staging: dgnc: Merge assignment with return
Instead of storing the return value of a function call into a variable and
then returning it, we can club the two into a single return statement. This
change was made using the following semantic patch by Coccinelle:
@@
local idexpression ret;
expression e;
@@
-ret =
+return
e;
-return ret;
Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/dgnc/dgnc_tty.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index fd46ef0f5dcd..1c1ac8427b6e 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c | |||
@@ -2548,9 +2548,8 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, | |||
2548 | 2548 | ||
2549 | spin_unlock_irqrestore(&ch->ch_lock, flags); | 2549 | spin_unlock_irqrestore(&ch->ch_lock, flags); |
2550 | 2550 | ||
2551 | rc = put_user(C_CLOCAL(tty) ? 1 : 0, | 2551 | return put_user(C_CLOCAL(tty) ? 1 : 0, |
2552 | (unsigned long __user *)arg); | 2552 | (unsigned long __user *)arg); |
2553 | return rc; | ||
2554 | 2553 | ||
2555 | case TIOCSSOFTCAR: | 2554 | case TIOCSSOFTCAR: |
2556 | 2555 | ||
@@ -2721,8 +2720,8 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, | |||
2721 | 2720 | ||
2722 | case DIGI_GETCUSTOMBAUD: | 2721 | case DIGI_GETCUSTOMBAUD: |
2723 | spin_unlock_irqrestore(&ch->ch_lock, flags); | 2722 | spin_unlock_irqrestore(&ch->ch_lock, flags); |
2724 | rc = put_user(ch->ch_custom_speed, (unsigned int __user *)arg); | 2723 | return put_user(ch->ch_custom_speed, |
2725 | return rc; | 2724 | (unsigned int __user *)arg); |
2726 | 2725 | ||
2727 | case DIGI_SETCUSTOMBAUD: | 2726 | case DIGI_SETCUSTOMBAUD: |
2728 | { | 2727 | { |
@@ -2808,8 +2807,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, | |||
2808 | events |= (EV_IPU | EV_IPS); | 2807 | events |= (EV_IPU | EV_IPS); |
2809 | 2808 | ||
2810 | spin_unlock_irqrestore(&ch->ch_lock, flags); | 2809 | spin_unlock_irqrestore(&ch->ch_lock, flags); |
2811 | rc = put_user(events, (unsigned int __user *)arg); | 2810 | return put_user(events, (unsigned int __user *)arg); |
2812 | return rc; | ||
2813 | } | 2811 | } |
2814 | 2812 | ||
2815 | /* | 2813 | /* |