On Tue, 30 Nov 2010, Peter Zijlstra wrote: > On Tue, 2010-11-30 at 20:29 +0100, Eric Dumazet wrote: > > > > well maybe a single prototype ;) > > > > static inline void kmap_atomic_idx_pop(void) > > { > > #ifdef CONFIG_DEBUG_HIGHMEM > > int idx = __this_cpu_dec_return(__kmap_atomic_idx); > > BUG_ON(idx < 0); > > #else > > __this_cpu_dec(__kmap_atomic_idx); > > #endif > > } > > Right, at least a consistent prototype, the above looks fine to me. Ok with right spacing this is: Subject: highmem: Use this_cpu_dec instead of __this_cpu_dec_return if !DEBUG_HIGHMEM Signed-off-by: Christoph Lameter <cl@xxxxxxxxx> --- include/linux/highmem.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) Index: linux-2.6/include/linux/highmem.h =================================================================== --- linux-2.6.orig/include/linux/highmem.h 2010-11-30 13:23:44.000000000 -0600 +++ linux-2.6/include/linux/highmem.h 2010-11-30 13:51:39.000000000 -0600 @@ -95,13 +95,15 @@ static inline int kmap_atomic_idx(void) return __this_cpu_read(__kmap_atomic_idx) - 1; } -static inline int kmap_atomic_idx_pop(void) +static inline void kmap_atomic_idx_pop(void) { - int idx = __this_cpu_dec_return(__kmap_atomic_idx); #ifdef CONFIG_DEBUG_HIGHMEM + int idx = __this_cpu_dec_return(__kmap_atomic_idx); + BUG_ON(idx < 0); +#else + __this_cpu_dec(__kmap_atomic_idx); #endif - return idx; } #endif -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>