Skip to contentSkip to conversation

scsi: st: remove redundant variable pointer stp

PATCH Applied Colin Ian King 2 participants 3 messages Aug 5, 2022 – Sep 1, 2022

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

PATCH 1/1 scsi: st: remove redundant variable pointer stp

Variable stp is assigned a value that is never read, the assignment and the variable stp are redundant and can be removed.

Cleans up clang scan build warning:
drivers/scsi/st.c:4253:7: warning: Although the value stored to 'stp' is used in the enclosing expression, the value is never actually read from 'stp' [deadcode.DeadStores]

---
 drivers/scsi/st.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/st.c +1 -2
index 850172a2b8f1..65f521b036c1 100644
@@ -4246,11 +4246,10 @@ static int st_probe(struct device *dev)
 	struct st_partstat *STps;
 	struct st_buffer *buffer;
 	int i, error;
-	char *stp;
 
 	if (SDp->type != TYPE_TAPE)
 		return -ENODEV;
-	if ((stp = st_incompatible(SDp))) {
+	if (st_incompatible(SDp)) {
 		sdev_printk(KERN_INFO, SDp,
 			    "OnStream tapes are no longer supported;\n");
 		sdev_printk(KERN_INFO, SDp,
Signature · 1 line
2.35.3
#1 lore raw

Colin,

Quoted 2 lines

Variable stp is assigned a value that is never read, the assignment and the variable stp are redundant and can be removed.

Applied to 6.1/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#2 lore raw
In reply to Colin Ian King
Quoted 9 lines · Colin Ian King

Variable stp is assigned a value that is never read, the assignment and the variable stp are redundant and can be removed.

Cleans up clang scan build warning:
drivers/scsi/st.c:4253:7: warning: Although the value stored to 'stp' is used in the enclosing expression, the value is never actually read from 'stp' [deadcode.DeadStores]

[...]

Applied to 6.1/scsi-queue, thanks!

[1/1] scsi: st: remove redundant variable pointer stp

      https://git.kernel.org/mkp/scsi/c/f0ee639adb78
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering