Skip to contentSkip to conversation

scsi: message: fusion: Remove redundant assignment to rc

PATCH Applied Jiapeng Chong 2 participants 2 messages May 12, 2021 – May 15, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: message: fusion: Remove redundant assignment to rc

Variable rc is set to '-1', but this value is never read as it is overwritten or not used later on, hence it is a redundant assignment and can be removed.

Clean up the following clang-analyzer warning:

drivers/message/fusion/mptbase.c:6996:2: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores].

---
 drivers/message/fusion/mptbase.c | 2 --
 1 file changed, 2 deletions(-)
drivers/message/fusion/mptbase.c +0 -2
index f4f89cf..7f7abc9 100644
@@ -6993,8 +6993,6 @@ static void seq_mpt_print_ioc_summary(MPT_ADAPTER *ioc, struct seq_file *m, int
 	ioc->ioc_reset_in_progress = 1;
 	spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags);
 
-	rc = -1;
-
 	for (cb_idx = MPT_MAX_PROTOCOL_DRIVERS-1; cb_idx; cb_idx--) {
 		if (MptResetHandlers[cb_idx])
 			mpt_signal_reset(cb_idx, ioc, MPT_IOC_SETUP_RESET);
Signature · 1 line
1.8.3.1
#1 lore raw

Jiapeng,

Quoted 3 lines

Variable rc is set to '-1', but this value is never read as it is overwritten or not used later on, hence it is a redundant assignment and can be removed.

Applied to 5.14/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering