Skip to contentSkip to conversation

mmc: wbsd: remove redundant assignment to variable id

PATCH Superseded Colin Ian King 2 participants 2 messages Feb 5, 2024 – Feb 6, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: wbsd: remove redundant assignment to variable id

The variable id 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:
drivers/mmc/host/wbsd.c:1287:4: warning: Value stored to 'id' is never read [deadcode.DeadStores]

---
 drivers/mmc/host/wbsd.c | 2 --
 1 file changed, 2 deletions(-)
drivers/mmc/host/wbsd.c +0 -2
index 001a468bc149..f0562f712d98 100644
@@ -1284,8 +1284,6 @@ static int wbsd_scan(struct wbsd_host *host)
 			continue;
 
 		for (j = 0; j < ARRAY_SIZE(unlock_codes); j++) {
-			id = 0xFFFF;
-
 			host->config = config_ports[i];
 			host->unlock_code = unlock_codes[j];
 
Signature · 1 line
2.39.2
#1 lore raw
Quoted 19 lines · Colin Ian King

The variable id 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:
drivers/mmc/host/wbsd.c:1287:4: warning: Value stored to 'id' is never read [deadcode.DeadStores]

---
 drivers/mmc/host/wbsd.c | 2 --
 1 file changed, 2 deletions(-)
drivers/mmc/host/wbsd.c +0 -0
index 001a468bc149..f0562f712d98 100644

drivers/mmc/host/wbsd.c static int wbsd_scan(struct wbsd_host *host) · line 1288

Quoted 7 lines
drivers/mmc/host/wbsd.c +0 -2
@@ -1284,8 +1284,6 @@ static int wbsd_scan(struct wbsd_host *host)
                        continue;
 
                for (j = 0; j < ARRAY_SIZE(unlock_codes); j++) {
-                       id = 0xFFFF;
-
                        host->config = config_ports[i];
                        host->unlock_code = unlock_codes[j];

A few lines down there is check "if (id != 0xFFFF)". Looks like that is a redundant check. Would you mind cleaning up that part too, as a part of the $subject patch?

Kind regards
Uffe