scsi: message: fusion: Remove unused local variable 'port'
authorZhen Lei <thunder.leizhen@huawei.com>
Thu, 8 Apr 2021 06:18:50 +0000 (14:18 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 13 Apr 2021 05:00:25 +0000 (01:00 -0400)
Fixes the following W=1 kernel build warning:

drivers/message/fusion/mptctl.c: In function ‘mptctl_gettargetinfo
drivers/message/fusion/mptctl.c:1372:7: warning: variable ‘port’ set but not used [-Wunused-but-set-variable]

Link: https://lore.kernel.org/r/20210408061851.3089-3-thunder.leizhen@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/message/fusion/mptctl.c

index 0a9321239e766d06c3626a3775c746722cabeaf0..72025996cd70c0a8fcbb79d3bc4280d11ba6a7bd 100644 (file)
@@ -1367,7 +1367,6 @@ mptctl_gettargetinfo (MPT_ADAPTER *ioc, unsigned long arg)
        int                     lun;
        int                     maxWordsLeft;
        int                     numBytes;
-       u8                      port;
        struct scsi_device      *sdev;
 
        if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_targetinfo))) {
@@ -1379,13 +1378,8 @@ mptctl_gettargetinfo (MPT_ADAPTER *ioc, unsigned long arg)
 
        dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_gettargetinfo called.\n",
            ioc->name));
-       /* Get the port number and set the maximum number of bytes
-        * in the returned structure.
-        * Ignore the port setting.
-        */
        numBytes = karg.hdr.maxDataSize - sizeof(mpt_ioctl_header);
        maxWordsLeft = numBytes/sizeof(int);
-       port = karg.hdr.port;
 
        if (maxWordsLeft <= 0) {
                printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_gettargetinfo() - no memory available!\n",