lkml.org 
[lkml]   [2004]   [Feb]   [6]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
Patch in this message
/
Subject[PATCH][v850] Make v850 __delay function handle a loop count of zero
DateFri, 6 Feb 2004 16:54:47 +0900 (JST)
From(Miles Bader)
[In practice, this only seems to occur in odd debugging
situations, but it's quite annoying then.]

diff -ruN -X../cludes linux-2.6.2-uc0/include/asm-v850/delay.h linux-2.6.2-uc0-v850-20040206/include/asm-v850/delay.h
--- linux-2.6.2-uc0/include/asm-v850/delay.h	2002-11-05 11:25:31.000000000 +0900
+++ linux-2.6.2-uc0-v850-20040206/include/asm-v850/delay.h	2004-02-06 14:02:30.000000000 +0900
@@ -2,8 +2,8 @@
  * include/asm-v850/delay.h -- Delay routines, using a pre-computed
  * 	"loops_per_second" value
  *
- *  Copyright (C) 2001  NEC Corporation
- *  Copyright (C) 2001  Miles Bader <miles@gnu.org>
+ *  Copyright (C) 2001,03  NEC Corporation
+ *  Copyright (C) 2001,03  Miles Bader <miles@gnu.org>
  *  Copyright (C) 1994 Hamish Macdonald
  *
  * This file is subject to the terms and conditions of the GNU General
@@ -18,8 +18,9 @@
 
 extern __inline__ void __delay(unsigned long loops)
 {
-	__asm__ __volatile__ ("1: add -1, %0; bnz 1b"
-			      : "=r" (loops) : "0" (loops));
+	if (loops)
+		__asm__ __volatile__ ("1: add -1, %0; bnz 1b"
+				      : "=r" (loops) : "0" (loops));
 }
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:00    [from the cache]
©2003-2008