kernel: Remove some unused variables in kern/, opencrypto/ and platform/.
authorSascha Wildner <saw@online.de>
Sat, 5 Jan 2013 12:08:39 +0000 (13:08 +0100)
committerSascha Wildner <saw@online.de>
Sat, 5 Jan 2013 12:09:55 +0000 (13:09 +0100)
sys/kern/dsched/as/as.c
sys/kern/kern_exit.c
sys/kern/link_elf.c
sys/kern/usched_dfly.c
sys/opencrypto/crypto.c
sys/opencrypto/cryptosoft.c
sys/platform/pc64/x86_64/mp_machdep.c

index d388f78..f824663 100644 (file)
@@ -122,11 +122,11 @@ as_cancel(struct dsched_disk_ctx *diskctx)
 static void
 as_timeout(void *p)
 {
-       pid_t last_blockon;
+       //pid_t last_blockon;
        struct as_disk_ctx *as_diskctx = (struct as_disk_ctx *)p;
        DSCHED_DISK_CTX_LOCK(&as_diskctx->head);
        as_diskctx->as_blockall = 0;
-       last_blockon = as_diskctx->as_blockon;
+       //last_blockon = as_diskctx->as_blockon;
        as_diskctx->as_blockon = NO_PID;
        DSCHED_DISK_CTX_UNLOCK(&as_diskctx->head);
        //dsched_debug(0, "dsched: as, timeout %d\n", last_blockon);
index a4d223d..94f62bc 100644 (file)
@@ -273,7 +273,7 @@ exit1(int rv)
        struct thread *td = curthread;
        struct proc *p = td->td_proc;
        struct lwp *lp = td->td_lwp;
-       struct proc *q, *nq;
+       struct proc *q;
        struct vmspace *vm;
        struct vnode *vtmp;
        struct exitlist *ep;
@@ -312,7 +312,6 @@ exit1(int rv)
                         * than the internal signal
                         */
                        sys_kill(&killArgs);
-                       nq = q;
                        q = q->p_peers;
                }
                while (p->p_peers) 
index 1b52d68..efa552c 100644 (file)
@@ -413,10 +413,8 @@ link_elf_load_file(const char* filename, linker_file_t* result)
     Elf_Phdr *segs[2];
     int nsegs;
     Elf_Phdr *phdyn;
-    Elf_Phdr *phphdr;
     caddr_t mapbase;
     size_t mapsize;
-    Elf_Off base_offset;
     Elf_Addr base_vaddr;
     Elf_Addr base_vlimit;
     int error = 0;
@@ -517,7 +515,6 @@ link_elf_load_file(const char* filename, linker_file_t* result)
     phlimit = phdr + hdr->e_phnum;
     nsegs = 0;
     phdyn = NULL;
