diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2016-02-26 15:34:32 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-05 14:48:04 -0800 |
commit | 6c6baa841662e1ab46353fee3c618d9f347ce06e (patch) | |
tree | bb60440e05c1c7c798411e5f4bb760fdfc8edcbe /drivers/staging/gdm724x | |
parent | bd743442237226ae2a5bf3bd4d7edce71f66788e (diff) | |
download | linux-stable-6c6baa841662e1ab46353fee3c618d9f347ce06e.tar.gz linux-stable-6c6baa841662e1ab46353fee3c618d9f347ce06e.tar.bz2 linux-stable-6c6baa841662e1ab46353fee3c618d9f347ce06e.zip |
Staging: gdm724x: Use min instead of ternary operator
This patch replaces ternary operator with macro min as it shorter and
thus increases code readability. Macro min return the minimum of the
two compared values.
Made a semantic patch for changes:
@@
type T;
T x;
T y;
@@
(
- x < y ? x : y
+ min(x,y)
|
- x > y ? x : y
+ max(x,y)
)
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/gdm724x')
-rw-r--r-- | drivers/staging/gdm724x/gdm_mux.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/gdm724x/gdm_mux.c b/drivers/staging/gdm724x/gdm_mux.c index 937010b3a603..6bedd668324c 100644 --- a/drivers/staging/gdm724x/gdm_mux.c +++ b/drivers/staging/gdm724x/gdm_mux.c @@ -433,7 +433,7 @@ static int gdm_mux_send_control(void *priv_dev, int request, int value, if (ret < 0) pr_err("usb_control_msg error: %d\n", ret); - return ret < 0 ? ret : 0; + return min(ret, 0); } static void release_usb(struct mux_dev *mux_dev) |