Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jul 2022 18:48:27 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 356dccddae4d - stable/12 - Fix unused variable warning in xen's blkback.c
Message-ID:  <202207291848.26TImRYE025399@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by dim:

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

commit 356dccddae4d406dc83f5aeb109b75abb30d4d21
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-26 12:02:36 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-29 18:36:09 +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
    
    (cherry picked from commit 39e12a7591bf2ed4b2fae48e19f3af3a3cdcb196)
---
 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 b98ccb6e2595..2311bae3c605 100644
--- a/sys/dev/xen/blkback/blkback.c
+++ b/sys/dev/xen/blkback/blkback.c
@@ -1653,7 +1653,6 @@ 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;
 		RING_IDX		 req_ring_idx;
-		u_int			 req_seg_idx;
 
 		ring_req	      = nreq->ring_req;
 		req_ring_idx	      = nreq->req_ring_idx;
@@ -1661,7 +1660,6 @@ xbb_dispatch_io(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist)
 		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. */
@@ -1715,7 +1713,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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207291848.26TImRYE025399>