Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm/dist/bsd-core Canonicalize boolean resu...



details:   https://anonhg.NetBSD.org/src/rev/11256c44ec42
branches:  trunk
changeset: 332701:11256c44ec42
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Oct 04 15:51:23 2014 +0000

description:
Canonicalize boolean result from test_and_set_bit.

Not actually semantically significant for any callers, but Linux
documentation insists it is important, so we'll follow suit.

Fixes last part of PR kern/48999.

diffstat:

 sys/external/bsd/drm/dist/bsd-core/drm_atomic.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 9eec0362040c -r 11256c44ec42 sys/external/bsd/drm/dist/bsd-core/drm_atomic.h
--- a/sys/external/bsd/drm/dist/bsd-core/drm_atomic.h   Sat Oct 04 15:29:13 2014 +0000
+++ b/sys/external/bsd/drm/dist/bsd-core/drm_atomic.h   Sat Oct 04 15:51:23 2014 +0000
@@ -49,7 +49,7 @@
        unsigned int r = *(volatile int *)p & m;
        *(volatile int *)p |= m;
        splx(s);
-       return r;
+       return !!r;
 }
 
 static __inline void
@@ -115,7 +115,7 @@
                        break;
        } while (atomic_cas_uint(val, old, old | mask) != old);
 
-       return old & mask;
+       return !!(old & mask);
 }
 
 #endif



Home | Main Index | Thread Index | Old Index