Index: head/sys/arm/allwinner/aw_wdog.c =================================================================== --- head/sys/arm/allwinner/aw_wdog.c +++ head/sys/arm/allwinner/aw_wdog.c @@ -115,9 +115,6 @@ static int aw_wdog_probe(device_t dev) { - struct aw_wdog_softc *sc; - - sc = device_get_softc(dev); if (!ofw_bus_status_okay(dev)) return (ENXIO); Index: head/sys/arm/allwinner/axp81x.c =================================================================== --- head/sys/arm/allwinner/axp81x.c +++ head/sys/arm/allwinner/axp81x.c @@ -352,13 +352,11 @@ static void axp81x_intr(void *arg) { - struct axp81x_softc *sc; device_t dev; uint8_t val; int error; dev = arg; - sc = device_get_softc(dev); error = axp81x_read(dev, AXP_IRQSTAT5, &val, 1); if (error != 0) Index: head/sys/arm/allwinner/clk/aw_pll.c =================================================================== --- head/sys/arm/allwinner/clk/aw_pll.c +++ head/sys/arm/allwinner/clk/aw_pll.c @@ -865,7 +865,7 @@ int flags) { struct aw_pll_factor *f; - uint32_t val, n, k, m, p; + uint32_t val, m, p; int i; f = NULL; @@ -884,8 +884,6 @@ DEVICE_LOCK(sc); PLL_READ(sc, &val); - n = (val & A23_PLL1_FACTOR_N) >> A23_PLL1_FACTOR_N_SHIFT; - k = (val & A23_PLL1_FACTOR_K) >> A23_PLL1_FACTOR_K_SHIFT; m = (val & A23_PLL1_FACTOR_M) >> A23_PLL1_FACTOR_M_SHIFT; p = (val & A23_PLL1_FACTOR_P) >> A23_PLL1_FACTOR_P_SHIFT; Index: head/sys/arm/allwinner/if_awg.c =================================================================== --- head/sys/arm/allwinner/if_awg.c +++ head/sys/arm/allwinner/if_awg.c @@ -1266,12 +1266,10 @@ hwreset_t rst_ahb, rst_ephy; clk_t clk_ahb, clk_ephy; regulator_t reg; - phandle_t node; uint64_t freq; int error, div; sc = device_get_softc(dev); - node = ofw_bus_get_node(dev); rst_ahb = rst_ephy = NULL; clk_ahb = clk_ephy = NULL; reg = NULL; @@ -1713,13 +1711,11 @@ { uint8_t eaddr[ETHER_ADDR_LEN]; struct awg_softc *sc; - phandle_t node; int error; sc = device_get_softc(dev); sc->dev = dev; sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; - node = ofw_bus_get_node(dev); if (bus_alloc_resources(dev, awg_spec, sc->res) != 0) { device_printf(dev, "cannot allocate resources for device\n"); Index: head/sys/arm/arm/gic.c =================================================================== --- head/sys/arm/arm/gic.c +++ head/sys/arm/arm/gic.c @@ -1384,11 +1384,9 @@ arm_gicv2m_attach(device_t dev) { struct arm_gicv2m_softc *sc; - struct arm_gic_softc *psc; uint32_t typer; int rid; - psc = device_get_softc(device_get_parent(dev)); sc = device_get_softc(dev); rid = 0; Index: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c =================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c +++ head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c @@ -1386,10 +1386,7 @@ static int bcm2835_cpufreq_detach(device_t dev) { - struct bcm2835_cpufreq_softc *sc; - sc = device_get_softc(dev); - sema_destroy(&vc_sema); return (cpufreq_unregister(dev)); @@ -1400,7 +1397,10 @@ { struct bcm2835_cpufreq_softc *sc; uint32_t rate_hz, rem; - int cur_freq, resp_freq, arm_freq, min_freq, core_freq; + int resp_freq, arm_freq, min_freq, core_freq; +#ifdef DEBUG + int cur_freq; +#endif if (cf == NULL || cf->freq < 0) return (EINVAL); @@ -1425,8 +1425,10 @@ /* set new value and verify it */ VC_LOCK(sc); +#ifdef DEBUG cur_freq = bcm2835_cpufreq_get_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_ARM); +#endif resp_freq = bcm2835_cpufreq_set_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_ARM, rate_hz); DELAY(TRANSITION_LATENCY); Index: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c =================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c @@ -1017,7 +1017,7 @@ u_int *irqp, uint32_t *modep) { u_int irq; - uint32_t mode, bank; + uint32_t mode; /* * The first cell is the interrupt number. @@ -1036,7 +1036,6 @@ return (EINVAL); /* Only reasonable modes are supported. */ - bank = BCM_GPIO_BANK(irq); if (daf->cells[1] == 1) mode = GPIO_INTR_EDGE_RISING; else if (daf->cells[1] == 2) Index: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c =================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c @@ -103,14 +103,18 @@ static int bcm_mbox_read_msg(struct bcm_mbox_softc *sc, int *ochan) { +#ifdef DEBUG uint32_t data; +#endif uint32_t msg; int chan; msg = mbox_read_4(sc, REG_READ); dprintf("bcm_mbox_intr: raw data %08x\n", msg); chan = MBOX_CHAN(msg); +#ifdef DEBUG data = MBOX_DATA(msg); +#endif if (sc->msg[chan]) { printf("bcm_mbox_intr: channel %d oveflow\n", chan); return (1); Index: head/sys/arm64/arm64/gic_v3.c =================================================================== --- head/sys/arm64/arm64/gic_v3.c +++ head/sys/arm64/arm64/gic_v3.c @@ -408,9 +408,7 @@ struct intr_pic *pic; uint64_t active_irq; struct trapframe *tf; - bool first; - first = true; pic = sc->gic_pic; while (1) { Index: head/sys/arm64/arm64/gicv3_its.c =================================================================== --- head/sys/arm64/arm64/gicv3_its.c +++ head/sys/arm64/arm64/gicv3_its.c @@ -1105,12 +1105,10 @@ gicv3_its_release_msi(device_t dev, device_t child, int count, struct intr_irqsrc **isrc) { - struct gicv3_its_softc *sc; struct gicv3_its_irqsrc *girq; struct its_dev *its_dev; int i; - sc = device_get_softc(dev); its_dev = its_device_find(dev, child); KASSERT(its_dev != NULL, @@ -1165,11 +1163,9 @@ static int gicv3_its_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) { - struct gicv3_its_softc *sc; struct gicv3_its_irqsrc *girq; struct its_dev *its_dev; - sc = device_get_softc(dev); its_dev = its_device_find(dev, child); KASSERT(its_dev != NULL, @@ -1405,9 +1401,7 @@ uint64_t target; uint8_t cmd_type; u_int size; - boolean_t error; - error = FALSE; cmd_type = desc->cmd_type; target = ITS_TARGET_NONE; Index: head/sys/arm64/arm64/machdep.c =================================================================== --- head/sys/arm64/arm64/machdep.c +++ head/sys/arm64/arm64/machdep.c @@ -630,14 +630,13 @@ struct sigframe *fp, frame; struct sigacts *psp; struct sysentvec *sysent; - int code, onstack, sig; + int onstack, sig; td = curthread; p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); sig = ksi->ksi_signo; - code = ksi->ksi_code; psp = p->p_sigacts; mtx_assert(&psp->ps_mtx, MA_OWNED); Index: head/sys/arm64/arm64/pmap.c =================================================================== --- head/sys/arm64/arm64/pmap.c +++ head/sys/arm64/arm64/pmap.c @@ -621,7 +621,7 @@ static vm_offset_t pmap_bootstrap_l3(vm_offset_t l1pt, vm_offset_t va, vm_offset_t l3_start) { - vm_offset_t l2pt, l3pt; + vm_offset_t l3pt; vm_paddr_t pa; pd_entry_t *l2; u_int l2_slot; @@ -630,7 +630,6 @@ l2 = pmap_l2(kernel_pmap, va); l2 = (pd_entry_t *)rounddown2((uintptr_t)l2, PAGE_SIZE); - l2pt = (vm_offset_t)l2; l2_slot = pmap_l2_index(va); l3pt = l3_start; Index: head/sys/cam/ata/ata_da.c =================================================================== --- head/sys/cam/ata/ata_da.c +++ head/sys/cam/ata/ata_da.c @@ -2631,10 +2631,8 @@ static void adazonedone(struct cam_periph *periph, union ccb *ccb) { - struct ada_softc *softc; struct bio *bp; - softc = periph->softc; bp = (struct bio *)ccb->ccb_h.ccb_bp; switch (bp->bio_zone.zone_cmd) { @@ -2649,7 +2647,7 @@ struct scsi_report_zones_hdr *hdr; struct scsi_report_zones_desc *desc; struct disk_zone_rep_entry *entry; - uint32_t num_alloced, hdr_len, num_avail; + uint32_t hdr_len, num_avail; uint32_t num_to_fill, i; rep = &bp->bio_zone.zone_params.report; @@ -2664,7 +2662,6 @@ * be different than the amount of data transferred to * the user. */ - num_alloced = rep->entries_allocated; hdr = (struct scsi_report_zones_hdr *)ccb->ataio.data_ptr; if (avail_len < sizeof(*hdr)) { /* Index: head/sys/cam/scsi/scsi_da.c =================================================================== --- head/sys/cam/scsi/scsi_da.c +++ head/sys/cam/scsi/scsi_da.c @@ -1525,7 +1525,6 @@ struct cam_periph *periph; struct da_softc *softc; union ccb *ccb; - int error; periph = (struct cam_periph *)dp->d_drv1; softc = (struct da_softc *)periph->softc; @@ -1544,7 +1543,7 @@ /*cbfcnp*/dadone, MSG_SIMPLE_Q_TAG, /*begin_lba*/0, /*lb_count*/0, SSD_FULL_SIZE, 5 * 60 * 1000); - error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0, + cam_periph_runccb(ccb, daerror, /*cam_flags*/0, /*sense_flags*/SF_RETRY_UA | SF_QUIET_IR, softc->disk->d_devstat); softc->flags &= ~DA_FLAG_DIRTY; @@ -2311,7 +2310,7 @@ char buf[16]; const char *p; struct da_softc *softc; - int i, error, methods, value; + int i, error, value; softc = (struct da_softc *)arg1; @@ -2324,7 +2323,6 @@ error = sysctl_handle_string(oidp, buf, sizeof(buf), req); if (error != 0 || req->newptr == NULL) return (error); - methods = softc->delete_available | (1 << DA_DELETE_DISABLE); for (i = 0; i <= DA_DELETE_MAX; i++) { if (strcmp(buf, da_delete_method_names[i]) == 0) break; @@ -3970,7 +3968,7 @@ struct scsi_report_zones_hdr *hdr; struct scsi_report_zones_desc *desc; struct disk_zone_rep_entry *entry; - uint32_t num_alloced, hdr_len, num_avail; + uint32_t hdr_len, num_avail; uint32_t num_to_fill, i; int ata; @@ -3987,7 +3985,6 @@ * the user. */ bp->bio_resid = ccb->csio.resid; - num_alloced = rep->entries_allocated; hdr = (struct scsi_report_zones_hdr *)ccb->csio.data_ptr; if (avail_len < sizeof(*hdr)) { /* Index: head/sys/cam/scsi/scsi_pass.c =================================================================== --- head/sys/cam/scsi/scsi_pass.c +++ head/sys/cam/scsi/scsi_pass.c @@ -1699,13 +1699,11 @@ passmemdone(struct cam_periph *periph, struct pass_io_req *io_req) { struct pass_softc *softc; - union ccb *ccb; int error; int i; error = 0; softc = (struct pass_softc *)periph->softc; - ccb = &io_req->ccb; switch (io_req->data_flags) { case CAM_DATA_VADDR: Index: head/sys/dev/al_eth/al_eth.c =================================================================== --- head/sys/dev/al_eth/al_eth.c +++ head/sys/dev/al_eth/al_eth.c @@ -272,7 +272,6 @@ static int al_attach(device_t dev) { - struct al_eth_lm_context *lm_context; struct al_eth_adapter *adapter; struct sysctl_oid_list *child; struct sysctl_ctx_list *ctx; @@ -304,8 +303,6 @@ AL_RX_LOCK_INIT(adapter); g_adapters[g_adapters_count] = adapter; - - lm_context = &adapter->lm_context; bar_udma = PCIR_BAR(AL_ETH_UDMA_BAR); adapter->udma_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, Index: head/sys/dev/axgbe/xgbe-drv.c =================================================================== --- head/sys/dev/axgbe/xgbe-drv.c +++ head/sys/dev/axgbe/xgbe-drv.c @@ -954,7 +954,7 @@ struct xgbe_packet_data *packet; struct ifnet *ifp = pdata->netdev; struct mbuf *m; - unsigned int incomplete, context_next, context; + unsigned int incomplete, context_next; unsigned int received = 0; int packet_count = 0; @@ -992,9 +992,6 @@ context_next = XGMAC_GET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, CONTEXT_NEXT); - context = XGMAC_GET_BITS(packet->attributes, - RX_PACKET_ATTRIBUTES, - CONTEXT); /* Earlier error, just drain the remaining data */ if (incomplete || context_next) { Index: head/sys/dev/axgbe/xgbe-mdio.c =================================================================== --- head/sys/dev/axgbe/xgbe-mdio.c +++ head/sys/dev/axgbe/xgbe-mdio.c @@ -752,36 +752,30 @@ static void xgbe_phy_adjust_link(struct xgbe_prv_data *pdata) { - int new_state = 0; if (pdata->phy.link) { /* Flow control support */ pdata->pause_autoneg = pdata->phy.pause_autoneg; if (pdata->tx_pause != pdata->phy.tx_pause) { - new_state = 1; pdata->hw_if.config_tx_flow_control(pdata); pdata->tx_pause = pdata->phy.tx_pause; } if (pdata->rx_pause != pdata->phy.rx_pause) { - new_state = 1; pdata->hw_if.config_rx_flow_control(pdata); pdata->rx_pause = pdata->phy.rx_pause; } /* Speed support */ if (pdata->phy_speed != pdata->phy.speed) { - new_state = 1; pdata->phy_speed = pdata->phy.speed; } if (pdata->phy_link != pdata->phy.link) { - new_state = 1; pdata->phy_link = pdata->phy.link; } } else if (pdata->phy_link) { - new_state = 1; pdata->phy_link = 0; pdata->phy_speed = SPEED_UNKNOWN; } Index: head/sys/dev/e1000/igb_txrx.c =================================================================== --- head/sys/dev/e1000/igb_txrx.c +++ head/sys/dev/e1000/igb_txrx.c @@ -237,7 +237,7 @@ int nsegs = pi->ipi_nsegs; bus_dma_segment_t *segs = pi->ipi_segs; union e1000_adv_tx_desc *txd = NULL; - int i, j, first, pidx_last; + int i, j, pidx_last; u32 olinfo_status, cmd_type_len, txd_flags; qidx_t ntxd; @@ -249,7 +249,7 @@ if (pi->ipi_mflags & M_VLANTAG) cmd_type_len |= E1000_ADVTXD_DCMD_VLE; - first = i = pi->ipi_pidx; + i = pi->ipi_pidx; ntxd = scctx->isc_ntxd[0]; txd_flags = pi->ipi_flags & IPI_TX_INTR ? E1000_ADVTXD_DCMD_RS : 0; /* Consume the first descriptor */ Index: head/sys/dev/extres/clk/clk_bus.c =================================================================== --- head/sys/dev/extres/clk/clk_bus.c +++ head/sys/dev/extres/clk/clk_bus.c @@ -60,11 +60,9 @@ static int ofw_clkbus_attach(device_t dev) { - struct ofw_clkbus_softc *sc; phandle_t node, child; device_t cdev; - sc = device_get_softc(dev); node = ofw_bus_get_node(dev); simplebus_init(dev, node); Index: head/sys/dev/extres/regulator/regulator_bus.c =================================================================== --- head/sys/dev/extres/regulator/regulator_bus.c +++ head/sys/dev/extres/regulator/regulator_bus.c @@ -58,10 +58,8 @@ static int ofw_regulator_bus_attach(device_t dev) { - struct ofw_regulator_bus_softc *sc; phandle_t node, child; - sc = device_get_softc(dev); node = ofw_bus_get_node(dev); simplebus_init(dev, node); Index: head/sys/dev/fdt/fdt_common.c =================================================================== --- head/sys/dev/fdt/fdt_common.c +++ head/sys/dev/fdt/fdt_common.c @@ -155,7 +155,7 @@ pcell_t ranges[FDT_RANGES_SIZE], *rangesptr; pcell_t addr_cells, size_cells, par_addr_cells; u_long par_bus_addr, pbase, psize; - int err, len, tuple_size, tuples; + int err, len; if ((fdt_addrsize_cells(node, &addr_cells, &size_cells)) != 0) return (ENXIO); @@ -181,10 +181,6 @@ if (OF_getprop(node, "ranges", ranges, sizeof(ranges)) <= 0) return (EINVAL); - tuple_size = sizeof(pcell_t) * (addr_cells + par_addr_cells + - size_cells); - tuples = len / tuple_size; - if (par_addr_cells > 2 || addr_cells > 2 || size_cells > 2) return (ERANGE); @@ -600,11 +596,9 @@ pcell_t reserve[FDT_REG_CELLS * FDT_MEM_REGIONS]; pcell_t *reservep; phandle_t memory, root; - uint32_t memory_size; int addr_cells, size_cells; - int i, max_size, res_len, rv, tuple_size, tuples; + int i, res_len, rv, tuple_size, tuples; - max_size = sizeof(reserve); root = OF_finddevice("/"); memory = OF_finddevice("/memory"); if (memory == -1) { @@ -634,7 +628,6 @@ goto out; } - memory_size = 0; tuples = res_len / tuple_size; reservep = (pcell_t *)&reserve; for (i = 0; i < tuples; i++) { @@ -662,9 +655,8 @@ phandle_t memory; uint64_t memory_size; int addr_cells, size_cells; - int i, max_size, reg_len, rv, tuple_size, tuples; + int i, reg_len, rv, tuple_size, tuples; - max_size = sizeof(reg); memory = OF_finddevice("/memory"); if (memory == -1) { rv = ENXIO; Index: head/sys/dev/mii/rdcphy.c =================================================================== --- head/sys/dev/mii/rdcphy.c +++ head/sys/dev/mii/rdcphy.c @@ -185,11 +185,9 @@ rdcphy_status(struct mii_softc *sc) { struct mii_data *mii; - struct ifmedia_entry *ife; int bmsr, bmcr, physts; mii = sc->mii_pdata; - ife = mii->mii_media.ifm_cur; mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; Index: head/sys/dev/mmc/host/dwmmc.c =================================================================== --- head/sys/dev/mmc/host/dwmmc.c +++ head/sys/dev/mmc/host/dwmmc.c @@ -751,12 +751,10 @@ dma_prepare(struct dwmmc_softc *sc, struct mmc_command *cmd) { struct mmc_data *data; - int len; int err; int reg; data = cmd->data; - len = data->len; reg = READ4(sc, SDMMC_INTMASK); reg &= ~(SDMMC_INTMASK_TXDR | SDMMC_INTMASK_RXDR); Index: head/sys/dev/mmc/mmc.c =================================================================== --- head/sys/dev/mmc/mmc.c +++ head/sys/dev/mmc/mmc.c @@ -1559,17 +1559,14 @@ static void mmc_log_card(device_t dev, struct mmc_ivars *ivar, int newcard) { - enum mmc_bus_timing max_timing, timing; + enum mmc_bus_timing timing; device_printf(dev, "Card at relative address 0x%04x%s:\n", ivar->rca, newcard ? " added" : ""); device_printf(dev, " card: %s\n", ivar->card_id_string); - max_timing = bus_timing_normal; for (timing = bus_timing_max; timing > bus_timing_normal; timing--) { - if (isset(&ivar->timings, timing)) { - max_timing = timing; + if (isset(&ivar->timings, timing)) break; - } } device_printf(dev, " quirks: %b\n", ivar->quirks, MMC_QUIRKS_FMT); device_printf(dev, " bus: %ubit, %uMHz (%s timing)\n", Index: head/sys/dev/mmc/mmcsd.c =================================================================== --- head/sys/dev/mmc/mmcsd.c +++ head/sys/dev/mmc/mmcsd.c @@ -755,11 +755,9 @@ static void mmcsd_strategy(struct bio *bp) { - struct mmcsd_softc *sc; struct mmcsd_part *part; part = bp->bio_disk->d_drv1; - sc = part->sc; MMCSD_DISK_LOCK(part); if (part->running > 0 || part->suspend > 0) { bioq_disksort(&part->bio_queue, bp); Index: head/sys/dev/ofw/ofw_bus_subr.c =================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c +++ head/sys/dev/ofw/ofw_bus_subr.c @@ -386,9 +386,8 @@ uint8_t *mptr; pcell_t paddrsz; pcell_t pintrsz; - int i, rsz, tsz; + int i, tsz; - rsz = -1; if (imapmsk != NULL) { for (i = 0; i < physsz; i++) ref[i] = uiregs[i] & uiimapmsk[i]; @@ -445,7 +444,7 @@ { pcell_t *map, mask, msi_base, rid_base, rid_length; ssize_t len; - uint32_t masked_rid, rid; + uint32_t masked_rid; int err, i; /* TODO: This should be OF_searchprop_alloc if we had it */ @@ -462,7 +461,6 @@ } err = ENOENT; - rid = 0; mask = 0xffffffff; OF_getencprop(node, "msi-map-mask", &mask, sizeof(mask)); Index: head/sys/dev/ofw/ofwpci.c =================================================================== --- head/sys/dev/ofw/ofwpci.c +++ head/sys/dev/ofw/ofwpci.c @@ -558,10 +558,7 @@ ofw_pci_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - struct ofw_pci_softc *sc; vm_size_t psize; - - sc = device_get_softc(bus); if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY) { return (bus_generic_deactivate_resource(bus, child, type, rid, Index: head/sys/dev/pci/pci.c =================================================================== --- head/sys/dev/pci/pci.c +++ head/sys/dev/pci/pci.c @@ -3980,7 +3980,6 @@ { #define REG(n, w) PCIB_READ_CONFIG(pcib, busno, s, f, n, w) device_t pcib = device_get_parent(dev); - struct pci_softc *sc; device_t child, *devlist, *unchanged; int devcount, error, i, j, maxslots, oldcount; int busno, domain, s, f, pcifunchigh; @@ -4000,7 +3999,6 @@ } else unchanged = NULL; - sc = device_get_softc(dev); domain = pcib_get_domain(dev); busno = pcib_get_bus(dev); maxslots = PCIB_MAXSLOTS(pcib); @@ -4077,11 +4075,9 @@ pci_add_iov_child(device_t bus, device_t pf, uint16_t rid, uint16_t vid, uint16_t did) { - struct pci_devinfo *pf_dinfo, *vf_dinfo; + struct pci_devinfo *vf_dinfo; device_t pcib; int busno, slot, func; - - pf_dinfo = device_get_ivars(pf); pcib = device_get_parent(bus); Index: head/sys/dev/pci/pci_pci.c =================================================================== --- head/sys/dev/pci/pci_pci.c +++ head/sys/dev/pci/pci_pci.c @@ -1241,10 +1241,8 @@ pcib_pcie_ab_timeout(void *arg) { struct pcib_softc *sc; - device_t dev; sc = arg; - dev = sc->dev; mtx_assert(&Giant, MA_OWNED); if (sc->flags & PCIB_DETACH_PENDING) { sc->flags |= PCIB_DETACHING; @@ -1484,16 +1482,14 @@ static void pcib_cfg_restore(struct pcib_softc *sc) { - device_t dev; #ifndef NEW_PCIB uint16_t command; #endif - dev = sc->dev; #ifdef NEW_PCIB pcib_write_windows(sc, WIN_IO | WIN_MEM | WIN_PMEM); #else - command = pci_read_config(dev, PCIR_COMMAND, 2); + command = pci_read_config(sc->dev, PCIR_COMMAND, 2); if (command & PCIM_CMD_PORTEN) pcib_set_io_decode(sc); if (command & PCIM_CMD_MEMEN) Index: head/sys/dev/smc/if_smc_fdt.c =================================================================== --- head/sys/dev/smc/if_smc_fdt.c +++ head/sys/dev/smc/if_smc_fdt.c @@ -84,17 +84,8 @@ static int smc_fdt_attach(device_t dev) { - int err; - struct smc_softc *sc; - sc = device_get_softc(dev); - - err = smc_attach(dev); - if (err) { - return (err); - } - - return (0); + return smc_attach(dev); } static int Index: head/sys/dev/uart/uart_bus_acpi.c =================================================================== --- head/sys/dev/uart/uart_bus_acpi.c +++ head/sys/dev/uart/uart_bus_acpi.c @@ -104,13 +104,11 @@ uart_acpi_probe(device_t dev) { struct uart_softc *sc; - device_t parent; - parent = device_get_parent(dev); sc = device_get_softc(dev); #if defined(__i386__) || defined(__amd64__) - if (!ISA_PNP_PROBE(parent, dev, acpi_ns8250_ids)) { + if (!ISA_PNP_PROBE(device_get_parent(dev), dev, acpi_ns8250_ids)) { sc->sc_class = &uart_ns8250_class; return (uart_bus_probe(dev, 0, 0, 0, 0, 0)); } Index: head/sys/dev/uart/uart_dev_pl011.c =================================================================== --- head/sys/dev/uart/uart_dev_pl011.c +++ head/sys/dev/uart/uart_dev_pl011.c @@ -381,10 +381,8 @@ static int uart_pl011_bus_ioctl(struct uart_softc *sc, int request, intptr_t data) { - struct uart_bas *bas; int error; - bas = &sc->sc_bas; error = 0; uart_lock(sc->sc_hwmtx); switch (request) { Index: head/sys/dev/uart/uart_dev_snps.c =================================================================== --- head/sys/dev/uart/uart_dev_snps.c +++ head/sys/dev/uart/uart_dev_snps.c @@ -110,9 +110,7 @@ static int snps_get_clocks(device_t dev, clk_t *baudclk, clk_t *apb_pclk) { - struct snps_softc *sc; - sc = device_get_softc(dev); *baudclk = NULL; *apb_pclk = NULL; Index: head/sys/dev/usb/controller/dwc_otg_fdt.c =================================================================== --- head/sys/dev/usb/controller/dwc_otg_fdt.c +++ head/sys/dev/usb/controller/dwc_otg_fdt.c @@ -170,7 +170,6 @@ dwc_otg_detach(device_t dev) { struct dwc_otg_fdt_softc *sc = device_get_softc(dev); - int err; /* during module unload there are lots of children leftover */ device_delete_children(dev); @@ -181,7 +180,7 @@ */ dwc_otg_uninit(&sc->sc_otg); - err = bus_teardown_intr(dev, sc->sc_otg.sc_irq_res, + bus_teardown_intr(dev, sc->sc_otg.sc_irq_res, sc->sc_otg.sc_intr_hdl); sc->sc_otg.sc_intr_hdl = NULL; } Index: head/sys/dev/usb/controller/ehci.c =================================================================== --- head/sys/dev/usb/controller/ehci.c +++ head/sys/dev/usb/controller/ehci.c @@ -1194,9 +1194,7 @@ static void ehci_non_isoc_done(struct usb_xfer *xfer) { - ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); ehci_qh_t *qh; - uint32_t status; usb_error_t err = 0; DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", @@ -1215,8 +1213,6 @@ qh = xfer->qh_start[xfer->flags_int.curr_dma_set]; usb_pc_cpu_invalidate(qh->page_cache); - - status = hc32toh(sc, qh->qh_qtd.qtd_status); /* reset scanner */ Index: head/sys/dev/usb/controller/ohci.c =================================================================== --- head/sys/dev/usb/controller/ohci.c +++ head/sys/dev/usb/controller/ohci.c @@ -2385,7 +2385,6 @@ { struct usb_page_search page_info; struct usb_page_cache *pc; - ohci_softc_t *sc; struct usb_xfer *xfer; void *last_obj; uint32_t ntd; @@ -2393,7 +2392,6 @@ uint32_t nqh; uint32_t n; - sc = OHCI_BUS2SC(parm->udev->bus); xfer = parm->curr_xfer; parm->hc_max_packet_size = 0x500; Index: head/sys/dev/usb/controller/xhci.c =================================================================== --- head/sys/dev/usb/controller/xhci.c +++ head/sys/dev/usb/controller/xhci.c @@ -3714,13 +3714,11 @@ { struct usb_page_search page_info; struct usb_page_cache *pc; - struct xhci_softc *sc; struct usb_xfer *xfer; void *last_obj; uint32_t ntd; uint32_t n; - sc = XHCI_BUS2SC(parm->udev->bus); xfer = parm->curr_xfer; /* Index: head/sys/dev/usb/storage/umass.c =================================================================== --- head/sys/dev/usb/storage/umass.c +++ head/sys/dev/usb/storage/umass.c @@ -1089,7 +1089,6 @@ umass_init_shuttle(struct umass_softc *sc) { struct usb_device_request req; - usb_error_t err; uint8_t status[2] = {0, 0}; /* @@ -1102,7 +1101,7 @@ req.wIndex[0] = sc->sc_iface_no; req.wIndex[1] = 0; USETW(req.wLength, sizeof(status)); - err = usbd_do_request(sc->sc_udev, NULL, &req, &status); + usbd_do_request(sc->sc_udev, NULL, &req, &status); DPRINTF(sc, UDMASS_GEN, "Shuttle init returned 0x%02x%02x\n", status[0], status[1]); Index: head/sys/dev/usb/usb_dev.c =================================================================== --- head/sys/dev/usb/usb_dev.c +++ head/sys/dev/usb/usb_dev.c @@ -878,7 +878,7 @@ struct usb_fs_privdata* pd = (struct usb_fs_privdata*)dev->si_drv1; struct usb_cdev_refdata refs; struct usb_cdev_privdata *cpd; - int err, ep; + int err; DPRINTFN(2, "%s fflags=0x%08x\n", devtoname(dev), fflags); @@ -890,7 +890,6 @@ } cpd = malloc(sizeof(*cpd), M_USBDEV, M_WAITOK | M_ZERO); - ep = cpd->ep_addr = pd->ep_addr; usb_loc_fill(pd, cpd); err = usb_ref_device(cpd, &refs, 1); @@ -1412,8 +1411,6 @@ struct usb_cdev_privdata* cpd; struct usb_fifo *f; struct usb_mbuf *m; - int fflags; - int resid; int io_len; int err; uint8_t tr_data = 0; @@ -1426,8 +1423,6 @@ if (err) return (ENXIO); - fflags = cpd->fflags; - f = refs.rxfifo; if (f == NULL) { /* should not happen */ @@ -1435,8 +1430,6 @@ return (EPERM); } - resid = uio->uio_resid; - mtx_lock(f->priv_mtx); /* check for permanent read error */ @@ -1536,8 +1529,6 @@ struct usb_fifo *f; struct usb_mbuf *m; uint8_t *pdata; - int fflags; - int resid; int io_len; int err; uint8_t tr_data = 0; @@ -1552,15 +1543,12 @@ if (err) return (ENXIO); - fflags = cpd->fflags; - f = refs.txfifo; if (f == NULL) { /* should not happen */ usb_unref_device(cpd, &refs); return (EPERM); } - resid = uio->uio_resid; mtx_lock(f->priv_mtx); Index: head/sys/dev/vnic/nic_main.c =================================================================== --- head/sys/dev/vnic/nic_main.c +++ head/sys/dev/vnic/nic_main.c @@ -761,9 +761,6 @@ nic_send_rss_size(struct nicpf *nic, int vf) { union nic_mbx mbx = {}; - uint64_t *msg; - - msg = (uint64_t *)&mbx; mbx.rss_size.msg = NIC_MBOX_MSG_RSS_SIZE; mbx.rss_size.ind_tbl_size = nic->rss_ind_tbl_size; Index: head/sys/dev/vnic/nicvf_main.c =================================================================== --- head/sys/dev/vnic/nicvf_main.c +++ head/sys/dev/vnic/nicvf_main.c @@ -425,7 +425,6 @@ struct nicvf *nic; struct rcv_queue *rq; struct ifreq *ifr; - uint32_t flags; int mask, err; int rq_idx; #if defined(INET) || defined(INET6) @@ -482,7 +481,6 @@ NICVF_CORE_LOCK(nic); if (if_getflags(ifp) & IFF_UP) { if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { - flags = if_getflags(ifp) ^ nic->if_flags; if ((nic->if_flags & if_getflags(ifp)) & IFF_PROMISC) { /* Change promiscous mode */ Index: head/sys/dev/vnic/nicvf_queues.c =================================================================== --- head/sys/dev/vnic/nicvf_queues.c +++ head/sys/dev/vnic/nicvf_queues.c @@ -1714,13 +1714,12 @@ static void nicvf_sq_free_used_descs(struct nicvf *nic, struct snd_queue *sq, int qidx) { - uint64_t head, tail; + uint64_t head; struct snd_buff *snd_buff; struct sq_hdr_subdesc *hdr; NICVF_TX_LOCK(sq); head = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_HEAD, qidx) >> 4; - tail = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_TAIL, qidx) >> 4; while (sq->head != head) { hdr = (struct sq_hdr_subdesc *)GET_SQ_DESC(sq, sq->head); if (hdr->subdesc_type != SQ_DESC_TYPE_HEADER) { Index: head/sys/fs/cd9660/cd9660_vfsops.c =================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c +++ head/sys/fs/cd9660/cd9660_vfsops.c @@ -680,7 +680,6 @@ struct iso_node *ip; struct buf *bp; struct vnode *vp; - struct cdev *dev; int error; struct thread *td; @@ -707,7 +706,6 @@ */ imp = VFSTOISOFS(mp); - dev = imp->im_dev; /* Allocate a new vnode/iso_node. */ if ((error = getnewvnode("isofs", mp, &cd9660_vnodeops, &vp)) != 0) { Index: head/sys/fs/nfs/nfs_commonkrpc.c =================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c +++ head/sys/fs/nfs/nfs_commonkrpc.c @@ -493,7 +493,7 @@ uint32_t retseq, retval, slotseq, *tl; time_t waituntil; int i = 0, j = 0, opcnt, set_sigset = 0, slot; - int trycnt, error = 0, usegssname = 0, secflavour = AUTH_SYS; + int error = 0, usegssname = 0, secflavour = AUTH_SYS; int freeslot, maxslot, reterr, slotpos, timeo; u_int16_t procnum; u_int trylater_delay = 1; @@ -702,7 +702,6 @@ } #endif } - trycnt = 0; freeslot = -1; /* Set to slot that needs to be free'd */ tryagain: slot = -1; /* Slot that needs a sequence# increment. */ @@ -1229,8 +1228,7 @@ { sigset_t oldset; int error; - struct proc *p; - + if ((priority & PCATCH) == 0) return msleep(ident, mtx, priority, wmesg, timo); if (td == NULL) @@ -1238,7 +1236,6 @@ newnfs_set_sigmask(td, &oldset); error = msleep(ident, mtx, priority, wmesg, timo); newnfs_restore_sigmask(td, &oldset); - p = td->td_proc; return (error); } Index: head/sys/fs/nfs/nfs_commonsubs.c =================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c +++ head/sys/fs/nfs/nfs_commonsubs.c @@ -487,7 +487,7 @@ { u_int32_t *tl; u_int8_t *cp; - int fullsiz, rem, bytesize = 0; + int fullsiz, bytesize = 0; if (size == 0) size = NFSX_MYFH; @@ -504,7 +504,6 @@ case ND_NFSV3: case ND_NFSV4: fullsiz = NFSM_RNDUP(size); - rem = fullsiz - size; if (set_true) { bytesize = 2 * NFSX_UNSIGNED + fullsiz; NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); Index: head/sys/fs/nfsclient/nfs_clstate.c =================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c +++ head/sys/fs/nfsclient/nfs_clstate.c @@ -4116,7 +4116,6 @@ struct nfscllockowner *nlp; struct nfsfh *nfhp; u_int64_t off, len; - u_int32_t clidrev = 0; int error, newone, donelocally; off = lop->nfslo_first; @@ -4126,10 +4125,6 @@ lp->nfsl_openowner, &nlp, &newone, &donelocally); if (error || donelocally) return (error); - if (nmp->nm_clp != NULL) - clidrev = nmp->nm_clp->nfsc_clientidrev; - else - clidrev = 0; nfhp = VTONFS(vp)->n_fhp; error = nfscl_trylock(nmp, vp, nfhp->nfh_fh, nfhp->nfh_len, nlp, newone, 0, off, Index: head/sys/fs/nfsserver/nfs_nfsdport.c =================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c +++ head/sys/fs/nfsserver/nfs_nfsdport.c @@ -347,7 +347,7 @@ struct iovec aiov; struct uio auio; int lockleaf = (cnp->cn_flags & LOCKLEAF) != 0, linklen; - int error = 0, crossmnt; + int error = 0; char *cp; *retdirp = NULL; @@ -372,7 +372,6 @@ if (NFSVNO_EXRDONLY(exp)) cnp->cn_flags |= RDONLY; ndp->ni_segflg = UIO_SYSSPACE; - crossmnt = 1; if (nd->nd_flag & ND_PUBLOOKUP) { ndp->ni_loopcnt = 0; @@ -400,7 +399,6 @@ * the mount point, unless nfsrv_enable_crossmntpt is set. */ cnp->cn_flags |= NOCROSSMOUNT; - crossmnt = 0; } /* Index: head/sys/fs/nfsserver/nfs_nfsdstate.c =================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c +++ head/sys/fs/nfsserver/nfs_nfsdstate.c @@ -3267,7 +3267,7 @@ nfsrv_openupdate(vnode_t vp, struct nfsstate *new_stp, nfsquad_t clientid, nfsv4stateid_t *stateidp, struct nfsrv_descript *nd, NFSPROC_T *p) { - struct nfsstate *stp, *ownerstp; + struct nfsstate *stp; struct nfsclient *clp; struct nfslockfile *lfp; u_int32_t bits; @@ -3366,7 +3366,6 @@ } NFSUNLOCKSTATE(); } else if (new_stp->ls_flags & NFSLCK_CLOSE) { - ownerstp = stp->ls_openowner; lfp = stp->ls_lfp; if (nfsrv_dolocallocks != 0 && !LIST_EMPTY(&stp->ls_open)) { /* Get the lf lock */ Index: head/sys/geom/geom_subr.c =================================================================== --- head/sys/geom/geom_subr.c +++ head/sys/geom/geom_subr.c @@ -876,7 +876,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int dce) { struct g_provider *pp; - int pr,pw,pe; + int pw, pe; int error; g_topology_assert(); @@ -907,7 +907,6 @@ * Figure out what counts the provider would have had, if this * consumer had (r0w0e0) at this time. */ - pr = pp->acr - cp->acr; pw = pp->acw - cp->acw; pe = pp->ace - cp->ace; Index: head/sys/geom/raid/g_raid.c =================================================================== --- head/sys/geom/raid/g_raid.c +++ head/sys/geom/raid/g_raid.c @@ -955,7 +955,6 @@ void g_raid_tr_flush_common(struct g_raid_tr_object *tr, struct bio *bp) { - struct g_raid_softc *sc; struct g_raid_volume *vol; struct g_raid_subdisk *sd; struct bio_queue_head queue; @@ -963,7 +962,6 @@ int i; vol = tr->tro_volume; - sc = vol->v_softc; /* * Allocate all bios before sending any request, so we can return Index: head/sys/geom/raid/md_ddf.c =================================================================== --- head/sys/geom/raid/md_ddf.c +++ head/sys/geom/raid/md_ddf.c @@ -757,10 +757,8 @@ static void ddf_meta_copy(struct ddf_meta *dst, struct ddf_meta *src) { - struct ddf_header *hdr; u_int ss; - hdr = src->hdr; dst->bigendian = src->bigendian; ss = dst->sectorsize = src->sectorsize; dst->hdr = malloc(ss, M_MD_DDF, M_WAITOK); @@ -845,10 +843,8 @@ { struct timespec ts; struct clocktime ct; - struct ddf_header *hdr; u_int ss, size; - hdr = sample->hdr; meta->bigendian = sample->bigendian; ss = meta->sectorsize = sample->sectorsize; meta->hdr = malloc(ss, M_MD_DDF, M_WAITOK); @@ -874,13 +870,11 @@ ddf_vol_meta_update(struct ddf_vol_meta *dst, struct ddf_meta *src, uint8_t *GUID, int started) { - struct ddf_header *hdr; struct ddf_vd_entry *vde; struct ddf_vdc_record *vdc; int vnew, bvnew, bvd, size; u_int ss; - hdr = src->hdr; vde = &src->vdr->entry[ddf_meta_find_vd(src, GUID)]; vdc = ddf_meta_find_vdc(src, GUID); if (GET8D(src, vdc->Secondary_Element_Count) == 1) @@ -1427,12 +1421,10 @@ g_raid_md_ddf_purge_volumes(struct g_raid_softc *sc) { struct g_raid_volume *vol, *tvol; - struct g_raid_md_ddf_pervolume *pv; int i, res; res = 0; TAILQ_FOREACH_SAFE(vol, &sc->sc_volumes, v_next, tvol) { - pv = vol->v_md_data; if (vol->v_stopping) continue; for (i = 0; i < vol->v_disks_count; i++) { @@ -1866,7 +1858,6 @@ struct g_raid_md_ddf_pervolume *pv; struct g_raid_md_ddf_object *mdi; struct ddf_vol_meta *vmeta; - struct ddf_vdc_record *vdc; uint64_t *val2; int i, j, bvd; @@ -1875,7 +1866,6 @@ mdi = (struct g_raid_md_ddf_object *)md; pv = vol->v_md_data; vmeta = &pv->pv_meta; - vdc = vmeta->vdc; vol->v_raid_level = GET8(vmeta, vdc->Primary_RAID_Level); vol->v_raid_level_qualifier = GET8(vmeta, vdc->RLQ); Index: head/sys/geom/raid/md_promise.c =================================================================== --- head/sys/geom/raid/md_promise.c +++ head/sys/geom/raid/md_promise.c @@ -1100,7 +1100,7 @@ struct g_provider *pp; struct g_raid_softc *sc; struct g_raid_disk *disk; - struct promise_raid_conf *meta, *metaarr[4]; + struct promise_raid_conf *metaarr[4]; struct g_raid_md_promise_perdisk *pd; struct g_geom *geom; int i, j, result, len, subdisks; @@ -1111,7 +1111,6 @@ pp = cp->provider; /* Read metadata from device. */ - meta = NULL; g_topology_unlock(); vendor = 0xffff; len = sizeof(vendor); Index: head/sys/geom/raid/tr_raid5.c =================================================================== --- head/sys/geom/raid/tr_raid5.c +++ head/sys/geom/raid/tr_raid5.c @@ -344,10 +344,8 @@ g_raid_tr_iostart_raid5(struct g_raid_tr_object *tr, struct bio *bp) { struct g_raid_volume *vol; - struct g_raid_tr_raid5_object *trs; vol = tr->tro_volume; - trs = (struct g_raid_tr_raid5_object *)tr; if (vol->v_state < G_RAID_VOLUME_S_SUBOPTIMAL) { g_raid_iodone(bp, EIO); return; Index: head/sys/kern/kern_synch.c =================================================================== --- head/sys/kern/kern_synch.c +++ head/sys/kern/kern_synch.c @@ -131,14 +131,12 @@ const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags) { struct thread *td; - struct proc *p; struct lock_class *class; uintptr_t lock_state; int catch, pri, rval, sleepq_flags; WITNESS_SAVE_DECL(lock_witness); td = curthread; - p = td->td_proc; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) ktrcsw(1, 0, wmesg); @@ -177,7 +175,7 @@ sleepq_lock(ident); CTR5(KTR_PROC, "sleep: thread %ld (pid %ld, %s) on %s (%p)", - td->td_tid, p->p_pid, td->td_name, wmesg, ident); + td->td_tid, td->td_proc->p_pid, td->td_name, wmesg, ident); if (lock == &Giant.lock_object) mtx_assert(&Giant, MA_OWNED); @@ -235,12 +233,10 @@ sbintime_t sbt, sbintime_t pr, int flags) { struct thread *td; - struct proc *p; int rval; WITNESS_SAVE_DECL(mtx); td = curthread; - p = td->td_proc; KASSERT(mtx != NULL, ("sleeping without a mutex")); KASSERT(ident != NULL, ("msleep_spin_sbt: NULL ident")); KASSERT(TD_IS_RUNNING(td), ("msleep_spin_sbt: curthread not running")); @@ -250,7 +246,7 @@ sleepq_lock(ident); CTR5(KTR_PROC, "msleep_spin: thread %ld (pid %ld, %s) on %s (%p)", - td->td_tid, p->p_pid, td->td_name, wmesg, ident); + td->td_tid, td->td_proc->p_pid, td->td_name, wmesg, ident); DROP_GIANT(); mtx_assert(mtx, MA_OWNED | MA_NOTRECURSED); Index: head/sys/kern/link_elf.c =================================================================== --- head/sys/kern/link_elf.c +++ head/sys/kern/link_elf.c @@ -767,10 +767,8 @@ Elf_Phdr *segs[MAXSEGS]; 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; @@ -869,7 +867,6 @@ phlimit = phdr + hdr->e_phnum; nsegs = 0; phdyn = NULL; - phphdr = NULL; while (phdr < phlimit) { switch (phdr->p_type) { case PT_LOAD: @@ -885,10 +882,6 @@ ++nsegs; break; - case PT_PHDR: - phphdr = phdr; - break; - case PT_DYNAMIC: phdyn = phdr; break; @@ -916,7 +909,6 @@ * 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[nsegs - 1]->p_vaddr + segs[nsegs - 1]->p_memsz); Index: head/sys/kern/subr_msgbuf.c =================================================================== --- head/sys/kern/subr_msgbuf.c +++ head/sys/kern/subr_msgbuf.c @@ -187,11 +187,10 @@ size_t len, prefix_len; char prefix[MAXPRIBUF]; char buf[32]; - int nl, i, j, needtime; + int i, j, needtime; len = strlen(str); prefix_len = 0; - nl = 0; /* If we have a zero-length string, no need to do anything. */ if (len == 0) Index: head/sys/kern/subr_sleepqueue.c =================================================================== --- head/sys/kern/subr_sleepqueue.c +++ head/sys/kern/subr_sleepqueue.c @@ -1141,11 +1141,10 @@ struct stack **st; struct sbuf **td_infos; int i, stack_idx, error, stacks_to_allocate; - bool finished, partial_print; + bool finished; error = 0; finished = false; - partial_print = false; KASSERT(wchan != NULL, ("%s: invalid NULL wait channel", __func__)); MPASS((queue >= 0) && (queue < NR_SLEEPQS)); Index: head/sys/kern/subr_witness.c =================================================================== --- head/sys/kern/subr_witness.c +++ head/sys/kern/subr_witness.c @@ -1806,7 +1806,6 @@ enroll(const char *description, struct lock_class *lock_class) { struct witness *w; - struct witness_list *typelist; MPASS(description != NULL); @@ -1815,11 +1814,7 @@ if ((lock_class->lc_flags & LC_SPINLOCK)) { if (witness_skipspin) return (NULL); - else - typelist = &w_spin; - } else if ((lock_class->lc_flags & LC_SLEEPLOCK)) { - typelist = &w_sleep; - } else { + } else if ((lock_class->lc_flags & LC_SLEEPLOCK) == 0) { kassert_panic("lock class %s is not sleep or spin", lock_class->lc_name); return (NULL); @@ -1865,14 +1860,11 @@ static void depart(struct witness *w) { - struct witness_list *list; MPASS(w->w_refcount == 0); if (w->w_class->lc_flags & LC_SLEEPLOCK) { - list = &w_sleep; w_sleep_cnt--; } else { - list = &w_spin; w_spin_cnt--; } /* @@ -2546,7 +2538,6 @@ { struct witness_lock_order_data *data1, *data2, *tmp_data1, *tmp_data2; struct witness *tmp_w1, *tmp_w2, *w1, *w2; - u_int w_rmatrix1, w_rmatrix2; int generation, i, j; tmp_data1 = NULL; @@ -2616,8 +2607,6 @@ * spin lock. */ *tmp_w2 = *w2; - w_rmatrix1 = (unsigned int)w_rmatrix[i][j]; - w_rmatrix2 = (unsigned int)w_rmatrix[j][i]; if (data1) { stack_zero(&tmp_data1->wlod_stack); Index: head/sys/kern/vfs_aio.c =================================================================== --- head/sys/kern/vfs_aio.c +++ head/sys/kern/vfs_aio.c @@ -963,7 +963,6 @@ bool aio_cancel_cleared(struct kaiocb *job) { - struct kaioinfo *ki; /* * The caller should hold the same queue lock held when @@ -971,7 +970,6 @@ * ensuring this check sees an up-to-date value. However, * there is no way to assert that. */ - ki = job->userproc->p_aioinfo; return ((job->jobflags & KAIOCB_CLEARED) != 0); } @@ -1692,7 +1690,6 @@ int aio_queue_file(struct file *fp, struct kaiocb *job) { - struct aioliojob *lj; struct kaioinfo *ki; struct kaiocb *job2; struct vnode *vp; @@ -1700,7 +1697,6 @@ int error, opcode; bool safe; - lj = job->lio; ki = job->userproc->p_aioinfo; opcode = job->uaiocb.aio_lio_opcode; if (opcode == LIO_SYNC) Index: head/sys/kern/vfs_subr.c =================================================================== --- head/sys/kern/vfs_subr.c +++ head/sys/kern/vfs_subr.c @@ -1133,7 +1133,7 @@ vnlru_proc(void) { struct mount *mp, *nmp; - unsigned long ofreevnodes, onumvnodes; + unsigned long onumvnodes; int done, force, reclaim_nc_src, trigger, usevnodes; EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, vnlruproc, @@ -1170,7 +1170,6 @@ } mtx_unlock(&vnode_free_list_mtx); done = 0; - ofreevnodes = freevnodes; onumvnodes = numvnodes; /* * Calculate parameters for recycling. These are the same Index: head/sys/net/if_ethersubr.c =================================================================== --- head/sys/net/if_ethersubr.c +++ head/sys/net/if_ethersubr.c @@ -290,7 +290,6 @@ int hlen; /* link layer header length */ uint32_t pflags; struct llentry *lle = NULL; - struct rtentry *rt0 = NULL; int addref = 0; phdr = NULL; @@ -320,7 +319,6 @@ pflags = lle->r_flags; } } - rt0 = ro->ro_rt; } #ifdef MAC Index: head/sys/net/if_gif.c =================================================================== --- head/sys/net/if_gif.c +++ head/sys/net/if_gif.c @@ -520,7 +520,6 @@ struct ip6_hdr *ip6; uint32_t t; #endif - struct gif_softc *sc; struct ether_header *eh; struct ifnet *oldifp; int isr, n, af; @@ -530,7 +529,6 @@ m_freem(m); return; } - sc = ifp->if_softc; m->m_pkthdr.rcvif = ifp; m_clrprotoflags(m); switch (proto) { Index: head/sys/netinet/tcp_output.c =================================================================== --- head/sys/netinet/tcp_output.c +++ head/sys/netinet/tcp_output.c @@ -198,7 +198,9 @@ int off, flags, error = 0; /* Keep compiler happy */ struct mbuf *m; struct ip *ip = NULL; +#ifdef TCPDEBUG struct ipovly *ipov = NULL; +#endif struct tcphdr *th; u_char opt[TCP_MAXOLEN]; unsigned ipoptlen, optlen, hdrlen; @@ -1091,7 +1093,9 @@ #endif /* INET6 */ { ip = mtod(m, struct ip *); +#ifdef TCPDEBUG ipov = (struct ipovly *)ip; +#endif th = (struct tcphdr *)(ip + 1); tcpip_fillheaders(tp->t_inpcb, ip, th); } Index: head/sys/netinet6/in6_mcast.c =================================================================== --- head/sys/netinet6/in6_mcast.c +++ head/sys/netinet6/in6_mcast.c @@ -1238,10 +1238,7 @@ int in6_mc_leave(struct in6_multi *inm, /*const*/ struct in6_mfilter *imf) { - struct ifnet *ifp; int error; - - ifp = inm->in6m_ifp; IN6_MULTI_LOCK(); error = in6_mc_leave_locked(inm, imf); Index: head/sys/netinet6/in6_src.c =================================================================== --- head/sys/netinet6/in6_src.c +++ head/sys/netinet6/in6_src.c @@ -160,7 +160,6 @@ */ #define REPLACE(r) do {\ IP6STAT_INC(ip6s_sources_rule[(r)]); \ - rule = (r); \ /* { \ char ip6buf[INET6_ADDRSTRLEN], ip6b[INET6_ADDRSTRLEN]; \ printf("in6_selectsrc: replace %s with %s by %d\n", ia_best ? ip6_sprintf(ip6buf, &ia_best->ia_addr.sin6_addr) : "none", ip6_sprintf(ip6b, &ia->ia_addr.sin6_addr), (r)); \ @@ -176,7 +175,6 @@ } while(0) #define BREAK(r) do { \ IP6STAT_INC(ip6s_sources_rule[(r)]); \ - rule = (r); \ goto out; /* XXX: we can't use 'break' here */ \ } while(0) @@ -194,7 +192,7 @@ struct in6_addrpolicy *dst_policy = NULL, *best_policy = NULL; u_int32_t odstzone; int prefer_tempaddr; - int error, rule; + int error; struct ip6_moptions *mopts; KASSERT(srcp != NULL, ("%s: srcp is NULL", __func__)); @@ -310,7 +308,6 @@ if (error) return (error); - rule = 0; IN6_IFADDR_RLOCK(&in6_ifa_tracker); TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { int new_scope = -1, new_matchlen = -1; Index: head/sys/netinet6/mld6.c =================================================================== --- head/sys/netinet6/mld6.c +++ head/sys/netinet6/mld6.c @@ -2286,7 +2286,7 @@ struct ifnet *ifp; struct ip6_msource *ims, *nims; struct mbuf *m0, *m, *md; - int error, is_filter_list_change; + int is_filter_list_change; int minrec0len, m0srcs, msrcs, nbytes, off; int record_has_sources; int now; @@ -2298,7 +2298,6 @@ IN6_MULTI_LOCK_ASSERT(); - error = 0; ifp = inm->in6m_ifp; is_filter_list_change = 0; m = NULL; Index: head/sys/netinet6/nd6.h =================================================================== --- head/sys/netinet6/nd6.h +++ head/sys/netinet6/nd6.h @@ -448,7 +448,7 @@ char *, int, int, int); void nd6_grab_holdchain(struct llentry *, struct mbuf **, struct sockaddr_in6 *); -int nd6_flush_holdchain(struct ifnet *, struct ifnet *, struct mbuf *, +int nd6_flush_holdchain(struct ifnet *, struct mbuf *, struct sockaddr_in6 *); int nd6_add_ifa_lle(struct in6_ifaddr *); void nd6_rem_ifa_lle(struct in6_ifaddr *, int); Index: head/sys/netinet6/nd6.c =================================================================== --- head/sys/netinet6/nd6.c +++ head/sys/netinet6/nd6.c @@ -2113,7 +2113,7 @@ LLE_RUNLOCK(ln); if (chain != NULL) - nd6_flush_holdchain(ifp, ifp, chain, &sin6); + nd6_flush_holdchain(ifp, chain, &sin6); /* * When the link-layer address of a router changes, select the @@ -2502,23 +2502,18 @@ } int -nd6_flush_holdchain(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *chain, +nd6_flush_holdchain(struct ifnet *ifp, struct mbuf *chain, struct sockaddr_in6 *dst) { struct mbuf *m, *m_head; - struct ifnet *outifp; int error = 0; m_head = chain; - if ((ifp->if_flags & IFF_LOOPBACK) != 0) - outifp = origifp; - else - outifp = ifp; - + while (m_head) { m = m_head; m_head = m_head->m_nextpkt; - error = nd6_output_ifp(ifp, origifp, m, dst, NULL); + error = nd6_output_ifp(ifp, ifp, m, dst, NULL); } /* @@ -2526,7 +2521,7 @@ * note that intermediate errors are blindly ignored */ return (error); -} +} static int nd6_need_cache(struct ifnet *ifp) Index: head/sys/netinet6/nd6_nbr.c =================================================================== --- head/sys/netinet6/nd6_nbr.c +++ head/sys/netinet6/nd6_nbr.c @@ -894,7 +894,7 @@ LLE_WUNLOCK(ln); if (chain != NULL) - nd6_flush_holdchain(ifp, ifp, chain, &sin6); + nd6_flush_holdchain(ifp, chain, &sin6); if (checklink) pfxlist_onlink_check(); @@ -1515,17 +1515,11 @@ static void nd6_dad_ns_input(struct ifaddr *ifa, struct nd_opt_nonce *ndopt_nonce) { - struct in6_ifaddr *ia; - struct ifnet *ifp; - const struct in6_addr *taddr6; struct dadq *dp; if (ifa == NULL) panic("ifa == NULL in nd6_dad_ns_input"); - ia = (struct in6_ifaddr *)ifa; - ifp = ifa->ifa_ifp; - taddr6 = &ia->ia_addr.sin6_addr; /* Ignore Nonce option when Enhanced DAD is disabled. */ if (V_dad_enhanced == 0) ndopt_nonce = NULL; Index: head/sys/netinet6/raw_ip6.c =================================================================== --- head/sys/netinet6/raw_ip6.c +++ head/sys/netinet6/raw_ip6.c @@ -339,9 +339,6 @@ void rip6_ctlinput(int cmd, struct sockaddr *sa, void *d) { - struct ip6_hdr *ip6; - struct mbuf *m; - int off = 0; struct ip6ctlparam *ip6cp = NULL; const struct sockaddr_in6 *sa6_src = NULL; void *cmdarg; @@ -365,14 +362,9 @@ */ if (d != NULL) { ip6cp = (struct ip6ctlparam *)d; - m = ip6cp->ip6c_m; - ip6 = ip6cp->ip6c_ip6; - off = ip6cp->ip6c_off; cmdarg = ip6cp->ip6c_cmdarg; sa6_src = ip6cp->ip6c_src; } else { - m = NULL; - ip6 = NULL; cmdarg = NULL; sa6_src = &sa6_any; } @@ -391,7 +383,6 @@ struct mbuf *control; struct m_tag *mtag; struct sockaddr_in6 *dstsock; - struct in6_addr *dst; struct ip6_hdr *ip6; struct inpcb *in6p; u_int plen = m->m_pkthdr.len; @@ -413,7 +404,6 @@ in6p = sotoinpcb(so); INP_WLOCK(in6p); - dst = &dstsock->sin6_addr; if (control != NULL) { if ((error = ip6_setpktopts(control, &opt, in6p->in6p_outputopts, so->so_cred, Index: head/sys/netinet6/udp6_usrreq.c =================================================================== --- head/sys/netinet6/udp6_usrreq.c +++ head/sys/netinet6/udp6_usrreq.c @@ -1190,7 +1190,6 @@ { struct inpcb *inp; struct inpcbinfo *pcbinfo; - int error; pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); @@ -1212,8 +1211,8 @@ #endif if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) { - error = ENOTCONN; - goto out; + INP_WUNLOCK(inp); + return (ENOTCONN); } INP_HASH_WLOCK(pcbinfo); @@ -1223,7 +1222,6 @@ SOCK_LOCK(so); so->so_state &= ~SS_ISCONNECTED; /* XXX */ SOCK_UNLOCK(so); -out: INP_WUNLOCK(inp); return (0); } Index: head/sys/netipsec/key.c =================================================================== --- head/sys/netipsec/key.c +++ head/sys/netipsec/key.c @@ -5744,7 +5744,6 @@ key_setident(struct secashead *sah, const struct sadb_msghdr *mhp) { const struct sadb_ident *idsrc, *iddst; - int idsrclen, iddstlen; IPSEC_ASSERT(sah != NULL, ("null secashead")); IPSEC_ASSERT(mhp != NULL, ("null msghdr")); @@ -5766,8 +5765,6 @@ idsrc = (const struct sadb_ident *)mhp->ext[SADB_EXT_IDENTITY_SRC]; iddst = (const struct sadb_ident *)mhp->ext[SADB_EXT_IDENTITY_DST]; - idsrclen = mhp->extlen[SADB_EXT_IDENTITY_SRC]; - iddstlen = mhp->extlen[SADB_EXT_IDENTITY_DST]; /* validity check */ if (idsrc->sadb_ident_type != iddst->sadb_ident_type) { @@ -7464,7 +7461,6 @@ SAHTREE_RLOCK_TRACKER; struct secashead *sah; struct secasvar *sav; - struct sadb_msg *newmsg; struct mbuf *n; uint32_t cnt; uint8_t proto, satype; @@ -7501,7 +7497,6 @@ } /* send this to the userland, one at a time. */ - newmsg = NULL; TAILQ_FOREACH(sah, &V_sahtree, chain) { if (mhp->msg->sadb_msg_satype != SADB_SATYPE_UNSPEC && proto != sah->saidx.proto) Index: head/sys/netipsec/xform_ah.c =================================================================== --- head/sys/netipsec/xform_ah.c +++ head/sys/netipsec/xform_ah.c @@ -685,9 +685,7 @@ { IPSEC_DEBUG_DECLARE(char buf[IPSEC_ADDRSTRLEN]); unsigned char calc[AH_ALEN_MAX]; - const struct auth_hash *ahx; struct mbuf *m; - struct cryptodesc *crd; struct xform_data *xd; struct secasvar *sav; struct secasindex *saidx; @@ -696,7 +694,6 @@ int authsize, rplen, error, skip, protoff; uint8_t nxt; - crd = crp->crp_desc; m = (struct mbuf *) crp->crp_buf; xd = (struct xform_data *) crp->crp_opaque; sav = xd->sav; @@ -708,8 +705,6 @@ IPSEC_ASSERT(saidx->dst.sa.sa_family == AF_INET || saidx->dst.sa.sa_family == AF_INET6, ("unexpected protocol family %u", saidx->dst.sa.sa_family)); - - ahx = sav->tdb_authalgxform; /* Check for crypto errors. */ if (crp->crp_etype) { Index: head/sys/netipsec/xform_esp.c =================================================================== --- head/sys/netipsec/xform_esp.c +++ head/sys/netipsec/xform_esp.c @@ -441,7 +441,6 @@ IPSEC_DEBUG_DECLARE(char buf[128]); u_int8_t lastthree[3], aalg[AH_HMAC_MAXHASHLEN]; const struct auth_hash *esph; - const struct enc_xform *espx; struct mbuf *m; struct cryptodesc *crd; struct xform_data *xd; @@ -462,7 +461,6 @@ cryptoid = xd->cryptoid; saidx = &sav->sah->saidx; esph = sav->tdb_authalgxform; - espx = sav->tdb_encalgxform; /* Check for crypto errors */ if (crp->crp_etype) { Index: head/sys/netipsec/xform_ipcomp.c =================================================================== --- head/sys/netipsec/xform_ipcomp.c +++ head/sys/netipsec/xform_ipcomp.c @@ -274,7 +274,6 @@ ipcomp_input_cb(struct cryptop *crp) { IPSEC_DEBUG_DECLARE(char buf[IPSEC_ADDRSTRLEN]); - struct cryptodesc *crd; struct xform_data *xd; struct mbuf *m; struct secasvar *sav; @@ -284,8 +283,6 @@ int hlen = IPCOMP_HLENGTH, error, clen; int skip, protoff; uint8_t nproto; - - crd = crp->crp_desc; m = (struct mbuf *) crp->crp_buf; xd = (struct xform_data *) crp->crp_opaque; Index: head/sys/nfs/nfs_fha.c =================================================================== --- head/sys/nfs/nfs_fha.c +++ head/sys/nfs/nfs_fha.c @@ -225,11 +225,9 @@ static struct fha_hash_entry * fha_hash_entry_lookup(struct fha_params *softc, u_int64_t fh) { - SVCPOOL *pool; struct fha_hash_slot *fhs; struct fha_hash_entry *fhe, *new_fhe; - pool = *softc->pool; fhs = &softc->fha_hash[fh % FHA_HASH_SIZE]; new_fhe = fha_hash_entry_new(fh); new_fhe->mtx = &fhs->mtx; @@ -289,12 +287,9 @@ struct fha_hash_entry *fhe, struct fha_info *i, SVCTHREAD *this_thread) { SVCTHREAD *thread, *min_thread = NULL; - SVCPOOL *pool; int req_count, min_count = 0; off_t offset1, offset2; - pool = *softc->pool; - LIST_FOREACH(thread, &fhe->threads, st_alink) { req_count = thread->st_p2; @@ -475,17 +470,13 @@ struct fha_hash_entry *fhe; bool_t first, hfirst; SVCTHREAD *thread; - SVCPOOL *pool; sbuf_new(&sb, NULL, 65536, SBUF_FIXEDLEN); - pool = NULL; - if (!*softc->pool) { sbuf_printf(&sb, "NFSD not running\n"); goto out; } - pool = *softc->pool; for (i = 0; i < FHA_HASH_SIZE; i++) if (!LIST_EMPTY(&softc->fha_hash[i].list)) Index: head/sys/nlm/nlm_prot_impl.c =================================================================== --- head/sys/nlm/nlm_prot_impl.c +++ head/sys/nlm/nlm_prot_impl.c @@ -348,7 +348,6 @@ nlm_get_rpc(struct sockaddr *sa, rpcprog_t prog, rpcvers_t vers) { char *wchan = "nlmrcv"; - const char* protofmly; struct sockaddr_storage ss; struct socket *so; CLIENT *rpcb; @@ -370,14 +369,11 @@ switch (ss.ss_family) { case AF_INET: ((struct sockaddr_in *)&ss)->sin_port = htons(111); - protofmly = "inet"; so = nlm_socket; break; - #ifdef INET6 case AF_INET6: ((struct sockaddr_in6 *)&ss)->sin6_port = htons(111); - protofmly = "inet6"; so = nlm_socket6; break; #endif Index: head/sys/opencrypto/crypto.c =================================================================== --- head/sys/opencrypto/crypto.c +++ head/sys/opencrypto/crypto.c @@ -994,7 +994,7 @@ 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(); @@ -1007,7 +1007,6 @@ else match = CRYPTOCAP_F_SOFTWARE; best = NULL; - blocked = NULL; again: for (hid = 0; hid < crypto_drivers_num; hid++) { cap = &crypto_drivers[hid]; Index: head/sys/opencrypto/cryptosoft.c =================================================================== --- head/sys/opencrypto/cryptosoft.c +++ head/sys/opencrypto/cryptosoft.c @@ -986,7 +986,6 @@ struct swcr_data *swd; struct enc_xform *txf; struct auth_hash *axf; - struct comp_algo *cxf; u_int32_t sid = CRYPTO_SESID2LID(tid); if (sid > swcr_sesnum || swcr_sessions == NULL || @@ -1061,7 +1060,7 @@ break; case CRYPTO_DEFLATE_COMP: - cxf = swd->sw_cxf; + /* Nothing to do */ break; } Index: head/sys/rpc/clnt_dg.c =================================================================== --- head/sys/rpc/clnt_dg.c +++ head/sys/rpc/clnt_dg.c @@ -346,7 +346,6 @@ int retransmit_time; int next_sendtime, starttime, rtt, time_waited, tv = 0; struct sockaddr *sa; - socklen_t salen; uint32_t xid = 0; struct mbuf *mreq = NULL, *results; struct cu_request *cr; @@ -398,13 +397,10 @@ } cu->cu_connected = 1; } - if (cu->cu_connected) { + if (cu->cu_connected) sa = NULL; - salen = 0; - } else { + else sa = (struct sockaddr *)&cu->cu_raddr; - salen = cu->cu_rlen; - } time_waited = 0; retrans = 0; if (ext && ext->rc_timers) { Index: head/sys/security/mac/mac_syscalls.c =================================================================== --- head/sys/security/mac/mac_syscalls.c +++ head/sys/security/mac/mac_syscalls.c @@ -230,7 +230,6 @@ struct pipe *pipe; struct socket *so; cap_rights_t rights; - short label_type; int error; error = copyin(uap->mac_p, &mac, sizeof(mac)); @@ -253,7 +252,6 @@ if (error) goto out; - label_type = fp->f_type; switch (fp->f_type) { case DTYPE_FIFO: case DTYPE_VNODE: Index: head/sys/ufs/ffs/ffs_alloc.c =================================================================== --- head/sys/ufs/ffs/ffs_alloc.c +++ head/sys/ufs/ffs/ffs_alloc.c @@ -2414,13 +2414,11 @@ int mode; { struct ufsmount *ump; - struct inode *ip; if (DOINGSOFTDEP(pvp)) { softdep_freefile(pvp, ino, mode); return (0); } - ip = VTOI(pvp); ump = VFSTOUFS(pvp->v_mount); return (ffs_freefile(ump, ump->um_fs, ump->um_devvp, ino, mode, NULL)); } Index: head/sys/ufs/ffs/ffs_vnops.c =================================================================== --- head/sys/ufs/ffs/ffs_vnops.c +++ head/sys/ufs/ffs/ffs_vnops.c @@ -1369,7 +1369,6 @@ */ { struct inode *ip; - struct fs *fs; struct extattr *eap; uint32_t ul; int olen, error, i, easize; @@ -1377,7 +1376,6 @@ void *tmp; ip = VTOI(ap->a_vp); - fs = ITOFS(ip); if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) return (EOPNOTSUPP);