From: Kees van Reeuwijk Date: Wed, 17 Feb 2010 20:24:42 +0000 (+0000) Subject: Remove some unused #include. X-Git-Tag: v3.1.7~282 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/soc.html?a=commitdiff_plain;h=97c169b93a0436437c62c700ef0014bfb396cd6f;p=minix.git Remove some unused #include. Remove some unused variables and computations on them. --- diff --git a/kernel/arch/i386/do_int86.c b/kernel/arch/i386/do_int86.c index c5ea394c5..b65307059 100644 --- a/kernel/arch/i386/do_int86.c +++ b/kernel/arch/i386/do_int86.c @@ -8,7 +8,6 @@ #include "../../system.h" #include #include -#include #include #include "proto.h" diff --git a/kernel/arch/i386/memory.c b/kernel/arch/i386/memory.c index 27b211e44..83e7fc638 100644 --- a/kernel/arch/i386/memory.c +++ b/kernel/arch/i386/memory.c @@ -11,8 +11,6 @@ #include -#include - #include "proto.h" #include "../../proto.h" #include "../../proto.h" @@ -85,7 +83,7 @@ PUBLIC void vm_init(struct proc *newptproc) } else { \ int fp; \ int mustinvl; \ - u32_t pdeval, *pdevalptr, mask; \ + u32_t pdeval, mask; \ phys_bytes offset; \ vmassert(psok); \ if(PROC) { \ @@ -116,9 +114,9 @@ PUBLIC void vm_init(struct proc *newptproc) vmassert(PDE != NOPDE); \ vmassert(mask); \ if(dirtypde & mask) { \ - mustinvl = 1; \ + mustinvl = TRUE; \ } else { \ - mustinvl = 0; \ + mustinvl = FALSE; \ } \ inusepde = PDE; \ *PROCPDEPTR(ptproc, PDE) = pdeval; \ @@ -503,9 +501,8 @@ PUBLIC int vm_lookup(struct proc *proc, vir_bytes virtual, vir_bytes *physical, *===========================================================================*/ PUBLIC int vm_contiguous(struct proc *targetproc, u32_t vir_buf, size_t bytes) { - int first = 1, r, boundaries = 0; + int first = 1, r; u32_t prev_phys, po; - u32_t prev_vir; vmassert(targetproc); vmassert(bytes > 0); @@ -547,10 +544,8 @@ PUBLIC int vm_contiguous(struct proc *targetproc, u32_t vir_buf, size_t bytes) first = 0; prev_phys = phys; - prev_vir = vir_buf; vir_buf += I386_PAGE_SIZE; bytes -= I386_PAGE_SIZE; - boundaries++; } return 1; @@ -560,7 +555,7 @@ PUBLIC int vm_contiguous(struct proc *targetproc, u32_t vir_buf, size_t bytes) * vm_suspend * *===========================================================================*/ PRIVATE void vm_suspend(struct proc *caller, struct proc *target, - vir_bytes linaddr, vir_bytes len, int wrflag, int type) + vir_bytes linaddr, vir_bytes len, int type) { /* This range is not OK for this process. Set parameters * of the request and notify VM about the pending request. @@ -616,7 +611,7 @@ int delivermsg(struct proc *rp) rp->p_delivermsg_lin, sizeof(message), addr); if(addr) { - vm_suspend(rp, rp, rp->p_delivermsg_lin, sizeof(message), 1, + vm_suspend(rp, rp, rp->p_delivermsg_lin, sizeof(message), VMSTYPE_DELIVERMSG); r = VMSUSPEND; } else { @@ -849,7 +844,6 @@ int vmcheck; /* if nonzero, can return VMSUSPEND */ if((r=lin_lin_copy(procs[_SRC_], phys_addr[_SRC_], procs[_DST_], phys_addr[_DST_], bytes)) != OK) { struct proc *target; - int wr; phys_bytes lin; if(r != EFAULT_SRC && r != EFAULT_DST) minix_panic("lin_lin_copy failed", r); @@ -862,11 +856,9 @@ int vmcheck; /* if nonzero, can return VMSUSPEND */ if(r == EFAULT_SRC) { lin = phys_addr[_SRC_]; target = procs[_SRC_]; - wr = 0; } else if(r == EFAULT_DST) { lin = phys_addr[_DST_]; target = procs[_DST_]; - wr = 1; } else { minix_panic("r strange", r); } @@ -878,7 +870,7 @@ int vmcheck; /* if nonzero, can return VMSUSPEND */ #endif vmassert(proc_ptr->p_endpoint == SYSTEM); - vm_suspend(caller, target, lin, bytes, wr, + vm_suspend(caller, target, lin, bytes, VMSTYPE_KERNELCALL); NOREC_RETURN(virtualcopy, VMSUSPEND); } diff --git a/kernel/clock.c b/kernel/clock.c index fd57a3e2f..0e453ed2e 100644 --- a/kernel/clock.c +++ b/kernel/clock.c @@ -31,7 +31,6 @@ #include "kernel.h" #include "proc.h" -#include #include #include "clock.h" @@ -187,7 +186,6 @@ PUBLIC int ap_timer_int_handler(void) */ unsigned ticks = 1; - int expired = 0; struct proc * p, * billp; #ifdef CONFIG_WATCHDOG @@ -225,13 +223,16 @@ PUBLIC int ap_timer_int_handler(void) * well. If any of the timers expire, do_clocktick() will send out * signals. */ - if ((p->p_misc_flags & MF_VIRT_TIMER) && - (p->p_virt_left -= ticks) <= 0) expired = 1; - if ((p->p_misc_flags & MF_PROF_TIMER) && - (p->p_prof_left -= ticks) <= 0) expired = 1; + if ((p->p_misc_flags & MF_VIRT_TIMER)){ + p->p_virt_left -= ticks; + } + if ((p->p_misc_flags & MF_PROF_TIMER)){ + p->p_prof_left -= ticks; + } if (! (priv(p)->s_flags & BILLABLE) && - (billp->p_misc_flags & MF_PROF_TIMER) && - (billp->p_prof_left -= ticks) <= 0) expired = 1; + (billp->p_misc_flags & MF_PROF_TIMER)){ + billp->p_prof_left -= ticks; + } /* * Check if a process-virtual timer expired. Check current process, but diff --git a/kernel/proc.c b/kernel/proc.c index 57022e81a..84a4ed877 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include "debug.h" @@ -1050,7 +1049,7 @@ struct proc *caller_ptr; *===========================================================================*/ PRIVATE int try_one(struct proc *src_ptr, struct proc *dst_ptr, int *postponed) { - int i, do_notify, done; + int i, done; unsigned flags; size_t size; endpoint_t dst_e; @@ -1074,7 +1073,6 @@ PRIVATE int try_one(struct proc *src_ptr, struct proc *dst_ptr, int *postponed) dst_e= dst_ptr->p_endpoint; /* Scan the table */ - do_notify= FALSE; done= TRUE; for (i= 0; i #include #include -#include #include #include #include -#include /* Declaration of the call vector that defines the mapping of system calls * to handler functions. The vector is initialized in sys_init() with map(), @@ -324,7 +322,6 @@ PUBLIC void send_sig(int proc_nr, int sig_nr) * send a notification with source SYSTEM. */ register struct proc *rp; - static int n; if(!isokprocn(proc_nr) || isemptyn(proc_nr)) minix_panic("send_sig to empty process", proc_nr); diff --git a/kernel/system/do_endksig.c b/kernel/system/do_endksig.c index 9bddd8a45..1b09b894c 100644 --- a/kernel/system/do_endksig.c +++ b/kernel/system/do_endksig.c @@ -6,7 +6,6 @@ */ #include "../system.h" -#include #if USE_ENDKSIG