aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-23 13:47:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-23 13:47:01 -0400
commita800faec1b21d7133b5f0c8c6dac593b7c4e118d (patch)
treee190372af6ee0a2a64e9ae70690b18b48d66be00 /arch
parentc488eef8154b36cce905624577183dc1fa8f6da0 (diff)
parent7b994836f09fc3ce7d073ad6f8259a1a84003e02 (diff)
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
Diffstat (limited to 'arch')
-rw-r--r--arch/cris/arch-v10/kernel/dma.c4
-rw-r--r--arch/cris/arch-v32/drivers/cryptocop.c4
-rw-r--r--arch/cris/arch-v32/kernel/irq.c2
-rw-r--r--arch/cris/arch-v32/lib/Makefile2
-rw-r--r--arch/cris/arch-v32/lib/strcmp.S21
-rw-r--r--arch/cris/include/arch-v32/arch/spinlock.h6
-rw-r--r--arch/cris/include/asm/string.h6
7 files changed, 36 insertions, 9 deletions
diff --git a/arch/cris/arch-v10/kernel/dma.c b/arch/cris/arch-v10/kernel/dma.c
index 929e68666299..d31504b4a19e 100644
--- a/arch/cris/arch-v10/kernel/dma.c
+++ b/arch/cris/arch-v10/kernel/dma.c
@@ -24,7 +24,7 @@ int cris_request_dma(unsigned int dmanr, const char * device_id,
24 unsigned long int gens; 24 unsigned long int gens;
25 int fail = -EINVAL; 25 int fail = -EINVAL;
26 26
27 if ((dmanr < 0) || (dmanr >= MAX_DMA_CHANNELS)) { 27 if (dmanr >= MAX_DMA_CHANNELS) {
28 printk(KERN_CRIT "cris_request_dma: invalid DMA channel %u\n", dmanr); 28 printk(KERN_CRIT "cris_request_dma: invalid DMA channel %u\n", dmanr);
29 return -EINVAL; 29 return -EINVAL;
30 } 30 }
@@ -213,7 +213,7 @@ int cris_request_dma(unsigned int dmanr, const char * device_id,
213void cris_free_dma(unsigned int dmanr, const char * device_id) 213void cris_free_dma(unsigned int dmanr, const char * device_id)
214{ 214{
215 unsigned long flags; 215 unsigned long flags;
216 if ((dmanr < 0) || (dmanr >= MAX_DMA_CHANNELS)) { 216 if (dmanr >= MAX_DMA_CHANNELS) {
217 printk(KERN_CRIT "cris_free_dma: invalid DMA channel %u\n", dmanr); 217 printk(KERN_CRIT "cris_free_dma: invalid DMA channel %u\n", dmanr);
218 return; 218 return;
219 } 219 }
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
index 67c61ea86813..fd529a0ec758 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -1395,7 +1395,7 @@ static int create_md5_pad(int alloc_flag, unsigned long long hashed_length, char
1395 if (padlen < MD5_MIN_PAD_LENGTH) padlen += MD5_BLOCK_LENGTH; 1395 if (padlen < MD5_MIN_PAD_LENGTH) padlen += MD5_BLOCK_LENGTH;
1396 1396
1397 p = kmalloc(padlen, alloc_flag); 1397 p = kmalloc(padlen, alloc_flag);
1398 if (!pad) return -ENOMEM; 1398 if (!p) return -ENOMEM;
1399 1399
1400 *p = 0x80; 1400 *p = 0x80;
1401 memset(p+1, 0, padlen - 1); 1401 memset(p+1, 0, padlen - 1);
@@ -1427,7 +1427,7 @@ static int create_sha1_pad(int alloc_flag, unsigned long long hashed_length, cha
1427 if (padlen < SHA1_MIN_PAD_LENGTH) padlen += SHA1_BLOCK_LENGTH; 1427 if (padlen < SHA1_MIN_PAD_LENGTH) padlen += SHA1_BLOCK_LENGTH;
1428 1428
1429 p = kmalloc(padlen, alloc_flag); 1429 p = kmalloc(padlen, alloc_flag);
1430 if (!pad) return -ENOMEM; 1430 if (!p) return -ENOMEM;
1431 1431
1432 *p = 0x80; 1432 *p = 0x80;
1433 memset(p+1, 0, padlen - 1); 1433 memset(p+1, 0, padlen - 1);
diff --git a/arch/cris/arch-v32/kernel/irq.c b/arch/cris/arch-v32/kernel/irq.c
index d70b445f4a8f..57668db25031 100644
--- a/arch/cris/arch-v32/kernel/irq.c
+++ b/arch/cris/arch-v32/kernel/irq.c
@@ -430,8 +430,8 @@ crisv32_do_multiple(struct pt_regs* regs)
430 masked[i] &= ~TIMER_MASK; 430 masked[i] &= ~TIMER_MASK;
431 do_IRQ(TIMER0_INTR_VECT, regs); 431 do_IRQ(TIMER0_INTR_VECT, regs);
432 } 432 }
433 }
434#endif 433#endif
434 }
435 435
436#ifdef IGNORE_MASK 436#ifdef IGNORE_MASK
437 /* Remove IRQs that can't be handled as multiple. */ 437 /* Remove IRQs that can't be handled as multiple. */
diff --git a/arch/cris/arch-v32/lib/Makefile b/arch/cris/arch-v32/lib/Makefile
index eb4aad1f1158..dd296b9db034 100644
--- a/arch/cris/arch-v32/lib/Makefile
+++ b/arch/cris/arch-v32/lib/Makefile
@@ -3,5 +3,5 @@
3# 3#
4 4
5lib-y = checksum.o checksumcopy.o string.o usercopy.o memset.o \ 5lib-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
diff --git a/arch/cris/arch-v32/lib/strcmp.S b/arch/cris/arch-v32/lib/strcmp.S
new file mode 100644
index 000000000000..8f7a1ee62591
--- /dev/null
+++ b/arch/cris/arch-v32/lib/strcmp.S
@@ -0,0 +1,21 @@
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
10strcmp:
111:
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
diff --git a/arch/cris/include/arch-v32/arch/spinlock.h b/arch/cris/include/arch-v32/arch/spinlock.h
index 129756b96661..367a53ea10c5 100644
--- a/arch/cris/include/arch-v32/arch/spinlock.h
+++ b/arch/cris/include/arch-v32/arch/spinlock.h
@@ -78,7 +78,7 @@ static inline void __raw_write_lock(raw_rwlock_t *rw)
78{ 78{
79 __raw_spin_lock(&rw->slock); 79 __raw_spin_lock(&rw->slock);
80 while (rw->lock != RW_LOCK_BIAS); 80 while (rw->lock != RW_LOCK_BIAS);
81 rw->lock == 0; 81 rw->lock = 0;
82 __raw_spin_unlock(&rw->slock); 82 __raw_spin_unlock(&rw->slock);
83} 83}
84 84
@@ -93,7 +93,7 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
93{ 93{
94 __raw_spin_lock(&rw->slock); 94 __raw_spin_lock(&rw->slock);
95 while (rw->lock != RW_LOCK_BIAS); 95 while (rw->lock != RW_LOCK_BIAS);
96 rw->lock == RW_LOCK_BIAS; 96 rw->lock = RW_LOCK_BIAS;
97 __raw_spin_unlock(&rw->slock); 97 __raw_spin_unlock(&rw->slock);
98} 98}
99 99
@@ -114,7 +114,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
114 int ret = 0; 114 int ret = 0;
115 __raw_spin_lock(&rw->slock); 115 __raw_spin_lock(&rw->slock);
116 if (rw->lock == RW_LOCK_BIAS) { 116 if (rw->lock == RW_LOCK_BIAS) {
117 rw->lock == 0; 117 rw->lock = 0;
118 ret = 1; 118 ret = 1;
119 } 119 }
120 __raw_spin_unlock(&rw->slock); 120 __raw_spin_unlock(&rw->slock);
diff --git a/arch/cris/include/asm/string.h b/arch/cris/include/asm/string.h
index 691190e99a27..d5db39f9eea1 100644
--- a/arch/cris/include/asm/string.h
+++ b/arch/cris/include/asm/string.h
@@ -11,4 +11,10 @@ extern void *memcpy(void *, const void *, size_t);
11#define __HAVE_ARCH_MEMSET 11#define __HAVE_ARCH_MEMSET
12extern void *memset(void *, int, size_t); 12extern 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
17extern int strcmp(const char *s1, const char *s2);
18#endif
19
14#endif 20#endif