From 1a81e38b17144624415d252a521fd5a06079d681 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 11 Jan 2011 13:01:13 -0500 Subject: make new code like old code Variable declarations at top of function, separate from initialization. Use == 0 instead of ! for checking pointers. Consistent spacing around {, *, casts. Declare 0-parameter functions as (void) not (). Integer valued functions return -1 on failure, 0 on success. --- spinlock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spinlock.c') diff --git a/spinlock.c b/spinlock.c index 281748a..e668598 100644 --- a/spinlock.c +++ b/spinlock.c @@ -71,7 +71,7 @@ getcallerpcs(void *v, uint pcs[]) ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ - if(ebp == 0 || ebp < (uint *) 0x100000 || ebp == (uint*)0xffffffff) + if(ebp == 0 || ebp < (uint*)0x100000 || ebp == (uint*)0xffffffff) break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp -- cgit v1.2.3