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/6f3a0e6bc0ec
branches:  trunk
changeset: 365203:6f3a0e6bc0ec
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 db5567524472 -r 6f3a0e6bc0ec 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