Skip to contentSkip to conversation

scsi: target: sbp_target: Remove redundant assignment to pg_size

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

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

PATCH 1/1 scsi: target: sbp_target: Remove redundant assignment to pg_size

Variable pg_size is set to '0x100 << pg_size', but this value is never read as it is not used later on, hence it is a redundant assignment and can be removed.

Clean up the following clang-analyzer warning:

drivers/target/sbp/sbp_target.c:1264:3: warning: Value stored to 'pg_size' is never read [clang-analyzer-deadcode.DeadStores].

---
 drivers/target/sbp/sbp_target.c | 1 -
 1 file changed, 1 deletion(-)
drivers/target/sbp/sbp_target.c +0 -1
index ce84f93..4d3ceee 100644
@@ -1261,7 +1261,6 @@ static int sbp_rw_data(struct sbp_target_request *req)
 	pg_size = CMDBLK_ORB_PG_SIZE(be32_to_cpu(req->orb.misc));
 	if (pg_size) {
 		pr_err("sbp_run_transaction: page size ignored\n");
-		pg_size = 0x100 << pg_size;
 	}
 
 	spin_lock_bh(&sess->lock);
Signature · 1 line
1.8.3.1
#1 lore raw

Jiapeng,

Quoted 3 lines

Variable pg_size is set to '0x100 << pg_size', but this value is never read as it is 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