-    phphdr = NULL;
     while (phdr < phlimit) {
        switch (phdr->p_type) {
 
@@ -532,7 +529,6 @@ link_elf_load_file(const char* filename, linker_file_t* result)
            break;
 
        case PT_PHDR:
-           phphdr = phdr;
            break;
 
        case PT_DYNAMIC:
@@ -556,7 +552,6 @@ link_elf_load_file(const char* filename, linker_file_t* result)
      * Allocate the entire address space of the object, to stake out our
      * contiguous region, and to establish the base address for relocation.
      */
-    base_offset = trunc_page(segs[0]->p_offset);
     base_vaddr = trunc_page(segs[0]->p_vaddr);
     base_vlimit = round_page(segs[1]->p_vaddr + segs[1]->p_memsz);
     mapsize = base_vlimit - base_vaddr;
@@ -714,10 +709,10 @@ out:
 Elf_Addr
 elf_relocaddr(linker_file_t lf, Elf_Addr x)
 {
+#if 0
     elf_file_t ef;
 
     ef = lf->priv;
-#if 0
     if (x >= ef->pcpu_start && x < ef->pcpu_stop)
        return ((x - ef->pcpu_start) + ef->pcpu_base);
 #ifdef VIMAGE
index ed02f87..e8cba63 100644 (file)
@@ -1248,7 +1248,7 @@ dfly_chooseproc_locked(dfly_pcpu_t rdd, dfly_pcpu_t dd,
 {
        struct lwp *lp;
        struct rq *q;
-       u_int32_t *which, *which2;
+       u_int32_t *which;
        u_int32_t pri;
        u_int32_t rtqbits;
        u_int32_t tsqbits;
@@ -1263,17 +1263,14 @@ dfly_chooseproc_locked(dfly_pcpu_t rdd, dfly_pcpu_t dd,
                        pri = bsrl(idqbits);
                        q = &rdd->idqueues[pri];
                        which = &rdd->idqueuebits;
-                       which2 = &idqbits;
                } else if (tsqbits) {
                        pri = bsrl(tsqbits);
                        q = &rdd->queues[pri];
                        which = &rdd->queuebits;
-                       which2 = &tsqbits;
                } else if (rtqbits) {
                        pri = bsrl(rtqbits);
                        q = &rdd->rtqueues[pri];
                        which = &rdd->rtqueuebits;
-                       which2 = &rtqbits;
                } else {
                        return (NULL);
                }
@@ -1283,17 +1280,14 @@ dfly_chooseproc_locked(dfly_pcpu_t rdd, dfly_pcpu_t dd,
                        pri = bsfl(rtqbits);
                        q = &rdd->rtqueues[pri];
                        which = &rdd->rtqueuebits;
-                       which2 = &rtqbits;
                } else if (tsqbits) {
                        pri = bsfl(tsqbits);
                        q = &rdd->queues[pri];
                        which = &rdd->queuebits;
-                       which2 = &tsqbits;
                } else if (idqbits) {
                        pri = bsfl(idqbits);
                        q = &rdd->idqueues[pri];
                        which = &rdd->idqueuebits;
-                       which2 = &idqbits;
                } else {
                        return (NULL);
                }
index f8e3ada..bfaee5a 100644 (file)
@@ -909,7 +909,7 @@ kdriver_suitable(const struct cryptocap *cap, const struct cryptkop *krp)
 static struct cryptocap *
 crypto_select_kdriver(const struct cryptkop *krp, int flags)
 {
-       struct cryptocap *cap, *best, *blocked;
+       struct cryptocap *cap, *best;
        int match, hid;
 
        CRYPTO_DRIVER_ASSERT();
@@ -922,7 +922,6 @@ crypto_select_kdriver(const struct cryptkop *krp, int flags)
        else
                match = CRYPTOCAP_F_SOFTWARE;
        best = NULL;
-       blocked = NULL;
 again:
        for (hid = 0; hid < crypto_drivers_num; hid++) {
                cap = &crypto_drivers[hid];
index 1f90012..02b0467 100644 (file)
@@ -607,11 +607,9 @@ swcr_combined(struct cryptop *crp)
        struct swcr_data *sw, *swa, *swe;
        struct auth_hash *axf = NULL;
        struct enc_xform *exf = NULL;
-       struct mbuf *m = NULL;
-       struct uio *uio = NULL;
        caddr_t buf = (caddr_t)crp->crp_buf;
        uint32_t *blkp;
-       int i, blksz, ivlen, outtype, len;
+       int i, blksz, ivlen, len;
 
        blksz = 0;
        ivlen = 0;
@@ -650,14 +648,6 @@ swcr_combined(struct cryptop *crp)
        if (crde == NULL || crda == NULL)
                return (EINVAL);
 
-       if (crp->crp_flags & CRYPTO_F_IMBUF) {
-               outtype = CRYPTO_BUF_MBUF;
-               m = (struct mbuf *)buf;
-       } else {
-               outtype = CRYPTO_BUF_IOV;
-               uio = (struct uio *)buf;
-       }
-
        /* Initialize the IV */
        if (crde->crd_flags & CRD_F_ENCRYPT) {
                /* IV explicitly provided ? */
@@ -1101,7 +1091,6 @@ swcr_freesession_slot(struct swcr_data **swdp, u_int32_t sid)
 {
        struct enc_xform *txf;
        struct auth_hash *axf;
-       struct comp_algo *cxf;
        struct swcr_data *swd;
        struct swcr_data *swnext;
 
@@ -1193,7 +1182,6 @@ swcr_freesession_slot(struct swcr_data **swdp, u_int32_t sid)
                        break;
 
                case CRYPTO_DEFLATE_COMP:
-                       cxf = swd->sw_cxf;
                        break;
                }
 
index c4ef579..3c65f92 100644 (file)
@@ -344,7 +344,7 @@ start_all_aps(u_int boot_addr)
 {
        vm_offset_t va = boot_address + KERNBASE;
        u_int64_t *pt4, *pt3, *pt2;
-       int     x, i, pg;
+       int     x, i;
        int     shift;
        int     smicount;
        int     smibest;
@@ -423,9 +423,6 @@ start_all_aps(u_int boot_addr)
 
                /* This is a bit verbose, it will go away soon.  */
 
-               /* first page of AP's private space */
-               pg = x * x86_64_btop(sizeof(struct privatespace));
-
                /* allocate new private data page(s) */
                gd = (struct mdglobaldata *)kmem_alloc(&kernel_map, 
                                MDGLOBALDATA_BASEALLOC_SIZE);