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 Fix find_first_zero_bit ...



details:   https://anonhg.NetBSD.org/src/rev/56fbabc11d8f
branches:  trunk
changeset: 363668:56fbabc11d8f
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 06 00:29:57 2018 +0000

description:
Fix find_first_zero_bit to find the high bits of 64-bit words...oops.

XXX pullup

diffstat:

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

diffs (19 lines):

diff -r 7218b0afaec5 -r 56fbabc11d8f sys/external/bsd/drm2/include/linux/bitops.h
--- a/sys/external/bsd/drm2/include/linux/bitops.h      Mon Aug 06 00:29:49 2018 +0000
+++ b/sys/external/bsd/drm2/include/linux/bitops.h      Mon Aug 06 00:29:57 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bitops.h,v 1.12 2018/08/06 00:29:49 riastradh Exp $    */
+/*     $NetBSD: bitops.h,v 1.13 2018/08/06 00:29:57 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -171,7 +171,8 @@
                        break;
        }
 
-       result += ffs(~*p | (~0UL << MIN(nbits, bpl)));
+       CTASSERT(sizeof(unsigned long) <= sizeof(uint64_t));
+       result += ffs64(~(uint64_t)*p | (~0UL << MIN(nbits, bpl)));
        return result;
 }
 



Home | Main Index | Thread Index | Old Index