]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branches 'x86-rwsem-for-linus' and 'x86-gcc46-for-linus' of git://git.kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Aug 2010 17:22:40 +0000 (10:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Aug 2010 17:22:40 +0000 (10:22 -0700)
* 'x86-rwsem-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, rwsem: Minor cleanups
  x86, rwsem: Stay on fast path when count > 0 in __up_write()

* 'x86-gcc46-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, gcc-4.6: Fix set but not read variables
  x86, gcc-4.6: Avoid unused by set variables in rdmsr

arch/x86/include/asm/msr.h
arch/x86/include/asm/rwsem.h
arch/x86/kernel/aperture_64.c
arch/x86/kernel/cpu/mtrr/generic.c

index c5bc4c2d33f56399f98b55975abc23b3d694ea85..084ef95274cd78ceb51b1ea7a208a7a5e486199a 100644 (file)
@@ -148,8 +148,8 @@ static inline unsigned long long native_read_pmc(int counter)
 #define rdmsr(msr, val1, val2)                                 \
 do {                                                           \
        u64 __val = native_read_msr((msr));                     \
-       (val1) = (u32)__val;                                    \
-       (val2) = (u32)(__val >> 32);                            \
+       (void)((val1) = (u32)__val);                            \
+       (void)((val2) = (u32)(__val >> 32));                    \
 } while (0)
 
 static inline void wrmsr(unsigned msr, unsigned low, unsigned high)
index 606ede126972e568b992268da3df6f64b7e98480..d1e41b0f9b60b37eb061caec5661fc6fb9e1cbbf 100644 (file)
@@ -118,7 +118,7 @@ static inline void __down_read(struct rw_semaphore *sem)
 {
        asm volatile("# beginning down_read\n\t"
                     LOCK_PREFIX _ASM_INC "(%1)\n\t"
-                    /* adds 0x00000001, returns the old value */
+                    /* adds 0x00000001 */
                     "  jns        1f\n"
                     "  call call_rwsem_down_read_failed\n"
                     "1:\n\t"
@@ -156,11 +156,9 @@ static inline int __down_read_trylock(struct rw_semaphore *sem)
 static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
 {
        rwsem_count_t tmp;
-
-       tmp = RWSEM_ACTIVE_WRITE_BIAS;
        asm volatile("# beginning down_write\n\t"
                     LOCK_PREFIX "  xadd      %1,(%2)\n\t"
-                    /* subtract 0x0000ffff, returns the old value */
+                    /* adds 0xffff0001, returns the old value */
                     "  test      %1,%1\n\t"
                     /* was the count 0 before? */
                     "  jz        1f\n"
@@ -168,7 +166,7 @@ static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
                     "1:\n"
                     "# ending down_write"
                     : "+m" (sem->count), "=d" (tmp)
-                    : "a" (sem), "1" (tmp)
+                    : "a" (sem), "1" (RWSEM_ACTIVE_WRITE_BIAS)
                     : "memory", "cc");
 }
 
@@ -195,16 +193,16 @@ static inline int __down_write_trylock(struct rw_semaphore *sem)
  */
 static inline void __up_read(struct rw_semaphore *sem)
 {
-       rwsem_count_t tmp = -RWSEM_ACTIVE_READ_BIAS;
+       rwsem_count_t tmp;
        asm volatile("# beginning __up_read\n\t"
                     LOCK_PREFIX "  xadd      %1,(%2)\n\t"
                     /* subtracts 1, returns the old value */
                     "  jns        1f\n\t"
-                    "  call call_rwsem_wake\n"
+                    "  call call_rwsem_wake\n" /* expects old value in %edx */
                     "1:\n"
                     "# ending __up_read\n"
                     : "+m" (sem->count), "=d" (tmp)
-                    : "a" (sem), "1" (tmp)
+                    : "a" (sem), "1" (-RWSEM_ACTIVE_READ_BIAS)
                     : "memory", "cc");
 }
 
@@ -216,10 +214,9 @@ static inline void __up_write(struct rw_semaphore *sem)
        rwsem_count_t tmp;
        asm volatile("# beginning __up_write\n\t"
                     LOCK_PREFIX "  xadd      %1,(%2)\n\t"
-                    /* tries to transition
-                       0xffff0001 -> 0x00000000 */
-                    "  jz       1f\n"
-                    "  call call_rwsem_wake\n"
+                    /* subtracts 0xffff0001, returns the old value */
+                    "  jns        1f\n\t"
+                    "  call call_rwsem_wake\n" /* expects old value in %edx */
                     "1:\n\t"
                     "# ending __up_write\n"
                     : "+m" (sem->count), "=d" (tmp)
index b5d8b0bcf23588a413d5766d160e24ac6c811441..a2e0caf26e172c8f7b18231e4f4a072161ed66fe 100644 (file)
@@ -280,7 +280,7 @@ void __init early_gart_iommu_check(void)
         * or BIOS forget to put that in reserved.
         * try to update e820 to make that region as reserved.
         */
-       u32 agp_aper_base = 0, agp_aper_order = 0;
+       u32 agp_aper_order = 0;
        int i, fix, slot, valid_agp = 0;
        u32 ctl;
        u32 aper_size = 0, aper_order = 0, last_aper_order = 0;
@@ -291,7 +291,7 @@ void __init early_gart_iommu_check(void)
                return;
 
        /* This is mostly duplicate of iommu_hole_init */
-       agp_aper_base = search_agp_bridge(&agp_aper_order, &valid_agp);
+       search_agp_bridge(&agp_aper_order, &valid_agp);
 
        fix = 0;
        for (i = 0; i < ARRAY_SIZE(bus_dev_ranges); i++) {
index fd31a441c61cbecf51e554d2292a2600b7a70295..7d28d7d03885a1d28e0785221f8e0197b89f957f 100644 (file)
@@ -433,13 +433,12 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
 {
        unsigned int mask_lo, mask_hi, base_lo, base_hi;
        unsigned int tmp, hi;
-       int cpu;
 
        /*
         * get_mtrr doesn't need to update mtrr_state, also it could be called
         * from any cpu, so try to print it out directly.
         */
-       cpu = get_cpu();
+       get_cpu();
 
        rdmsr(MTRRphysMask_MSR(reg), mask_lo, mask_hi);