Module Name: src
Committed By: riastradh
Date: Mon Aug 27 14:50:52 UTC 2018
Modified Files:
src/sys/external/bsd/drm2/include/linux: bitmap.h
Log Message:
Be consistent about nbits >= bpl.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/linux/bitmap.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/drm2/include/linux/bitmap.h
diff -u src/sys/external/bsd/drm2/include/linux/bitmap.h:1.5 src/sys/external/bsd/drm2/include/linux/bitmap.h:1.6
--- src/sys/external/bsd/drm2/include/linux/bitmap.h:1.5 Mon Aug 27 14:50:37 2018
+++ src/sys/external/bsd/drm2/include/linux/bitmap.h Mon Aug 27 14:50:52 2018
@@ -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 @@ bitmap_empty(const unsigned long *bitmap
{
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 @@ bitmap_weight(const unsigned long *bitma
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));