diff options
author | kib <kib@FreeBSD.org> | 2015-05-29 13:24:17 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-05-29 13:24:17 +0000 |
commit | e2f56205b5cb974ce90bb8e1753845d84f4401cf (patch) | |
tree | c8c8cba4f0c624f3f4b5849c24f18e203d98409e /sys/x86 | |
parent | a1e13e9e590c569e31b8bf4ccd7679b392a2d815 (diff) | |
download | FreeBSD-src-e2f56205b5cb974ce90bb8e1753845d84f4401cf.zip FreeBSD-src-e2f56205b5cb974ce90bb8e1753845d84f4401cf.tar.gz |
Remove several write-only variables, all reported by the gcc 4.9
buildkernel run.
Some of them were write-only under some kernel options, e.g. variables
keeping values only used by CTR() macros. It costs nothing to the
code readability and correctness to eliminate the warnings in those
cases too by removing the local cached values used only for
single-access.
Review: https://reviews.freebsd.org/D2665
Reviewed by: rodrigc
Looked at by: bjk
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Diffstat (limited to 'sys/x86')
-rw-r--r-- | sys/x86/iommu/busdma_dmar.c | 4 | ||||
-rw-r--r-- | sys/x86/iommu/intel_idpgtbl.c | 8 |
2 files changed, 3 insertions, 9 deletions
diff --git a/sys/x86/iommu/busdma_dmar.c b/sys/x86/iommu/busdma_dmar.c index 96b0bce..3ef8107 100644 --- a/sys/x86/iommu/busdma_dmar.c +++ b/sys/x86/iommu/busdma_dmar.c @@ -818,7 +818,6 @@ dmar_bus_task_dmamap(void *arg, int pending) struct bus_dma_tag_dmar *tag; struct bus_dmamap_dmar *map; struct dmar_unit *unit; - struct dmar_ctx *ctx; unit = arg; DMAR_LOCK(unit); @@ -826,7 +825,6 @@ dmar_bus_task_dmamap(void *arg, int pending) TAILQ_REMOVE(&unit->delayed_maps, map, delay_link); DMAR_UNLOCK(unit); tag = map->tag; - ctx = map->tag->ctx; map->cansleep = true; map->locked = false; bus_dmamap_load_mem((bus_dma_tag_t)tag, (bus_dmamap_t)map, @@ -847,9 +845,7 @@ dmar_bus_task_dmamap(void *arg, int pending) static void dmar_bus_schedule_dmamap(struct dmar_unit *unit, struct bus_dmamap_dmar *map) { - struct dmar_ctx *ctx; - ctx = map->tag->ctx; map->locked = false; DMAR_LOCK(unit); TAILQ_INSERT_TAIL(&unit->delayed_maps, map, delay_link); diff --git a/sys/x86/iommu/intel_idpgtbl.c b/sys/x86/iommu/intel_idpgtbl.c index 6621b17..b9492dd 100644 --- a/sys/x86/iommu/intel_idpgtbl.c +++ b/sys/x86/iommu/intel_idpgtbl.c @@ -108,7 +108,7 @@ static void ctx_idmap_nextlvl(struct idpgtbl *tbl, int lvl, vm_pindex_t idx, dmar_gaddr_t addr) { - vm_page_t m, m1; + vm_page_t m1; dmar_pte_t *pte; struct sf_buf *sf; dmar_gaddr_t f, pg_sz; @@ -118,7 +118,7 @@ ctx_idmap_nextlvl(struct idpgtbl *tbl, int lvl, vm_pindex_t idx, VM_OBJECT_ASSERT_LOCKED(tbl->pgtbl_obj); if (addr >= tbl->maxaddr) return; - m = dmar_pgalloc(tbl->pgtbl_obj, idx, DMAR_PGF_OBJL | DMAR_PGF_WAITOK | + (void)dmar_pgalloc(tbl->pgtbl_obj, idx, DMAR_PGF_OBJL | DMAR_PGF_WAITOK | DMAR_PGF_ZERO); base = idx * DMAR_NPTEPG + 1; /* Index of the first child page of idx */ pg_sz = pglvl_page_size(tbl->pglvl, lvl); @@ -598,7 +598,7 @@ ctx_unmap_buf_locked(struct dmar_ctx *ctx, dmar_gaddr_t base, dmar_pte_t *pte; struct sf_buf *sf; vm_pindex_t idx; - dmar_gaddr_t pg_sz, base1, size1; + dmar_gaddr_t pg_sz; int lvl; DMAR_CTX_ASSERT_PGLOCKED(ctx); @@ -625,8 +625,6 @@ ctx_unmap_buf_locked(struct dmar_ctx *ctx, dmar_gaddr_t base, KASSERT((flags & ~DMAR_PGF_WAITOK) == 0, ("invalid flags %x", flags)); pg_sz = 0; /* silence gcc */ - base1 = base; - size1 = size; flags |= DMAR_PGF_OBJL; TD_PREP_PINNED_ASSERT; |