kern_sched.c:
- remove unused functions
- mark static functions as static

proc.h:
- remove declarations
- convert spaces to tabs
- remove trailing empty line

Index: sys/kern/kern_sched.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_sched.c,v
retrieving revision 1.41
diff -u -p -r1.41 kern_sched.c
--- sys/kern/kern_sched.c       23 Dec 2015 14:51:17 -0000      1.41
+++ sys/kern/kern_sched.c       2 Mar 2016 15:56:33 -0000
@@ -28,10 +28,18 @@
 
 #include <uvm/uvm_extern.h>
 
-void sched_kthreads_create(void *);
-
-int sched_proc_to_cpu_cost(struct cpu_info *ci, struct proc *p);
-struct proc *sched_steal_proc(struct cpu_info *);
+static void     sched_kthreads_create(void *);
+static int      sched_proc_to_cpu_cost(struct cpu_info *ci, struct proc *p);
+static struct proc *sched_steal_proc(struct cpu_info *);
+
+static void     cpuset_complement(struct cpuset *, struct cpuset *,
+                   struct cpuset *);
+static void     cpuset_copy(struct cpuset *, struct cpuset *);
+static struct cpu_info *cpuset_first(struct cpuset *);
+static void     cpuset_del(struct cpuset *, struct cpu_info *);
+static void     cpuset_init_cpu(struct cpu_info *);
+static void     cpuset_intersection(struct cpuset *t, struct cpuset *,
+                   struct cpuset *);
 
 /*
  * To help choosing which cpu should run which process we keep track
@@ -100,7 +108,7 @@ sched_init_cpu(struct cpu_info *ci)
        cpuset_add(&sched_all_cpus, ci);
 }
 
-void
+static void
 sched_kthreads_create(void *v)
 {
        struct cpu_info *ci = v;
@@ -454,7 +462,7 @@ sched_choosecpu(struct proc *p)
 /*
  * Attempt to steal a proc from some cpu.
  */
