git: fbf524675763 - main - cfiscsi(4): Fix "set but not used" warning

From: Edward Tomasz Napierala <trasz_at_FreeBSD.org>
Date: Mon, 29 Nov 2021 16:49:20 UTC
The branch main has been updated by trasz:

URL: https://cgit.FreeBSD.org/src/commit/?id=fbf5246757630650c23ed711c527a67dd52eb745

commit fbf5246757630650c23ed711c527a67dd52eb745
Author:     Edward Tomasz Napierala <trasz@FreeBSD.org>
AuthorDate: 2021-11-29 16:44:12 +0000
Commit:     Edward Tomasz Napierala <trasz@FreeBSD.org>
CommitDate: 2021-11-29 16:45:15 +0000

    cfiscsi(4): Fix "set but not used" warning
    
    No functional changes.
    
    Sponsored By:   EPSRC
---
 sys/cam/ctl/ctl_frontend_iscsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c
index b8ab25e89eb9..6b002566b465 100644
--- a/sys/cam/ctl/ctl_frontend_iscsi.c
+++ b/sys/cam/ctl/ctl_frontend_iscsi.c
@@ -2857,12 +2857,11 @@ cfiscsi_scsi_command_done(union ctl_io *io)
 	struct iscsi_bhs_scsi_response *bhssr;
 #ifdef DIAGNOSTIC
 	struct cfiscsi_data_wait *cdw;
-#endif
 	struct cfiscsi_session *cs;
+#endif
 	uint16_t sense_length;
 
 	request = PRIV_REQUEST(io);
-	cs = PDU_SESSION(request);
 	bhssc = (struct iscsi_bhs_scsi_command *)request->ip_bhs;
 	KASSERT((bhssc->bhssc_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) ==
 	    ISCSI_BHS_OPCODE_SCSI_COMMAND,
@@ -2872,6 +2871,7 @@ cfiscsi_scsi_command_done(union ctl_io *io)
 	//    bhssc->bhssc_initiator_task_tag);
 
 #ifdef DIAGNOSTIC
+	cs = PDU_SESSION(request);
 	CFISCSI_SESSION_LOCK(cs);
 	TAILQ_FOREACH(cdw, &cs->cs_waiting_for_data_out, cdw_next)
 		KASSERT(bhssc->bhssc_initiator_task_tag !=