git: 39e12a7591bf - main - Fix unused variable warning in xen's blkback.c
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 26 Jul 2022 18:00:28 UTC
The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=39e12a7591bf2ed4b2fae48e19f3af3a3cdcb196 commit 39e12a7591bf2ed4b2fae48e19f3af3a3cdcb196 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2022-07-26 12:02:36 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2022-07-26 17:59:55 +0000 Fix unused variable warning in xen's blkback.c With clang 15, the following -Werror warning is produced: sys/dev/xen/blkback/blkback.c:1561:12: error: variable 'req_seg_idx' set but not used [-Werror,-Wunused-but-set-variable] u_int req_seg_idx; ^ The 'req_seg_idx' variable was used in the for loop later in the xbb_dispatch_io() function, but refactoring in 112cacaee408 got rid of it. Remove the variable since it no longer serves any purpose. MFC after: 3 days --- sys/dev/xen/blkback/blkback.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c index bd550695e719..6a5f9631004e 100644 --- a/sys/dev/xen/blkback/blkback.c +++ b/sys/dev/xen/blkback/blkback.c @@ -1558,14 +1558,12 @@ xbb_dispatch_io(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist) STAILQ_FOREACH(nreq, &reqlist->contig_req_list, links) { blkif_request_t *ring_req; - u_int req_seg_idx; ring_req = nreq->ring_req; nr_sects = 0; nseg = ring_req->nr_segments; nreq->nr_pages = nseg; nreq->nr_512b_sectors = 0; - req_seg_idx = 0; sg = NULL; /* Check that number of segments is sane. */ @@ -1619,7 +1617,6 @@ xbb_dispatch_io(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist) map++; xbb_sg++; seg_idx++; - req_seg_idx++; } /* Convert to the disk's sector size */