[next] scsi: message: fusion: remove redundant pointer hd

Message ID 20240118122039.2541425-1-colin.i.king@gmail.com
State New
Headers
Series [next] scsi: message: fusion: remove redundant pointer hd |

Commit Message

Colin Ian King Jan. 18, 2024, 12:20 p.m. UTC
  The pointer hd is being assigned a value that is not being
read later. The variable is redundant and can be removed.

Cleans up clang scan build warning:
warning: Although the value stored to 'hd' is used in the enclosing
expression, the value is never actually read from 'hd'
[deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/message/fusion/mptfc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Comments

Martin K. Petersen Jan. 24, 2024, 2:39 a.m. UTC | #1
Colin,

> The pointer hd is being assigned a value that is not being read later.
> The variable is redundant and can be removed.

Applied to 6.9/scsi-staging, thanks!
  
Martin K. Petersen Jan. 30, 2024, 2:27 a.m. UTC | #2
On Thu, 18 Jan 2024 12:20:39 +0000, Colin Ian King wrote:

> The pointer hd is being assigned a value that is not being
> read later. The variable is redundant and can be removed.
> 
> Cleans up clang scan build warning:
> warning: Although the value stored to 'hd' is used in the enclosing
> expression, the value is never actually read from 'hd'
> [deadcode.DeadStores]
> 
> [...]

Applied to 6.9/scsi-queue, thanks!

[1/1] scsi: message: fusion: remove redundant pointer hd
      https://git.kernel.org/mkp/scsi/c/be7fc734b658
  

Patch

diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index 0581f855c72e..c459f709107b 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -1401,7 +1401,6 @@  static struct pci_driver mptfc_driver = {
 static int
 mptfc_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
 {
-	MPT_SCSI_HOST *hd;
 	u8 event = le32_to_cpu(pEvReply->Event) & 0xFF;
 	unsigned long flags;
 	int rc=1;
@@ -1412,8 +1411,7 @@  mptfc_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
 	devtverboseprintk(ioc, printk(MYIOC_s_DEBUG_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n",
 			ioc->name, event));
 
-	if (ioc->sh == NULL ||
-		((hd = shost_priv(ioc->sh)) == NULL))
+	if (ioc->sh == NULL || shost_priv(ioc->sh) == NULL)
 		return 1;
 
 	switch (event) {