Module Name: src Committed By: martin Date: Fri Mar 7 08:42:58 UTC 2014
Modified Files: src/common/lib/libc/atomic: atomic_cas_by_cas32.c Log Message: Fix return value (typo, noticed by Nick Hudson) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/atomic/atomic_cas_by_cas32.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/common/lib/libc/atomic/atomic_cas_by_cas32.c diff -u src/common/lib/libc/atomic/atomic_cas_by_cas32.c:1.1 src/common/lib/libc/atomic/atomic_cas_by_cas32.c:1.2 --- src/common/lib/libc/atomic/atomic_cas_by_cas32.c:1.1 Mon Feb 24 16:15:43 2014 +++ src/common/lib/libc/atomic/atomic_cas_by_cas32.c Fri Mar 7 08:42:58 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_cas_by_cas32.c,v 1.1 2014/02/24 16:15:43 martin Exp $ */ +/* $NetBSD: atomic_cas_by_cas32.c,v 1.2 2014/03/07 08:42:58 martin Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -55,7 +55,7 @@ _atomic_cas_16(volatile uint16_t *addr, new32 = (old32 & ~mask) | (uint32_t)new << shift; old32 = (old32 & ~mask) | (uint32_t)old << shift; } while (_atomic_cas_32(ptr, old32, new32) != old32); - return (old >> shift) & mask; + return (old & mask) >> shift; } uint8_t @@ -73,5 +73,5 @@ _atomic_cas_8(volatile uint8_t *addr, ui new32 = (old32 & ~mask) | (uint32_t)new << shift; old32 = (old32 & ~mask) | (uint32_t)old << shift; } while (_atomic_cas_32(ptr, old32, new32) != old32); - return (old >> shift) & mask; + return (old & mask) >> shift; }