Skip to contentSkip to conversation

w1: ds2438: remove redundant initialization of variable crc

PATCH Applied Colin Ian King 2 participants 2 messages May 22, 2022 – May 8, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 w1: ds2438: remove redundant initialization of variable crc

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]

---
 drivers/w1/slaves/w1_ds2438.c | 2 --
 1 file changed, 2 deletions(-)
drivers/w1/slaves/w1_ds2438.c +0 -2
index ca64f99c8f3d..e008c27b3db9 100644
@@ -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;
Signature · 1 line
2.35.3
#1 lore raw
Quoted 8 lines · Colin Ian King

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,

Signature · 1 line
Krzysztof Kozlowski <[email protected]>