staging: mt7621-pinctrl: use ternary operator return in rt2880_get_group_name
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Thu, 28 Jun 2018 19:03:07 +0000 (21:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Jul 2018 15:33:43 +0000 (17:33 +0200)
Trivial change to have only one return in 'rt2880_get_group_name'
function using a ternary operator instead of an if statement and
two returns.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c

index c022718d8000a7f19e13bb21965505b51352961c..a15e8e8c0ed1ad4e11145ef393521b2e5d98244b 100644 (file)
@@ -54,10 +54,7 @@ static const char *rt2880_get_group_name(struct pinctrl_dev *pctrldev,
 {
        struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
 
-       if (group >= p->group_count)
-               return NULL;
-
-       return p->group_names[group];
+       return (group >= p->group_count) ? NULL : p->group_names[group];
 }
 
 static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev,