gpiolib: Get rid of redundant 'else'
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 30 Mar 2022 15:06:20 +0000 (18:06 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:30 +0000 (13:14 +0100)
commitb0a26e199964cf659aa8b4b990f3f6b840ce9def
tree1cbdfc90477f413d204d1cbfda6041e7982085b9
parent4bc217b25ea81034fad8e33fd33e4659f086421d
gpiolib: Get rid of redundant 'else'

[ Upstream commit 1cef8b5019769d46725932eeace7a383bca97905 ]

In the snippets like the following

if (...)
return / goto / break / continue ...;
else
...

the 'else' is redundant. Get rid of it. In case of IOCTLs use
switch-case pattern that seems the usual in such cases.

While at it, clarify necessity of else in gpiod_direction_output()
by attaching else if to the closing curly brace on a previous line.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Stable-dep-of: 533aae7c94db ("gpiolib: cdev: fix NULL-pointer dereferences")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpiolib-cdev.c
drivers/gpio/gpiolib.c