git: 96e0a62abd93 - main - nvme: Use unsigned

From: Warner Losh <imp_at_FreeBSD.org>
Date: Mon, 13 Oct 2025 06:17:19 UTC
The branch main has been updated by imp:

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

commit 96e0a62abd93664ad52d18a899f83cd866793a90
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2025-10-13 06:12:36 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-10-13 06:15:51 +0000

    nvme: Use unsigned
    
    CI complains about signed/unsigned comparisons, but normal build does
    not. Fix this by transitioning to unsigned and using a loop-scoped
    variable.
    
    Fixes: d714732b598b
    Sponsored by: Netflix
---
 sys/dev/nvme/nvme.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h
index 557b4df4c328..f4ea08f129c0 100644
--- a/sys/dev/nvme/nvme.h
+++ b/sys/dev/nvme/nvme.h
@@ -2153,8 +2153,6 @@ static inline
 void	nvme_namespace_data_swapbytes(struct nvme_namespace_data *s __unused)
 {
 #if _BYTE_ORDER != _LITTLE_ENDIAN
-	int i;
-
 	s->nsze = le64toh(s->nsze);
 	s->ncap = le64toh(s->ncap);
 	s->nuse = le64toh(s->nuse);
@@ -2173,7 +2171,7 @@ void	nvme_namespace_data_swapbytes(struct nvme_namespace_data *s __unused)
 	s->anagrpid = le32toh(s->anagrpid);
 	s->nvmsetid = le16toh(s->nvmsetid);
 	s->endgid = le16toh(s->endgid);
-	for (i = 0; i < nitems(s->lbaf); i++)
+	for (unsigned i = 0; i < nitems(s->lbaf); i++)
 		s->lbaf[i] = le32toh(s->lbaf[i]);
 #endif
 }