linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] w1: ds2438: remove redundant initialization of variable crc
@ 2022-05-22 19:46 Colin Ian King
  2023-05-08  8:59 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-05-22 19:46 UTC (permalink / raw)
  To: Evgeniy Polyakov; +Cc: kernel-janitors, linux-kernel

Variable crc is being initialized with a value that is never read,
it is being re-assigned later on. The initialization is redundant
and can be removed.

Cleans up clang scan build warning:
warning: Value stored to 'crc' is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/w1/slaves/w1_ds2438.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index ca64f99c8f3d..e008c27b3db9 100644
--- a/drivers/w1/slaves/w1_ds2438.c
+++ b/drivers/w1/slaves/w1_ds2438.c
@@ -66,8 +66,6 @@ static int w1_ds2438_get_page(struct w1_slave *sl, int pageno, u8 *buf)
 	size_t count;
 
 	while (retries--) {
-		crc = 0;
-
 		if (w1_reset_select_slave(sl))
 			continue;
 		w1_buf[0] = W1_DS2438_RECALL_MEMORY;
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] w1: ds2438: remove redundant initialization of variable crc
  2022-05-22 19:46 [PATCH] w1: ds2438: remove redundant initialization of variable crc Colin Ian 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 Sun, 22 May 2022 20:46:22 +0100, Colin Ian King wrote:
> Variable crc is being initialized with a value that is never read,
> it is being re-assigned later on. The initialization is redundant
> and can be removed.
> 
> Cleans up clang scan build warning:
> warning: Value stored to 'crc' is never read [deadcode.DeadStores]
> 
> [...]

Applied, thanks!

[1/1] w1: ds2438: remove redundant initialization of variable crc
      https://git.kernel.org/krzk/linux-w1/c/ee896c5bf21cbac3bed8f958507a449168e965d3

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 --
2022-05-22 19:46 [PATCH] w1: ds2438: remove redundant initialization of variable crc Colin Ian King
2023-05-08  8:59 ` Krzysztof Kozlowski

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).