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/d9af6b3052ae
branches:  trunk
changeset: 802843:d9af6b3052ae
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 ca3e36a789a8 -r d9af6b3052ae 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