git: 609593ae47db - stable/13 - Suppress possible unused variable warning for icl_soft.c

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Mon, 01 Aug 2022 18:10:33 UTC
The branch stable/13 has been updated by dim:

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

commit 609593ae47db27c89f29596528343c828b51c9d8
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-27 19:00:22 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-08-01 18:07:27 +0000

    Suppress possible unused variable warning for icl_soft.c
    
    With clang 15, the following -Werror warning is produced on i386:
    
        sys/dev/iscsi//icl_soft.c:1277:6: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
                int i;
                    ^
    
    The 'i' variable is used later in the icl_soft_conn_pdu_get_bio()
    function, via the PHYS_TO_DMAP() macro. However, on i386 and some other
    architectures, this macro is defined to panic immediately, so in those
    cases, 'i' is indeed not used. Suppress the warning by marking 'i' as
    unused.
    
    MFC after:      3 days
    
    (cherry picked from commit 02a226ac342f0fb622e654e461c41f4f588f4186)
---
 sys/dev/iscsi/icl_soft.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c
index 96a4e9d0fa71..dbe404848e0a 100644
--- a/sys/dev/iscsi/icl_soft.c
+++ b/sys/dev/iscsi/icl_soft.c
@@ -1274,7 +1274,7 @@ icl_soft_conn_pdu_get_bio(struct icl_conn *ic, struct icl_pdu *ip,
 {
 	vm_offset_t vaddr;
 	size_t page_offset, todo;
-	int i;
+	int i __unused;
 
 	MPASS(bp->bio_flags & BIO_UNMAPPED);
 	if (bio_off < PAGE_SIZE - bp->bio_ma_offset) {