* [PATCH] scsi: megaraid_sas: remove redundant variable cmd_type
@ 2022-07-30 12:45 Colin Ian King
2022-08-01 23:53 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-07-30 12:45 UTC (permalink / raw)
To: Kashyap Desai, Sumit Saxena, Shivasharan S,
James E . J . Bottomley, Martin K . Petersen, megaraidlinux.pdl,
linux-scsi
Cc: kernel-janitors, linux-kernel
The variable cmd_type is assigned a value but it is never read. The
variable and the assignment are redundant and can be removed.
Cleans up clang scan build warning:
drivers/scsi/megaraid/megaraid_sas_fusion.c:3228:10: warning: Although
the value stored to 'cmd_type' is used in the enclosing expression, the
value is never actually read from 'cmd_type' [deadcode.DeadStores]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/scsi/megaraid/megaraid_sas_fusion.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 5b5885d9732b..e48d4261d0bc 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -3199,7 +3199,6 @@ megasas_build_io_fusion(struct megasas_instance *instance,
struct megasas_cmd_fusion *cmd)
{
int sge_count;
- u8 cmd_type;
u16 pd_index = 0;
u8 drive_type = 0;
struct MPI2_RAID_SCSI_IO_REQUEST *io_request = cmd->io_request;
@@ -3225,7 +3224,7 @@ megasas_build_io_fusion(struct megasas_instance *instance,
*/
io_request->IoFlags = cpu_to_le16(scp->cmd_len);
- switch (cmd_type = megasas_cmd_type(scp)) {
+ switch (megasas_cmd_type(scp)) {
case READ_WRITE_LDIO:
megasas_build_ldio_fusion(instance, scp, cmd);
break;
--
2.35.3
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] scsi: megaraid_sas: remove redundant variable cmd_type
2022-07-30 12:45 [PATCH] scsi: megaraid_sas: remove redundant variable cmd_type Colin Ian King
@ 2022-08-01 23:53 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2022-08-01 23:53 UTC (permalink / raw)
To: Colin Ian King
Cc: Kashyap Desai, Sumit Saxena, Shivasharan S,
James E . J . Bottomley, Martin K . Petersen, megaraidlinux.pdl,
linux-scsi, kernel-janitors, linux-kernel
Colin,
> The variable cmd_type is assigned a value but it is never read. The
> variable and the assignment are redundant and can be removed.
Applied to 5.20/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-01 23:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-30 12:45 [PATCH] scsi: megaraid_sas: remove redundant variable cmd_type Colin Ian King
2022-08-01 23:53 ` 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
Powered by JetHome