On 03/31/2014 03:10 PM, Behan Webster wrote:The idea is to remove the compile time warning that the return code "prev" isn't initialized in the default case. Indicating that wrong_size_cmpxchg doesn't return fixes that false positive.
__compiletime_error traps at compile time rather than link time, whichI changed it to a __noreturn on wrong_size_cmpxchg thanks to Jamesdiff --git a/include/asm-generic/cmpxchg-local.hShouldn't this be a build time assert (__compiletime_error())?
b/include/asm-generic/cmpxchg-local.h
index d8d4c89..4c41bb8 100644
--- a/include/asm-generic/cmpxchg-local.h
+++ b/include/asm-generic/cmpxchg-local.h
@@ -41,6 +41,7 @@ static inline unsigned long
__cmpxchg_local_generic(volatile void *ptr,
break;
default:
wrong_size_cmpxchg(ptr);
+ prev = 0;
}
raw_local_irq_restore(flags);
return prev;
Bottomley.
Which would be better?
is what you want.