linux-mips
[Top] [All Lists]

Re: smp_mb() in asm-mips/bitops.h

To: ralf@linux-mips.org
Subject: Re: smp_mb() in asm-mips/bitops.h
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Thu, 14 Jun 2007 00:56:31 +0900 (JST)
Cc: linux-mips@linux-mips.org
In-reply-to: <20070607122344.GD26047@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20070607.165301.63743560.nemoto@toshiba-tops.co.jp> <20070607122344.GD26047@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On Thu, 7 Jun 2007 13:23:44 +0100, Ralf Baechle <ralf@linux-mips.org> wrote:
> @@ -310,6 +306,7 @@ static inline int test_and_clear_bit(unsigned long nr,
>       volatile unsigned long *addr)
>  {
>       unsigned short bit = nr & SZLONG_MASK;
> +     unsigned long res;
>  
>       if (cpu_has_llsc && R10000_LLSC_WAR) {
>               unsigned long *m = ((unsigned long *) addr) + (nr >> 
> SZLONG_LOG);

You forgot to remove one more 'res' variable.


Subject: Remove a duplicated local variable in test_and_clear_bit()

Fix a sparse warning caused by 2c921d07f8c641e691b0dfd80a5cfe14c60ec489

include2/asm/bitops.h:313:23: warning: symbol 'res' shadows an earlier one
include2/asm/bitops.h:309:16: originally declared here

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index ffe245b..d9e81af 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -310,7 +310,7 @@ static inline int test_and_clear_bit(unsigned long nr,
 
        if (cpu_has_llsc && R10000_LLSC_WAR) {
                unsigned long *m = ((unsigned long *) addr) + (nr >> 
SZLONG_LOG);
-               unsigned long temp, res;
+               unsigned long temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"

<Prev in Thread] Current Thread [Next in Thread>