All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: target: sbp_target: Remove redundant assignment to pg_size
@ 2021-05-13 10:49 Jiapeng Chong
  2021-05-15  3:09 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-05-13 10:49 UTC (permalink / raw)
  To: bootc
  Cc: martin.petersen, linux-scsi, target-devel, linux1394-devel,
	linux-kernel, Jiapeng Chong

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].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/target/sbp/sbp_target.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c
index ce84f93..4d3ceee 100644
--- a/drivers/target/sbp/sbp_target.c
+++ b/drivers/target/sbp/sbp_target.c
@@ -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);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: target: sbp_target: Remove redundant assignment to pg_size
  2021-05-13 10:49 [PATCH] scsi: target: sbp_target: Remove redundant assignment to pg_size Jiapeng Chong
@ 2021-05-15  3:09 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2021-05-15  3:09 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: bootc, martin.petersen, linux-scsi, target-devel,
	linux1394-devel, linux-kernel


Jiapeng,

> 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!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-15  3:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13 10:49 [PATCH] scsi: target: sbp_target: Remove redundant assignment to pg_size Jiapeng Chong
2021-05-15  3:09 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.