Skip to contentSkip to conversation

mpt2sas: fix a compile issue

PATCH In review Tomas Henzl 2 participants 2 messages Feb 3, 2011 – Feb 8, 2011 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpt2sas: fix a compile issue

Without CONFIG_SCSI_MPT2SAS_LOGGING defined the
variable mpi_reply isn't defined.

This patch moves the #endif below the expression where the mpi_reply is used.

drivers/scsi/mpt2sas/mpt2sas_scsih.c +2 -1
index eda347c..40b57c6 100644
@@ -2741,13 +2741,14 @@ _scsih_sas_control_complete(struct MPT2SAS_ADAPTER *ioc, u16 smid,
 #ifdef CONFIG_SCSI_MPT2SAS_LOGGING
 	Mpi2SasIoUnitControlReply_t *mpi_reply =
 	    mpt2sas_base_get_reply_virt_addr(ioc, reply);
-#endif
+
 	dewtprintk(ioc, printk(MPT2SAS_INFO_FMT
 	    "sc_complete:handle(0x%04x), (open) "
 	    "smid(%d), ioc_status(0x%04x), loginfo(0x%08x)\n",
 	    ioc->name, le16_to_cpu(mpi_reply->DevHandle), smid,
 	    le16_to_cpu(mpi_reply->IOCStatus),
 	    le32_to_cpu(mpi_reply->IOCLogInfo)));
+#endif
 	return 1;
 }
 
#1 lore raw

I have verified this patch and it is valid changes. Tomas, Thanks for providing the patch.

Please consider this as an ACKed patch.

~ Kashyap

Quoted 39 lines

-----Original Message-----
From: Tomas Henzl [mailto:[email protected]]
Sent: Thursday, February 03, 2011 8:11 PM
To: '[email protected]'
Cc: Desai, Kashyap; '[email protected]'; Prakash, Sathya
Subject: [PATCH] mpt2sas: fix a compile issue

Without CONFIG_SCSI_MPT2SAS_LOGGING defined the variable mpi_reply isn't defined.

This patch moves the #endif below the expression where the mpi_reply is used.

drivers/scsi/mpt2sas/mpt2sas_scsih.c +2 -1
index eda347c..40b57c6 100644
@@ -2741,13 +2741,14 @@ _scsih_sas_control_complete(struct
 MPT2SAS_ADAPTER *ioc, u16 smid,
 #ifdef CONFIG_SCSI_MPT2SAS_LOGGING
 	Mpi2SasIoUnitControlReply_t *mpi_reply =
 	    mpt2sas_base_get_reply_virt_addr(ioc, reply);
-#endif
+
 	dewtprintk(ioc, printk(MPT2SAS_INFO_FMT
 	    "sc_complete:handle(0x%04x), (open) "
 	    "smid(%d), ioc_status(0x%04x), loginfo(0x%08x)\n",
 	    ioc->name, le16_to_cpu(mpi_reply->DevHandle), smid,
 	    le16_to_cpu(mpi_reply->IOCStatus),
 	    le32_to_cpu(mpi_reply->IOCLogInfo)));
+#endif
 	return 1;
 }