linux-mips
[Top] [All Lists]

Re: CVS Update@linux-mips.org: linux

To: linux-mips@linux-mips.org
Subject: Re: CVS Update@linux-mips.org: linux
From: "Ilya A. Volynets-Evenbakh" <ilya@total-knowledge.com>
Date: Sat, 08 Jan 2005 12:25:35 -0800
Cc: ralf@linux-mips.org
In-reply-to: <20050108180025Z8225397-1340+834@linux-mips.org>
Organization: Total Knowledge
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20050108180025Z8225397-1340+834@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041221



ralf@linux-mips.org wrote:

CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ralf@ftp.linux-mips.org 05/01/08 18:00:18

Modified files:
include/asm-mips: bitops.h
Log message:
        Fix int vs. long bugs breaking the non-ll/sc case on 64-bit.

diff -urN linux/include/asm-mips/bitops.h linux/include/asm-mips/bitops.h
--- linux/include/asm-mips/bitops.h     2004/10/12 01:45:51     1.55
+++ linux/include/asm-mips/bitops.h     2005/01/08 18:00:18     1.56
@@ -92,7 +92,7 @@
                __bi_flags;

                a += nr >> SZLONG_LOG;
-               mask = 1 << (nr & SZLONG_MASK);
+               mask = 1UL << (nr & SZLONG_MASK);
                __bi_local_irq_save(flags);
                *a |= mask;
                __bi_local_irq_restore(flags);
@@ -385,7 +385,7 @@
                __bi_flags;

                a += nr >> SZLONG_LOG;
-               mask = 1 << (nr & SZLONG_MASK);
+               mask = 1UL << (nr & SZLONG_MASK);
                __bi_local_irq_save(flags);
                retval = (mask & *a) != 0;
                *a &= ~mask;

Any reason why same change wasn't applied to rest of bitops functions?

Index: include/asm/bitops.h
===================================================================
RCS file: /home/cvs/linux/include/asm-mips/bitops.h,v
retrieving revision 1.56
diff -U5 -r1.56 bitops.h
--- include/asm/bitops.h        8 Jan 2005 18:00:18 -0000       1.56
+++ include/asm/bitops.h        8 Jan 2005 20:21:59 -0000
@@ -150,11 +150,11 @@
               volatile unsigned long *a = addr;
               unsigned long mask;
               __bi_flags;

               a += nr >> SZLONG_LOG;
-               mask = 1 << (nr & SZLONG_MASK);
+               mask = 1UL << (nr & SZLONG_MASK);
               __bi_local_irq_save(flags);
               *a &= ~mask;
               __bi_local_irq_restore(flags);
       }
}
@@ -212,11 +212,11 @@
               volatile unsigned long *a = addr;
               unsigned long mask;
               __bi_flags;

               a += nr >> SZLONG_LOG;
-               mask = 1 << (nr & SZLONG_MASK);
+               mask = 1UL << (nr & SZLONG_MASK);
               __bi_local_irq_save(flags);
               *a ^= mask;
               __bi_local_irq_restore(flags);
       }
}
@@ -291,11 +291,11 @@
               unsigned long mask;
               int retval;
               __bi_flags;

               a += nr >> SZLONG_LOG;
-               mask = 1 << (nr & SZLONG_MASK);
+               mask = 1UL << (nr & SZLONG_MASK);
               __bi_local_irq_save(flags);
               retval = (mask & *a) != 0;
               *a |= mask;
               __bi_local_irq_restore(flags);

@@ -318,11 +318,11 @@
       volatile unsigned long *a = addr;
       unsigned long mask;
       int retval;

       a += nr >> SZLONG_LOG;
-       mask = 1 << (nr & SZLONG_MASK);
+       mask = 1UL << (nr & SZLONG_MASK);
       retval = (mask & *a) != 0;
       *a |= mask;

       return retval;
}
@@ -472,11 +472,11 @@
               volatile unsigned long *a = addr;
               unsigned long mask, retval;
               __bi_flags;

               a += nr >> SZLONG_LOG;
-               mask = 1 << (nr & SZLONG_MASK);
+               mask = 1UL << (nr & SZLONG_MASK);
               __bi_local_irq_save(flags);
               retval = (mask & *a) != 0;
               *a ^= mask;
               __bi_local_irq_restore(flags);



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