Fix generic atomic ops and/or: add missing return
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 14 Jun 2011 12:55:44 +0000 (08:55 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 14 Jun 2011 12:55:44 +0000 (08:55 -0400)
Fixes build on powerpc:

./urcu/uatomic/generic.h: In function '_uatomic_and':
./urcu/uatomic/generic.h:310:2: warning: 'return' with a value, in
function returning void
./urcu/uatomic/generic.h: In function '_uatomic_or':
./urcu/uatomic/generic.h:374:2: warning: 'return' with a value, in
function returning void

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu/uatomic/generic.h

index 337fe4098bf8337649f9a6bb52af4f9359453091..4a5705198b1a81fa48713b41c743a10c2feedd22 100644 (file)
@@ -269,6 +269,8 @@ void _uatomic_and(void *addr, unsigned long val, int len)
                        old = oldt;
                        oldt = _uatomic_cmpxchg(addr, old, old & val, 1);
                } while (oldt != old);
+
+               return;
        }
 #endif
 #ifdef UATOMIC_HAS_ATOMIC_SHORT
@@ -292,6 +294,8 @@ void _uatomic_and(void *addr, unsigned long val, int len)
                        old = oldt;
                        oldt = _uatomic_cmpxchg(addr, old, old & val, 4);
                } while (oldt != old);
+
+               return;
        }
 #if (CAA_BITS_PER_LONG == 64)
        case 8:
@@ -303,11 +307,12 @@ void _uatomic_and(void *addr, unsigned long val, int len)
                        old = oldt;
                        oldt = _uatomic_cmpxchg(addr, old, old & val, 8);
                } while (oldt != old);
+
+               return;
        }
 #endif
        }
        _uatomic_link_error();
-       return 0;
 }
 
 #define uatomic_and(addr, v)           \
@@ -333,6 +338,8 @@ void _uatomic_or(void *addr, unsigned long val, int len)
                        old = oldt;
                        oldt = _uatomic_cmpxchg(addr, old, old | val, 1);
                } while (oldt != old);
+
+               return;
        }
 #endif
 #ifdef UATOMIC_HAS_ATOMIC_SHORT
@@ -345,6 +352,8 @@ void _uatomic_or(void *addr, unsigned long val, int len)
                        old = oldt;
                        oldt = _uatomic_cmpxchg(addr, old, old | val, 2);
                } while (oldt != old);
+
+               return;
        }
 #endif
        case 4:
@@ -356,6 +365,8 @@ void _uatomic_or(void *addr, unsigned long val, int len)
                        old = oldt;
                        oldt = _uatomic_cmpxchg(addr, old, old | val, 4);
                } while (oldt != old);
+
+               return;
        }
 #if (CAA_BITS_PER_LONG == 64)
        case 8:
@@ -367,11 +378,12 @@ void _uatomic_or(void *addr, unsigned long val, int len)
                        old = oldt;
                        oldt = _uatomic_cmpxchg(addr, old, old | val, 8);
                } while (oldt != old);
+
+               return;
        }
 #endif
        }
        _uatomic_link_error();
-       return 0;
 }
 
 #define uatomic_or(addr, v)            \
This page took 0.028007 seconds and 4 git commands to generate.