* [PATCH] w1: remove redundant initialization to variable result
@ 2021-07-21 10:34 Colin King
2023-05-08 8:59 ` Krzysztof Kozlowski
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-07-21 10:34 UTC (permalink / raw)
To: Evgeniy Polyakov; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable result is being initialized with a value that is never
read, it is being updated later on. The assignment is redundant and
can be removed.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/w1/w1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index f2ae2e563dc5..3c7817bd6744 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -501,7 +501,7 @@ static ssize_t w1_master_attribute_store_remove(struct device *dev,
struct w1_master *md = dev_to_w1_master(dev);
struct w1_reg_num rn;
struct w1_slave *sl;
- ssize_t result = count;
+ ssize_t result;
if (w1_atoreg_num(dev, buf, count, &rn))
return -EINVAL;
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] w1: remove redundant initialization to variable result
2021-07-21 10:34 [PATCH] w1: remove redundant initialization to variable result Colin King
@ 2023-05-08 8:59 ` Krzysztof Kozlowski
0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2023-05-08 8:59 UTC (permalink / raw)
To: Evgeniy Polyakov, Colin Ian King
Cc: Krzysztof Kozlowski, kernel-janitors, linux-kernel
On Wed, 21 Jul 2021 11:34:51 +0100, Colin King wrote:
> The variable result is being initialized with a value that is never
> read, it is being updated later on. The assignment is redundant and
> can be removed.
>
>
Applied, thanks!
[1/1] w1: remove redundant initialization to variable result
https://git.kernel.org/krzk/linux-w1/c/9033ff4c0fc65f3f168ee029b7e302a999c152ca
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-08 9:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21 10:34 [PATCH] w1: remove redundant initialization to variable result Colin King
2023-05-08 8:59 ` Krzysztof Kozlowski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.