From: Johan Hovold Date: Mon, 4 May 2015 15:10:42 +0000 (+0200) Subject: gpio: sysfs: clean up edge_store X-Git-Tag: v4.2-rc1~158^2~38 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e4339ce32372e2f8c98222c0923b79476c29a309;p=karo-tx-linux.git gpio: sysfs: clean up edge_store Remove goto from success path. Signed-off-by: Johan Hovold Reviewed-by: Alexandre Courbot Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index d9b3faa01fee..1161a46618dd 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -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);