gpio: sysfs: clean up edge_store
authorJohan Hovold <johan@kernel.org>
Mon, 4 May 2015 15:10:42 +0000 (17:10 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 12 May 2015 08:47:31 +0000 (10:47 +0200)
Remove goto from success path.

Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib-sysfs.c

index d9b3faa01feeca2b6d21ce330cc52646ecf910d5..1161a46618dd3d4958cd22422747218652923e92 100644 (file)
@@ -236,14 +236,16 @@ static ssize_t edge_store(struct device *dev,
        struct gpio_desc *desc = data->desc;
        unsigned long flags;
        ssize_t status = size;
-       int                     i;
+       int i;
 
-       for (i = 0; i < ARRAY_SIZE(trigger_types); i++)
+       for (i = 0; i < ARRAY_SIZE(trigger_types); i++) {
                if (sysfs_streq(trigger_types[i].name, buf))
-                       goto found;
-       return -EINVAL;
+                       break;
+       }
+
+       if (i == ARRAY_SIZE(trigger_types))
+               return -EINVAL;
 
-found:
        flags = trigger_types[i].flags;
 
        mutex_lock(&sysfs_lock);