scsi: message: fusion: Remove redundant variable iocnum
authorColin Ian King <colin.i.king@gmail.com>
Fri, 5 Aug 2022 11:32:14 +0000 (12:32 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 1 Sep 2022 03:39:57 +0000 (23:39 -0400)
Variable iocnum is assigned a value that is never read, the assignment and
hence the variable are redundant can be removed. Also update 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]

Link: https://lore.kernel.org/r/20220805113214.2339022-1-colin.i.king@gmail.com
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/message/fusion/mptctl.c

index f9ee957..52c7020 100644 (file)
@@ -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) {