Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/include/drm drm: Fix index confusion a...



details:   https://anonhg.NetBSD.org/src/rev/2e9df7e062e1
branches:  trunk
changeset: 1028796:2e9df7e062e1
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:03:21 2021 +0000

description:
drm: Fix index confusion and rename variables to clarify.

diffstat:

 sys/external/bsd/drm2/include/drm/bus_dma_hacks.h |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (43 lines):

diff -r 1176cc082cfd -r 2e9df7e062e1 sys/external/bsd/drm2/include/drm/bus_dma_hacks.h
--- a/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h Sun Dec 19 12:03:13 2021 +0000
+++ b/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h Sun Dec 19 12:03:21 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma_hacks.h,v 1.23 2021/12/19 11:33:59 riastradh Exp $     */
+/*     $NetBSD: bus_dma_hacks.h,v 1.24 2021/12/19 12:03:21 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -196,18 +196,18 @@
     int nsegs, struct page **pgs, unsigned npgs)
 {
        int seg;
-       unsigned i;
+       unsigned pg;
 
-       i = 0;
+       pg = 0;
        for (seg = 0; seg < nsegs; seg++) {
-               bus_addr_t baddr = segs[i].ds_addr;
-               bus_size_t len = segs[i].ds_len;
+               bus_addr_t baddr = segs[seg].ds_addr;
+               bus_size_t len = segs[seg].ds_len;
 
                while (len >= PAGE_SIZE) {
                        paddr_t paddr = BUS_MEM_TO_PHYS(dmat, baddr);
 
-                       KASSERT(i < npgs);
-                       pgs[i++] = container_of(PHYS_TO_VM_PAGE(paddr),
+                       KASSERT(pg < npgs);
+                       pgs[pg++] = container_of(PHYS_TO_VM_PAGE(paddr),
                            struct page, p_vmp);
 
                        baddr += PAGE_SIZE;
@@ -215,7 +215,7 @@
                }
                KASSERT(len == 0);
        }
-       KASSERT(i == npgs);
+       KASSERT(pg == npgs);
 
        return 0;
 }



Home | Main Index | Thread Index | Old Index