-struct proc *
+static struct proc *
 sched_steal_proc(struct cpu_info *self)
 {
        struct proc *best = NULL;
@@ -534,7 +542,7 @@ int sched_cost_runnable = 3;
 int sched_cost_resident = 1;
 #endif
 
-int
+static int
 sched_proc_to_cpu_cost(struct cpu_info *ci, struct proc *p)
 {
        int cost = 0;
@@ -709,7 +717,7 @@ sched_barrier(struct cpu_info *ci)
 struct cpu_info *cpuset_infos[MAXCPUS];
 static struct cpuset cpuset_all;
 
-void
+static void
 cpuset_init_cpu(struct cpu_info *ci)
 {
        cpuset_add(&cpuset_all, ci);
@@ -717,19 +725,13 @@ cpuset_init_cpu(struct cpu_info *ci)
 }
 
 void
-cpuset_clear(struct cpuset *cs)
-{
-       memset(cs, 0, sizeof(*cs));
-}
-
-void
 cpuset_add(struct cpuset *cs, struct cpu_info *ci)
 {
        unsigned int num = CPU_INFO_UNIT(ci);
        atomic_setbits_int(&cs->cs_set[num/32], (1 << (num % 32)));
 }
 
-void
+static void
 cpuset_del(struct cpuset *cs, struct cpu_info *ci)
 {
        unsigned int num = CPU_INFO_UNIT(ci);
@@ -743,19 +745,13 @@ cpuset_isset(struct cpuset *cs, struct c
        return (cs->cs_set[num/32] & (1 << (num % 32)));
 }
 
-void
-cpuset_add_all(struct cpuset *cs)
-{
-       cpuset_copy(cs, &cpuset_all);
-}
-
-void
+static void
 cpuset_copy(struct cpuset *to, struct cpuset *from)
 {
        memcpy(to, from, sizeof(*to));
 }
 
-struct cpu_info *
+static struct cpu_info *
 cpuset_first(struct cpuset *cs)
 {
        int i;
@@ -767,16 +763,7 @@ cpuset_first(struct cpuset *cs)
        return (NULL);
 }
 
-void
-cpuset_union(struct cpuset *to, struct cpuset *a, struct cpuset *b)
-{
-       int i;
-
-       for (i = 0; i < CPUSET_ASIZE(ncpus); i++)
-               to->cs_set[i] = a->cs_set[i] | b->cs_set[i];
-}
-
-void
+static void
 cpuset_intersection(struct cpuset *to, struct cpuset *a, struct cpuset *b)
 {
        int i;
@@ -785,7 +772,7 @@ cpuset_intersection(struct cpuset *to, s
                to->cs_set[i] = a->cs_set[i] & b->cs_set[i];
 }
 
-void
+static void
 cpuset_complement(struct cpuset *to, struct cpuset *a, struct cpuset *b)
 {
        int i;
Index: sys/sys/proc.h
===================================================================
RCS file: /cvs/src/sys/sys/proc.h,v
retrieving revision 1.213
diff -u -p -r1.213 proc.h
--- sys/sys/proc.h      6 Dec 2015 17:50:21 -0000       1.213
+++ sys/sys/proc.h      2 Mar 2016 15:56:33 -0000
@@ -205,9 +205,9 @@ struct process {
 
        struct uprof {                  /* profile arguments */
                caddr_t pr_base;        /* buffer base */
-               size_t  pr_size;        /* buffer size */
+               size_t  pr_size;        /* buffer size */
                u_long  pr_off;         /* pc offset */
-               u_int   pr_scale;       /* pc scaling */
+               u_int   pr_scale;       /* pc scaling */
        } ps_prof;
 
        u_short ps_acflag;              /* Accounting flags. */
@@ -215,8 +215,8 @@ struct process {
        uint64_t ps_pledge;
        struct whitepaths *ps_pledgepaths;
 
-       int64_t ps_kbind_cookie;
-       u_long  ps_kbind_addr;
+       int64_t ps_kbind_cookie;
+       u_long  ps_kbind_addr;
 
 /* End area that is copied on creation. */
 #define ps_endcopy     ps_refcnt
@@ -255,7 +255,7 @@ struct process {
 #define        PS_EMBRYO       0x00020000      /* New process, not yet fledged 
*/
 #define        PS_ZOMBIE       0x00040000      /* Dead and ready to be waited 
for */
 #define        PS_NOBROADCASTKILL 0x00080000   /* Process excluded from kill 
-1. */
-#define PS_PLEDGE      0x00100000      /* Has called pledge(2) */
+#define        PS_PLEDGE       0x00100000      /* Has called pledge(2) */
 
 #define        PS_BITS \
     ("\20" "\01CONTROLT" "\02EXEC" "\03INEXEC" "\04EXITING" "\05SUGID" \
@@ -380,12 +380,12 @@ struct proc {
 #define        P_WEXIT         0x00002000      /* Working on exiting. */
 #define        P_OWEUPC        0x00008000      /* Owe proc an addupc() at next 
ast. */
 #define        P_SUSPSINGLE    0x00080000      /* Need to stop for single 
threading. */
-#define P_SYSTRACE     0x00400000      /* Process system call tracing active*/
-#define P_CONTINUED    0x00800000      /* Proc has continued from a stopped 
state. */
+#define        P_SYSTRACE      0x00400000      /* Process system call tracing 
active*/
+#define        P_CONTINUED     0x00800000      /* Proc has continued from a 
stopped state. */
 #define        P_THREAD        0x04000000      /* Only a thread, not a real 
process */
 #define        P_SUSPSIG       0x08000000      /* Stopped from signal. */
 #define        P_SOFTDEP       0x10000000      /* Stuck processing softdep 
worklist */
-#define P_CPUPEG       0x40000000      /* Do not move to another cpu. */
+#define        P_CPUPEG        0x40000000      /* Do not move to another cpu. 
*/
 
 #define        P_BITS \
     ("\20" "\01INKTR" "\02PROFPEND" "\03ALRMPEND" "\04SIGSUSPEND" \
@@ -414,7 +414,7 @@ struct uidinfo *uid_find(uid_t);
 #define        PID_MAX         32766
 #define        NO_PID          (PID_MAX+1)
 
-#define SESS_LEADER(pr)        ((pr)->ps_session->s_leader == (pr))
+#define        SESS_LEADER(pr) ((pr)->ps_session->s_leader == (pr))
 #define        SESSHOLD(s)     ((s)->s_count++)
 #define        SESSRELE(s) do {                                                
\
        if (--(s)->s_count == 0)                                        \
@@ -558,19 +558,8 @@ struct cpuset {
        int cs_set[CPUSET_SSIZE];
 };
 
-void cpuset_init_cpu(struct cpu_info *);
-
-void cpuset_clear(struct cpuset *);
-void cpuset_add(struct cpuset *, struct cpu_info *);
-void cpuset_del(struct cpuset *, struct cpu_info *);
-int cpuset_isset(struct cpuset *, struct cpu_info *);
-void cpuset_add_all(struct cpuset *);
-void cpuset_copy(struct cpuset *, struct cpuset *);
-void cpuset_union(struct cpuset *, struct cpuset *, struct cpuset *);
-void cpuset_intersection(struct cpuset *t, struct cpuset *, struct cpuset *);
-void cpuset_complement(struct cpuset *, struct cpuset *, struct cpuset *);
-struct cpu_info *cpuset_first(struct cpuset *);
+void    cpuset_add(struct cpuset *, struct cpu_info *);
+int     cpuset_isset(struct cpuset *, struct cpu_info *);
 
 #endif /* _KERNEL */
 #endif /* !_SYS_PROC_H_ */
-

-- 
Michal Mazurek

Reply via email to