* [PATCH] scsi: message: fusion: remove redundant variable iocnum
@ 2022-08-05 11:32 Colin Ian King
2022-08-23 3:42 ` Martin K. Petersen
2022-09-01 5:12 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2022-08-05 11:32 UTC (permalink / raw)
To: Sathya Prakash, Sreekanth Reddy, Suganath Prabu Subramani,
MPT-FusionLinux.pdl, linux-scsi
Cc: kernel-janitors, linux-kernel
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]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/message/fusion/mptctl.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
index f9ee957072c3..673145c8936b 100644
--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -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) {
--
2.35.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: message: fusion: remove redundant variable iocnum
2022-08-05 11:32 [PATCH] scsi: message: fusion: remove redundant variable iocnum Colin Ian King
@ 2022-08-23 3:42 ` Martin K. Petersen
2022-09-01 5:12 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-08-23 3:42 UTC (permalink / raw)
To: Colin Ian King
Cc: Sathya Prakash, Sreekanth Reddy, Suganath Prabu Subramani,
MPT-FusionLinux.pdl, linux-scsi, kernel-janitors, linux-kernel
Colin,
> 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!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: message: fusion: remove redundant variable iocnum
2022-08-05 11:32 [PATCH] scsi: message: fusion: remove redundant variable iocnum Colin Ian King
2022-08-23 3:42 ` Martin K. Petersen
@ 2022-09-01 5:12 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-09-01 5:12 UTC (permalink / raw)
To: linux-scsi, Colin Ian King, Sathya Prakash, Sreekanth Reddy,
Suganath Prabu Subramani, MPT-FusionLinux.pdl
Cc: Martin K . Petersen, linux-kernel, kernel-janitors
On Fri, 5 Aug 2022 12:32:14 +0100, Colin Ian King wrote:
> 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
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-01 5:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05 11:32 [PATCH] scsi: message: fusion: remove redundant variable iocnum Colin Ian King
2022-08-23 3:42 ` Martin K. Petersen
2022-09-01 5:12 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).