Fix unused variable warning in icl_soft.c
With clang 15, the following -Werror warning is produced: sys/dev/iscsi//icl_soft.c:886:6: error: variable 'coalesced' set but not used [-Werror,-Wunused-but-set-variable] int coalesced, error; ^ The 'coalesced' variable is eventually used only in an #if 0'd block, obviously meant for debugging. Ensure that 'coalesced' is only declared and used when DEBUG_COALESCED is defined, so the debugging can be easily turned on later, if desired. MFC after: 3 days
This commit is contained in:
parent
8a02ea1dbc
commit
f4f8470180
@ -883,7 +883,10 @@ icl_conn_send_pdus(struct icl_soft_conn *isc, struct icl_pdu_stailq *queue)
|
||||
struct mbuf *m;
|
||||
struct socket *so;
|
||||
long available, size, size2;
|
||||
int coalesced, error;
|
||||
#ifdef DEBUG_COALESCED
|
||||
int coalesced;
|
||||
#endif
|
||||
int error;
|
||||
|
||||
ICL_CONN_LOCK_ASSERT_NOT(ic);
|
||||
|
||||
@ -942,7 +945,15 @@ icl_conn_send_pdus(struct icl_soft_conn *isc, struct icl_pdu_stailq *queue)
|
||||
}
|
||||
if (coalesce) {
|
||||
m = request->ip_bhs_mbuf;
|
||||
for (coalesced = 1; ; coalesced++) {
|
||||
for (
|
||||
#ifdef DEBUG_COALESCED
|
||||
coalesced = 1
|
||||
#endif
|
||||
; ;
|
||||
#ifdef DEBUG_COALESCED
|
||||
coalesced++
|
||||
#endif
|
||||
) {
|
||||
request2 = STAILQ_FIRST(queue);
|
||||
if (request2 == NULL)
|
||||
break;
|
||||
@ -967,7 +978,7 @@ icl_conn_send_pdus(struct icl_soft_conn *isc, struct icl_pdu_stailq *queue)
|
||||
size += size2;
|
||||
icl_soft_pdu_done(request2, 0);
|
||||
}
|
||||
#if 0
|
||||
#ifdef DEBUG_COALESCED
|
||||
if (coalesced > 1) {
|
||||
ICL_DEBUG("coalesced %d PDUs into %ld bytes",
|
||||
coalesced, size);
|
||||
|
Loading…
Reference in New Issue
Block a user