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/linux Be consistent about nbit...



details:   https://anonhg.NetBSD.org/src/rev/99fdf183139f
branches:  trunk
changeset: 366327:99fdf183139f
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 14:50:52 2018 +0000

description:
Be consistent about nbits >= bpl.

diffstat:

 sys/external/bsd/drm2/include/linux/bitmap.h |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 20f19cf0506d -r 99fdf183139f sys/external/bsd/drm2/include/linux/bitmap.h
--- a/sys/external/bsd/drm2/include/linux/bitmap.h      Mon Aug 27 14:50:37 2018 +0000
+++ b/sys/external/bsd/drm2/include/linux/bitmap.h      Mon Aug 27 14:50:52 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bitmap.h,v 1.5 2018/08/27 14:50:37 riastradh Exp $     */
+/*     $NetBSD: bitmap.h,v 1.6 2018/08/27 14:50:52 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
 {
        const size_t bpl = NBBY * sizeof(*bitmap);
 
-       for (; bpl <= nbits; nbits -= bpl) {
+       for (; nbits >= bpl; nbits -= bpl) {
                if (*bitmap++)
                        return false;
        }
@@ -85,7 +85,7 @@
        const size_t bpl = NBBY * sizeof(*bitmap);
        int weight = 0;
 
-       for (; bpl <= nbits; nbits -= bpl)
+       for (; nbits >= bpl; nbits -= bpl)
                weight += popcountl(*bitmap++);
        if (nbits)
                weight += popcountl(*bitmap & ~(~0UL << nbits));



Home | Main Index | Thread Index | Old Index