]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - lib/atomic64_test.c
nvmet-fc: eliminate incorrect static markers on local variables
[karo-tx-linux.git] / lib / atomic64_test.c
index fd70c0e0e67314999fcab5c69c9c06dcec527c03..62ab629f51ca2d6a05887f41167aaeeee3cd202a 100644 (file)
@@ -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)