diff mbox series

[next] gpiolib: remove redundant initialization of pointer desc

Message ID 20180116115611.24962-1-colin.king@canonical.com
State New
Headers show
Series [next] gpiolib: remove redundant initialization of pointer desc | expand

Commit Message

Colin Ian King Jan. 16, 2018, 11:56 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The initialized value stored in pointer desc is never read as it
is updated in the first executable statement in the function.
This is therefore redundant and can be removed.

Cleans up clang warning:
drivers/gpio/gpiolib.c:3710:20: warning: Value stored to 'desc'
during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpio/gpiolib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij Jan. 16, 2018, 11:19 p.m. UTC | #1
On Tue, Jan 16, 2018 at 12:56 PM, Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
>
> The initialized value stored in pointer desc is never read as it
> is updated in the first executable statement in the function.
> This is therefore redundant and can be removed.
>
> Cleans up clang warning:
> drivers/gpio/gpiolib.c:3710:20: warning: Value stored to 'desc'
> during its initialization is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 39a0144d5be5..b4c833b3d4e0 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -3707,7 +3707,7 @@  struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
 					 enum gpiod_flags dflags,
 					 const char *label)
 {
-	struct gpio_desc *desc = ERR_PTR(-ENODEV);
+	struct gpio_desc *desc;
 	unsigned long lflags = 0;
 	enum of_gpio_flags flags;
 	bool active_low = false;