Skip to contentSkip to conversation

scsi: message: fusion: remove redundant variable iocnum

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: message: fusion: remove redundant variable iocnum

Variable iocnum is assigned a value that is never read, the assignment and hence the variable are redundant can be removed. Also update the the comment to reflect the correct name of the variable being updated.

Cleans up clang-scan warning:
drivers/message/fusion/mptctl.c:641:8: warning: Although the value stored to 'iocnum' is used in the enclosing expression, the value is never actually read from 'iocnum' [deadcode.DeadStores]

---
 drivers/message/fusion/mptctl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/message/fusion/mptctl.c +2 -4
index f9ee957072c3..673145c8936b 100644
@@ -620,7 +620,6 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
 	mpt_ioctl_header __user *uhdr = (void __user *) arg;
 	mpt_ioctl_header	 khdr;
-	int iocnum;
 	unsigned iocnumX;
 	int nonblock = (file->f_flags & O_NONBLOCK);
 	int ret;
@@ -634,12 +633,11 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	}
 	ret = -ENXIO;				/* (-6) No such device or address */
 
-	/* Verify intended MPT adapter - set iocnum and the adapter
+	/* Verify intended MPT adapter - set iocnumX and the adapter
 	 * pointer (iocp)
 	 */
 	iocnumX = khdr.iocnum & 0xFF;
-	if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) ||
-	    (iocp == NULL))
+	if ((mpt_verify_adapter(iocnumX, &iocp) < 0) || (iocp == NULL))
 		return -ENODEV;
 
 	if (!iocp->active) {
Signature · 1 line
2.35.3
#1 lore raw

Colin,

Quoted 3 lines

Variable iocnum is assigned a value that is never read, the assignment and hence the variable are redundant can be removed. Also update the the comment to reflect the correct name of the variable being updated.

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 10 lines · Colin Ian King

Variable iocnum is assigned a value that is never read, the assignment and hence the variable are redundant can be removed. Also update the the comment to reflect the correct name of the variable being updated.

Cleans up clang-scan warning:
drivers/message/fusion/mptctl.c:641:8: warning: Although the value stored to 'iocnum' is used in the enclosing expression, the value is never actually read from 'iocnum' [deadcode.DeadStores]

[...]

Applied to 6.1/scsi-queue, thanks!

[1/1] scsi: message: fusion: remove redundant variable iocnum

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