Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://www.jni.nu/cris

* 'for-linus' of git://www.jni.nu/cris:
CRISv10: remove redundant tests on unsigned
CRISv32: irq.c - Move end brace outside #endif
CRISv32: Fix potential null reference in cryptocop driver.
CRISv32: Add arch optimized strcmp.
CRIS: assignment/is equal confusion

+36 -9
+2 -2
arch/cris/arch-v10/kernel/dma.c
··· 24 24 unsigned long int gens; 25 25 int fail = -EINVAL; 26 26 27 - if ((dmanr < 0) || (dmanr >= MAX_DMA_CHANNELS)) { 27 + if (dmanr >= MAX_DMA_CHANNELS) { 28 28 printk(KERN_CRIT "cris_request_dma: invalid DMA channel %u\n", dmanr); 29 29 return -EINVAL; 30 30 } ··· 213 213 void cris_free_dma(unsigned int dmanr, const char * device_id) 214 214 { 215 215 unsigned long flags; 216 - if ((dmanr < 0) || (dmanr >= MAX_DMA_CHANNELS)) { 216 + if (dmanr >= MAX_DMA_CHANNELS) { 217 217 printk(KERN_CRIT "cris_free_dma: invalid DMA channel %u\n", dmanr); 218 218 return; 219 219 }
+2 -2
arch/cris/arch-v32/drivers/cryptocop.c
··· 1395 1395 if (padlen < MD5_MIN_PAD_LENGTH) padlen += MD5_BLOCK_LENGTH; 1396 1396 1397 1397 p = kmalloc(padlen, alloc_flag); 1398 - if (!pad) return -ENOMEM; 1398 + if (!p) return -ENOMEM; 1399 1399 1400 1400 *p = 0x80; 1401 1401 memset(p+1, 0, padlen - 1); ··· 1427 1427 if (padlen < SHA1_MIN_PAD_LENGTH) padlen += SHA1_BLOCK_LENGTH; 1428 1428 1429 1429 p = kmalloc(padlen, alloc_flag); 1430 - if (!pad) return -ENOMEM; 1430 + if (!p) return -ENOMEM; 1431 1431 1432 1432 *p = 0x80; 1433 1433 memset(p+1, 0, padlen - 1);
+1 -1
arch/cris/arch-v32/kernel/irq.c
··· 430 430 masked[i] &= ~TIMER_MASK; 431 431 do_IRQ(TIMER0_INTR_VECT, regs); 432 432 } 433 - } 434 433 #endif 434 + } 435 435 436 436 #ifdef IGNORE_MASK 437 437 /* Remove IRQs that can't be handled as multiple. */
+1 -1
arch/cris/arch-v32/lib/Makefile
··· 3 3 # 4 4 5 5 lib-y = checksum.o checksumcopy.o string.o usercopy.o memset.o \ 6 - csumcpfruser.o spinlock.o delay.o 6 + csumcpfruser.o spinlock.o delay.o strcmp.o 7 7
+21
arch/cris/arch-v32/lib/strcmp.S
··· 1 + ; strcmp.S -- CRISv32 version. 2 + ; Copyright (C) 2008 AXIS Communications AB 3 + ; Written by Edgar E. Iglesias 4 + ; 5 + ; This source code is licensed under the GNU General Public License, 6 + ; Version 2. See the file COPYING for more details. 7 + 8 + .global strcmp 9 + .type strcmp,@function 10 + strcmp: 11 + 1: 12 + move.b [$r10+], $r12 13 + seq $r13 14 + sub.b [$r11+], $r12 15 + or.b $r12, $r13 16 + beq 1b 17 + nop 18 + 19 + ret 20 + movs.b $r12, $r10 21 + .size strcmp, . - strcmp
+3 -3
arch/cris/include/arch-v32/arch/spinlock.h
··· 78 78 { 79 79 __raw_spin_lock(&rw->slock); 80 80 while (rw->lock != RW_LOCK_BIAS); 81 - rw->lock == 0; 81 + rw->lock = 0; 82 82 __raw_spin_unlock(&rw->slock); 83 83 } 84 84 ··· 93 93 { 94 94 __raw_spin_lock(&rw->slock); 95 95 while (rw->lock != RW_LOCK_BIAS); 96 - rw->lock == RW_LOCK_BIAS; 96 + rw->lock = RW_LOCK_BIAS; 97 97 __raw_spin_unlock(&rw->slock); 98 98 } 99 99 ··· 114 114 int ret = 0; 115 115 __raw_spin_lock(&rw->slock); 116 116 if (rw->lock == RW_LOCK_BIAS) { 117 - rw->lock == 0; 117 + rw->lock = 0; 118 118 ret = 1; 119 119 } 120 120 __raw_spin_unlock(&rw->slock);
+6
arch/cris/include/asm/string.h
··· 11 11 #define __HAVE_ARCH_MEMSET 12 12 extern void *memset(void *, int, size_t); 13 13 14 + #ifdef CONFIG_ETRAX_ARCH_V32 15 + /* For v32 we provide strcmp. */ 16 + #define __HAVE_ARCH_STRCMP 17 + extern int strcmp(const char *s1, const char *s2); 18 + #endif 19 + 14 20 #endif