diff --git a/proc.c b/proc.c
index 37adbb440a035fbd324aba5af4a4978df88a892f..89eb1d4e39ccb64a1da5c8c692de14cc13e54cd5 100644
--- a/proc.c
+++ b/proc.c
@@ -204,9 +204,9 @@ scheduler(void)
 void
 sched(void)
 {
-  struct proc *p = curproc[cpu()];
+  struct proc *cp = curproc[cpu()];
 
-  if(p->state == RUNNING)
+  if(cp->state == RUNNING)
     panic("sched running");
   if(!holding(&proc_table_lock))
     panic("sched proc_table_lock");
@@ -221,10 +221,10 @@ sched(void)
 void
 yield(void)
 {
-  struct proc *p = curproc[cpu()];
+  struct proc *cp = curproc[cpu()];
 
   acquire(&proc_table_lock);
-  p->state = RUNNABLE;
+  cp->state = RUNNABLE;
   sched();
   release(&proc_table_lock);
 }
@@ -246,9 +246,9 @@ forkret(void)
 void
 sleep(void *chan, struct spinlock *lk)
 {
-  struct proc *p = curproc[cpu()];
+  struct proc *cp = curproc[cpu()];
 
-  if(p == 0)
+  if(cp == 0)
     panic("sleep");
 
   if(lk == 0)
@@ -266,12 +266,12 @@ sleep(void *chan, struct spinlock *lk)
   }
 
   // Go to sleep.
-  p->chan = chan;
-  p->state = SLEEPING;
+  cp->chan = chan;
+  cp->state = SLEEPING;
   sched();
 
   // Tidy up.
-  p->chan = 0;
+  cp->chan = 0;
 
   // Reacquire original lock.
   if(lk != &proc_table_lock){
diff --git a/syscall.c b/syscall.c
index b44a7a9891a55f246e10ad5114e8886dba0770d6..adc2b58ceda2cbcb75eb78311f56c53508c5e3f0 100644
--- a/syscall.c
+++ b/syscall.c
@@ -37,15 +37,15 @@ fetchint(struct proc *p, uint addr, int *ip)
 int
 fetchstr(struct proc *p, uint addr, char **pp)
 {
-  char *cp, *ep;
+  char *s, *ep;
 
   if(addr >= p->sz)
     return -1;
   *pp = p->mem + addr;
   ep = p->mem + p->sz;
-  for(cp = *pp; cp < ep; cp++)
-    if(*cp == 0)
-      return cp - *pp;
+  for(s = *pp; s < ep; s++)
+    if(*s == 0)
+      return s - *pp;
   return -1;
 }
 
@@ -53,9 +53,9 @@ fetchstr(struct proc *p, uint addr, char **pp)
 int
 argint(int argno, int *ip)
 {
-  struct proc *p = curproc[cpu()];
+  struct proc *cp = curproc[cpu()];
 
-  return fetchint(p, p->tf->esp + 4 + 4*argno, ip);
+  return fetchint(cp, cp->tf->esp + 4 + 4*argno, ip);
 }
 
 // Fetch the nth word-sized system call argument as a pointer
@@ -65,13 +65,13 @@ int
 argptr(int argno, char **pp, int size)
 {
   int i;
-  struct proc *p = curproc[cpu()];
+  struct proc *cp = curproc[cpu()];
   
   if(argint(argno, &i) < 0)
     return -1;
-  if((uint)i >= p->sz || (uint)i+size >= p->sz)
+  if((uint)i >= cp->sz || (uint)i+size >= cp->sz)
     return -1;
-  *pp = p->mem + i;
+  *pp = cp->mem + i;
   return 0;
 }
 
diff --git a/sysfile.c b/sysfile.c
index 475c907a4e36e0ad11c3de37bd21d37a58dfb220..b5d2337b90d16392b3354100b3ecc98b6952a5e6 100644
--- a/sysfile.c
+++ b/sysfile.c
@@ -22,11 +22,11 @@ argfd(int argno, int *pfd, struct file **pf)
 {
   int fd;
   struct file *f;
-  struct proc *p = curproc[cpu()];
+  struct proc *cp = curproc[cpu()];
 
   if(argint(argno, &fd) < 0)
     return -1;
-  if(fd < 0 || fd >= NOFILE || (f=p->ofile[fd]) == 0)
+  if(fd < 0 || fd >= NOFILE || (f=cp->ofile[fd]) == 0)
     return -1;
   if(pfd)
     *pfd = fd;
@@ -41,10 +41,11 @@ static int
 fdalloc(struct file *f)
 {
   int fd;
-  struct proc *p = curproc[cpu()];
+  struct proc *cp = curproc[cpu()];
+
   for(fd = 0; fd < NOFILE; fd++){
-    if(p->ofile[fd] == 0){
-      p->ofile[fd] = f;
+    if(cp->ofile[fd] == 0){
+      cp->ofile[fd] = f;
       return fd;
     }
   }
@@ -57,7 +58,7 @@ sys_pipe(void)
   int *fd;
   struct file *rf = 0, *wf = 0;
   int fd0, fd1;
-  struct proc *p = curproc[cpu()];
+  struct proc *cp = curproc[cpu()];
 
   if(argptr(0, (void*)&fd, 2*sizeof fd[0]) < 0)
     return -1;
@@ -66,7 +67,7 @@ sys_pipe(void)
   fd0 = -1;
   if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
     if(fd0 >= 0)
-      p->ofile[fd0] = 0;
+      cp->ofile[fd0] = 0;
     fileclose(rf);
     fileclose(wf);
     return -1;
@@ -241,7 +242,7 @@ sys_mkdir(void)
 int
 sys_chdir(void)
 {
-  struct proc *p = curproc[cpu()];
+  struct proc *cp = curproc[cpu()];
   struct inode *ip;
   char *path;
 
@@ -261,9 +262,9 @@ sys_chdir(void)
     return -1;
   }
 
-  idecref(p->cwd);
-  p->cwd = ip;
-  iunlock(p->cwd);
+  idecref(cp->cwd);
+  cp->cwd = ip;
+  iunlock(cp->cwd);
   return 0;
 }
 
diff --git a/umalloc.c b/umalloc.c
index 5128c32ba420afc599a921e288b597e52935b91c..3473c792927aebb2d53e293aef812d87d3c99717 100644
--- a/umalloc.c
+++ b/umalloc.c
@@ -46,17 +46,17 @@ free(void *ap)
 static Header*
 morecore(uint nu)
 {
-  char *cp;
-  Header *up;
+  char *p;
+  Header *hp;
 
   if(nu < PAGE)
     nu = PAGE;
-  cp = sbrk(nu * sizeof(Header));
-  if(cp == (char*) -1)
+  p = sbrk(nu * sizeof(Header));
+  if(p == (char*) -1)
     return 0;
-  up = (Header*) cp;
-  up->s.size = nu;
-  free((void*)(up + 1));
+  hp = (Header*)p;
+  hp->s.size = nu;
+  free((void*)(hp + 1));
   return freep;
 }