X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=lib%2Fatomic64_test.c;h=62ab629f51ca2d6a05887f41167aaeeee3cd202a;hb=a67ca1e9bd07c05548bf7c2d6f065ca9db11e9bf;hp=fd70c0e0e67314999fcab5c69c9c06dcec527c03;hpb=7b7b3849577932830bf17b59988ebcc67537c042;p=mirror_ubuntu-artful-kernel.git diff --git a/lib/atomic64_test.c b/lib/atomic64_test.c index fd70c0e0e673..62ab629f51ca 100644 --- a/lib/atomic64_test.c +++ b/lib/atomic64_test.c @@ -153,8 +153,10 @@ static __init void test_atomic64(void) long long v0 = 0xaaa31337c001d00dLL; long long v1 = 0xdeadbeefdeafcafeLL; long long v2 = 0xfaceabadf00df001LL; + long long v3 = 0x8000000000000000LL; long long onestwos = 0x1111111122222222LL; long long one = 1LL; + int r_int; atomic64_t v = ATOMIC64_INIT(v0); long long r = v0; @@ -240,6 +242,11 @@ static __init void test_atomic64(void) BUG_ON(!atomic64_inc_not_zero(&v)); r += one; BUG_ON(v.counter != r); + + /* Confirm the return value fits in an int, even if the value doesn't */ + INIT(v3); + r_int = atomic64_inc_not_zero(&v); + BUG_ON(!r_int); } static __init int test_atomics_init(void)