shithub: riscv

Download patch

ref: 0ad4ceb8d08c53b126ecd60e9d5f0afbad134c4c
parent: 262d5c101bae721f5e4428510448f6c7a247fde4
author: cinap_lenrek <[email protected]>
date: Mon Dec 21 17:03:46 EST 2020

kernel: make addbroken() static, remove misleading Proc* argument

--- a/sys/src/9/port/proc.c
+++ b/sys/src/9/port/proc.c
@@ -1036,8 +1036,8 @@
 	Proc	*p[NBROKEN];
 }broken;
 
-void
-addbroken(Proc *p)
+static void
+addbroken(void)
 {
 	qlock(&broken);
 	if(broken.n == NBROKEN) {
@@ -1045,12 +1045,12 @@
 		memmove(&broken.p[0], &broken.p[1], sizeof(Proc*)*(NBROKEN-1));
 		--broken.n;
 	}
-	broken.p[broken.n++] = p;
+	broken.p[broken.n++] = up;
 	qunlock(&broken);
 
 	edfstop(up);
-	p->state = Broken;
-	p->psstate = nil;
+	up->state = Broken;
+	up->psstate = nil;
 	sched();
 }
 
@@ -1182,7 +1182,7 @@
 	}
 
 	if(!freemem)
-		addbroken(up);
+		addbroken();
 
 	qlock(&up->debug);