* [PATCH][next] gpiolib: remove redundant initialization of pointer desc
@ 2018-01-16 11:56 Colin King
2018-01-16 23:19 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-01-16 11:56 UTC (permalink / raw)
To: Linus Walleij, linux-gpio; +Cc: kernel-janitors, linux-kernel
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(-)
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;
--
2.15.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][next] gpiolib: remove redundant initialization of pointer desc
2018-01-16 11:56 [PATCH][next] gpiolib: remove redundant initialization of pointer desc Colin King
@ 2018-01-16 23:19 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2018-01-16 23:19 UTC (permalink / raw)
To: Colin King; +Cc: linux-gpio, kernel-janitors, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-16 23:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-16 11:56 [PATCH][next] gpiolib: remove redundant initialization of pointer desc Colin King
2018-01-16 23:19 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).