Skip to contentSkip to conversation

CVS [email protected]: linux

DISCUSSION Ilya A. Volynets-Evenbakh 2 participants 2 messages Jan 8, 2005 1 message not in the archive MIPS

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 26 lines · [email protected] wrote:

CVSROOT: /home/cvs
Module name: linux
Changes by: [email protected] 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

include/asm-mips/bitops.h +1 -1
@@ -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);

include/asm-mips/bitops.h line 391

Quoted 8 lines
include/asm-mips/bitops.h +1 -1
@@ -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

asm/bitops.h 8 Jan 2005 20:21:59 -0000 renamed from asm/bitops.h 8 Jan 2005 18:00:18 -0000 1.56 +1 -1
diff -U5 -r1.56 bitops.h
@@ -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);
#2 lore raw
Quoted 5 lines · Ilya A. Volynets-Evenbakh
Quoted 5 lines

Modified files:
include/asm-mips: bitops.h

Log message:
Fix int vs. long bugs breaking the non-ll/sc case on 64-bit.

Argh. One of these days ;)

Ralf