Index: sys/arm/allwinner/aw_wdog.c =================================================================== --- sys/arm/allwinner/aw_wdog.c +++ 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: sys/arm/allwinner/axp81x.c =================================================================== --- sys/arm/allwinner/axp81x.c +++ 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: sys/arm/allwinner/clk/aw_pll.c =================================================================== --- sys/arm/allwinner/clk/aw_pll.c +++ 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: sys/arm/allwinner/if_awg.c =================================================================== --- sys/arm/allwinner/if_awg.c +++ sys/arm/allwinner/if_awg.c @@ -1165,12 +1165,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; @@ -1607,12 +1605,10 @@ { uint8_t eaddr[ETHER_ADDR_LEN]; struct awg_softc *sc; - phandle_t node; int error; sc = device_get_softc(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: sys/arm/arm/gic.c =================================================================== --- sys/arm/arm/gic.c +++ sys/arm/arm/gic.c @@ -1376,11 +1376,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: sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c =================================================================== --- sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c +++ sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c @@ -1385,9 +1385,6 @@ static int bcm2835_cpufreq_detach(device_t dev) { - struct bcm2835_cpufreq_softc *sc; - - sc = device_get_softc(dev); sema_destroy(&vc_sema); @@ -1399,7 +1396,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); @@ -1424,8 +1424,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: sys/arm/broadcom/bcm2835/bcm2835_gpio.c =================================================================== --- sys/arm/broadcom/bcm2835/bcm2835_gpio.c +++ sys/arm/broadcom/bcm2835/bcm2835_gpio.c @@ -1015,7 +1015,7 @@ u_int *irqp, uint32_t *modep) { u_int irq; - uint32_t mode, bank; + uint32_t mode; /* * The first cell is the interrupt number. @@ -1034,7 +1034,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: sys/arm/broadcom/bcm2835/bcm2835_mbox.c =================================================================== --- sys/arm/broadcom/bcm2835/bcm2835_mbox.c +++ sys/arm/broadcom/bcm2835/bcm2835_mbox.c @@ -101,14 +101,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: sys/arm64/arm64/gic_v3.c =================================================================== --- sys/arm64/arm64/gic_v3.c +++ sys/arm64/arm64/gic_v3.c @@ -393,9 +393,7 @@ struct intr_pic *pic; uint64_t active_irq; struct trapframe *tf; - bool first; - first = true; pic = sc->gic_pic; while (1) { Index: sys/arm64/arm64/gicv3_its.c =================================================================== --- sys/arm64/arm64/gicv3_its.c +++ sys/arm64/arm64/gicv3_its.c @@ -1078,12 +1078,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, @@ -1138,11 +1136,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, @@ -1378,9 +1374,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: sys/arm64/arm64/machdep.c =================================================================== --- sys/arm64/arm64/machdep.c +++ sys/arm64/arm64/machdep.c @@ -569,14 +569,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: sys/arm64/arm64/pmap.c =================================================================== --- sys/arm64/arm64/pmap.c +++ sys/arm64/arm64/pmap.c @@ -655,7 +655,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; @@ -664,7 +664,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: sys/cam/ata/ata_da.c =================================================================== --- sys/cam/ata/ata_da.c +++ sys/cam/ata/ata_da.c @@ -2605,10 +2605,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) { @@ -2623,7 +2621,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; @@ -2638,7 +2636,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: sys/cam/scsi/scsi_da.c =================================================================== --- sys/cam/scsi/scsi_da.c +++ sys/cam/scsi/scsi_da.c @@ -1488,7 +1488,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; @@ -1507,7 +1506,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; @@ -2284,7 +2283,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; @@ -2297,7 +2296,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; @@ -3927,7 +3925,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; @@ -3944,7 +3942,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: sys/cam/scsi/scsi_pass.c =================================================================== --- sys/cam/scsi/scsi_pass.c +++ sys/cam/scsi/scsi_pass.c @@ -1680,13 +1680,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: sys/dev/al_eth/al_eth.c =================================================================== --- sys/dev/al_eth/al_eth.c +++ 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; @@ -305,8 +304,6 @@ 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, &bar_udma, RF_ACTIVE); Index: sys/dev/axgbe/xgbe-drv.c =================================================================== --- sys/dev/axgbe/xgbe-drv.c +++ 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: sys/dev/axgbe/xgbe-mdio.c =================================================================== --- sys/dev/axgbe/xgbe-mdio.c +++ 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: sys/dev/e1000/igb_txrx.c =================================================================== --- sys/dev/e1000/igb_txrx.c +++ 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: sys/dev/extres/clk/clk_bus.c =================================================================== --- sys/dev/extres/clk/clk_bus.c +++ 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: sys/dev/extres/regulator/regulator_bus.c =================================================================== --- sys/dev/extres/regulator/regulator_bus.c +++ 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: sys/dev/fdt/fdt_common.c =================================================================== --- sys/dev/fdt/fdt_common.c +++ sys/dev/fdt/fdt_common.c @@ -152,7 +152,7 @@ pcell_t ranges[6], *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); @@ -178,10 +178,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); @@ -597,11 +593,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) { @@ -631,7 +625,6 @@ goto out; } - memory_size = 0; tuples = res_len / tuple_size; reservep = (pcell_t *)&reserve; for (i = 0; i < tuples; i++) { @@ -659,9 +652,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: sys/dev/mii/rdcphy.c =================================================================== --- sys/dev/mii/rdcphy.c +++ sys/dev/mii/rdcphy.c @@ -183,11 +183,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: sys/dev/mmc/host/dwmmc.c =================================================================== --- sys/dev/mmc/host/dwmmc.c +++ sys/dev/mmc/host/dwmmc.c @@ -749,12 +749,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: sys/dev/mmc/mmc.c =================================================================== --- sys/dev/mmc/mmc.c +++ sys/dev/mmc/mmc.c @@ -1369,17 +1369,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, " bus: %ubit, %uMHz (%s timing)\n", (ivar->bus_width == bus_width_1 ? 1 : Index: sys/dev/mmc/mmcsd.c =================================================================== --- sys/dev/mmc/mmcsd.c +++ sys/dev/mmc/mmcsd.c @@ -663,11 +663,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_PART_LOCK(part); if (part->running > 0 || part->suspend > 0) { bioq_disksort(&part->bio_queue, bp); Index: sys/dev/ofw/ofw_bus_subr.c =================================================================== --- sys/dev/ofw/ofw_bus_subr.c +++ sys/dev/ofw/ofw_bus_subr.c @@ -384,9 +384,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]; @@ -443,7 +442,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 */ @@ -460,7 +459,6 @@ } err = ENOENT; - rid = 0; mask = 0xffffffff; OF_getencprop(node, "msi-map-mask", &mask, sizeof(mask)); Index: sys/dev/ofw/ofwpci.c =================================================================== --- sys/dev/ofw/ofwpci.c +++ sys/dev/ofw/ofwpci.c @@ -558,11 +558,8 @@ 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, res)); Index: sys/dev/pci/pci.c =================================================================== --- sys/dev/pci/pci.c +++ sys/dev/pci/pci.c @@ -3966,7 +3966,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; @@ -3986,7 +3985,6 @@ } else unchanged = NULL; - sc = device_get_softc(dev); domain = pcib_get_domain(dev); busno = pcib_get_bus(dev); maxslots = PCIB_MAXSLOTS(pcib); @@ -4063,12 +4061,10 @@ 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); PCIB_DECODE_RID(pcib, rid, &busno, &slot, &func); Index: sys/dev/pci/pci_pci.c =================================================================== --- sys/dev/pci/pci_pci.c +++ sys/dev/pci/pci_pci.c @@ -1240,10 +1240,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; @@ -1483,16 +1481,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: sys/dev/smc/if_smc_fdt.c =================================================================== --- sys/dev/smc/if_smc_fdt.c +++ 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: sys/dev/uart/uart_bus_acpi.c =================================================================== --- sys/dev/uart/uart_bus_acpi.c +++ sys/dev/uart/uart_bus_acpi.c @@ -102,13 +102,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: sys/dev/uart/uart_dev_pl011.c =================================================================== --- sys/dev/uart/uart_dev_pl011.c +++ sys/dev/uart/uart_dev_pl011.c @@ -379,10 +379,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: sys/dev/uart/uart_dev_snps.c =================================================================== --- sys/dev/uart/uart_dev_snps.c +++ 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: sys/dev/usb/controller/dwc_otg_fdt.c =================================================================== --- sys/dev/usb/controller/dwc_otg_fdt.c +++ sys/dev/usb/controller/dwc_otg_fdt.c @@ -168,7 +168,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); @@ -179,7 +178,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: sys/dev/usb/controller/ehci.c =================================================================== --- sys/dev/usb/controller/ehci.c +++ sys/dev/usb/controller/ehci.c @@ -1192,9 +1192,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", @@ -1214,8 +1212,6 @@ usb_pc_cpu_invalidate(qh->page_cache); - status = hc32toh(sc, qh->qh_qtd.qtd_status); - /* reset scanner */ xfer->td_transfer_cache = xfer->td_transfer_first; Index: sys/dev/usb/controller/ohci.c =================================================================== --- sys/dev/usb/controller/ohci.c +++ sys/dev/usb/controller/ohci.c @@ -2383,7 +2383,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; @@ -2391,7 +2390,6 @@ uint32_t nqh; uint32_t n; - sc = OHCI_BUS2SC(parm->udev->bus); xfer = parm->curr_xfer; parm->hc_max_packet_size = 0x500; Index: sys/dev/usb/controller/xhci.c =================================================================== --- sys/dev/usb/controller/xhci.c +++ sys/dev/usb/controller/xhci.c @@ -3712,13 +3712,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: sys/dev/usb/storage/umass.c =================================================================== --- sys/dev/usb/storage/umass.c +++ sys/dev/usb/storage/umass.c @@ -1087,7 +1087,6 @@ umass_init_shuttle(struct umass_softc *sc) { struct usb_device_request req; - usb_error_t err; uint8_t status[2] = {0, 0}; /* @@ -1100,7 +1099,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: sys/dev/usb/usb_dev.c =================================================================== --- sys/dev/usb/usb_dev.c +++ sys/dev/usb/usb_dev.c @@ -876,7 +876,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); @@ -888,7 +888,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); @@ -1410,8 +1409,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; @@ -1424,8 +1421,6 @@ if (err) return (ENXIO); - fflags = cpd->fflags; - f = refs.rxfifo; if (f == NULL) { /* should not happen */ @@ -1433,8 +1428,6 @@ return (EPERM); } - resid = uio->uio_resid; - mtx_lock(f->priv_mtx); /* check for permanent read error */ @@ -1534,8 +1527,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; @@ -1550,15 +1541,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: sys/dev/vnic/nic_main.c =================================================================== --- sys/dev/vnic/nic_main.c +++ 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: sys/dev/vnic/nicvf_main.c =================================================================== --- sys/dev/vnic/nicvf_main.c +++ 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: sys/dev/vnic/nicvf_queues.c =================================================================== --- sys/dev/vnic/nicvf_queues.c +++ sys/dev/vnic/nicvf_queues.c @@ -1711,13 +1711,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: sys/fs/cd9660/cd9660_vfsops.c =================================================================== --- sys/fs/cd9660/cd9660_vfsops.c +++ sys/fs/cd9660/cd9660_vfsops.c @@ -673,7 +673,6 @@ struct iso_node *ip; struct buf *bp; struct vnode *vp; - struct cdev *dev; int error; struct thread *td; @@ -700,7 +699,6 @@ */ imp = VFSTOISOFS(mp); - dev = imp->im_dev; /* Allocate a new vnode/iso_node. */ if ((error = getnewvnode("isofs", mp, &cd9660_vnodeops, &vp)) != 0) { Index: sys/fs/nfs/nfs_commonkrpc.c =================================================================== --- sys/fs/nfs/nfs_commonkrpc.c +++ sys/fs/nfs/nfs_commonkrpc.c @@ -479,7 +479,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; @@ -688,7 +688,6 @@ } #endif } - trycnt = 0; freeslot = -1; /* Set to slot that needs to be free'd */ tryagain: slot = -1; /* Slot that needs a sequence# increment. */ @@ -1193,8 +1192,7 @@ { sigset_t oldset; int error; - struct proc *p; - + if ((priority & PCATCH) == 0) return msleep(ident, mtx, priority, wmesg, timo); if (td == NULL) @@ -1202,7 +1200,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: sys/fs/nfs/nfs_commonsubs.c =================================================================== --- sys/fs/nfs/nfs_commonsubs.c +++ sys/fs/nfs/nfs_commonsubs.c @@ -480,7 +480,7 @@ { u_int32_t *tl; u_int8_t *cp; - int fullsiz, rem, bytesize = 0; + int fullsiz, bytesize = 0; if (size == 0) size = NFSX_MYFH; @@ -497,7 +497,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: sys/fs/nfsclient/nfs_clstate.c =================================================================== --- sys/fs/nfsclient/nfs_clstate.c +++ sys/fs/nfsclient/nfs_clstate.c @@ -4026,7 +4026,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; @@ -4036,10 +4035,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: sys/fs/nfsserver/nfs_nfsdport.c =================================================================== --- sys/fs/nfsserver/nfs_nfsdport.c +++ sys/fs/nfsserver/nfs_nfsdport.c @@ -345,7 +345,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; @@ -370,7 +370,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; @@ -398,7 +397,6 @@ * the mount point, unless nfsrv_enable_crossmntpt is set. */ cnp->cn_flags |= NOCROSSMOUNT; - crossmnt = 0; } /* Index: sys/fs/nfsserver/nfs_nfsdstate.c =================================================================== --- sys/fs/nfsserver/nfs_nfsdstate.c +++ sys/fs/nfsserver/nfs_nfsdstate.c @@ -3252,7 +3252,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; @@ -3351,7 +3351,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: sys/geom/geom_subr.c =================================================================== --- sys/geom/geom_subr.c +++ sys/geom/geom_subr.c @@ -861,7 +861,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(); @@ -892,7 +892,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: sys/geom/raid/g_raid.c =================================================================== --- sys/geom/raid/g_raid.c +++ sys/geom/raid/g_raid.c @@ -953,7 +953,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; @@ -961,7 +960,6 @@ int i; vol = tr->tro_volume; - sc = vol->v_softc; /* * Allocate all bios before sending any request, so we can return Index: sys/geom/raid/md_ddf.c =================================================================== --- sys/geom/raid/md_ddf.c +++ sys/geom/raid/md_ddf.c @@ -755,10 +755,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); @@ -843,10 +841,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); @@ -872,13 +868,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) @@ -1425,12 +1419,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++) { @@ -1864,7 +1856,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; @@ -1873,7 +1864,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: sys/geom/raid/md_promise.c =================================================================== --- sys/geom/raid/md_promise.c +++ sys/geom/raid/md_promise.c @@ -1098,7 +1098,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; @@ -1109,7 +1109,6 @@ pp = cp->provider; /* Read metadata from device. */ - meta = NULL; g_topology_unlock(); vendor = 0xffff; len = sizeof(vendor); Index: sys/geom/raid/tr_raid5.c =================================================================== --- sys/geom/raid/tr_raid5.c +++ sys/geom/raid/tr_raid5.c @@ -342,10 +342,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: sys/kern/kern_synch.c =================================================================== --- sys/kern/kern_synch.c +++ sys/kern/kern_synch.c @@ -129,14 +129,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); @@ -233,12 +231,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")); Index: sys/kern/link_elf.c =================================================================== --- sys/kern/link_elf.c +++ sys/kern/link_elf.c @@ -765,10 +765,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; @@ -867,7 +865,6 @@ phlimit = phdr + hdr->e_phnum; nsegs = 0; phdyn = NULL; - phphdr = NULL; while (phdr < phlimit) { switch (phdr->p_type) { case PT_LOAD: @@ -883,10 +880,6 @@ ++nsegs; break; - case PT_PHDR: - phphdr = phdr; - break; - case PT_DYNAMIC: phdyn = phdr; break; @@ -914,7 +907,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: sys/kern/subr_msgbuf.c =================================================================== --- sys/kern/subr_msgbuf.c +++ sys/kern/subr_msgbuf.c @@ -185,11 +185,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: sys/kern/subr_sleepqueue.c =================================================================== --- sys/kern/subr_sleepqueue.c +++ sys/kern/subr_sleepqueue.c @@ -1136,11 +1136,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: sys/kern/subr_witness.c =================================================================== --- sys/kern/subr_witness.c +++ sys/kern/subr_witness.c @@ -1804,7 +1804,6 @@ enroll(const char *description, struct lock_class *lock_class) { struct witness *w; - struct witness_list *typelist; MPASS(description != NULL); @@ -1813,11 +1812,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); @@ -1861,14 +1856,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--; } /* @@ -2543,7 +2535,6 @@ struct witness_lock_order_data *data1, *data2, *tmp_data1, *tmp_data2; struct witness *tmp_w1, *tmp_w2, *w1, *w2; struct sbuf *sb; - u_int w_rmatrix1, w_rmatrix2; int error, generation, i, j; tmp_data1 = NULL; @@ -2625,8 +2616,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: sys/kern/vfs_aio.c =================================================================== --- sys/kern/vfs_aio.c +++ sys/kern/vfs_aio.c @@ -954,7 +954,6 @@ bool aio_cancel_cleared(struct kaiocb *job) { - struct kaioinfo *ki; /* * The caller should hold the same queue lock held when @@ -962,7 +961,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); } @@ -1681,7 +1679,6 @@ int aio_queue_file(struct file *fp, struct kaiocb *job) { - struct aioliojob *lj; struct kaioinfo *ki; struct kaiocb *job2; struct vnode *vp; @@ -1689,7 +1686,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: sys/kern/vfs_subr.c =================================================================== --- sys/kern/vfs_subr.c +++ sys/kern/vfs_subr.c @@ -1131,7 +1131,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, @@ -1168,7 +1168,6 @@ } mtx_unlock(&vnode_free_list_mtx); done = 0; - ofreevnodes = freevnodes; onumvnodes = numvnodes; /* * Calculate parameters for recycling. These are the same Index: sys/net/if_ethersubr.c =================================================================== --- sys/net/if_ethersubr.c +++ sys/net/if_ethersubr.c @@ -286,7 +286,6 @@ int hlen; /* link layer header length */ uint32_t pflags; struct llentry *lle = NULL; - struct rtentry *rt0 = NULL; int addref = 0; phdr = NULL; @@ -316,7 +315,6 @@ pflags = lle->r_flags; } } - rt0 = ro->ro_rt; } #ifdef MAC Index: sys/net/if_gif.c =================================================================== --- sys/net/if_gif.c +++ sys/net/if_gif.c @@ -518,7 +518,6 @@ struct ip6_hdr *ip6; uint32_t t; #endif - struct gif_softc *sc; struct ether_header *eh; struct ifnet *oldifp; int isr, n, af; @@ -528,7 +527,6 @@ m_freem(m); return; } - sc = ifp->if_softc; m->m_pkthdr.rcvif = ifp; m_clrprotoflags(m); switch (proto) { Index: sys/netinet/tcp_output.c =================================================================== --- sys/netinet/tcp_output.c +++ sys/netinet/tcp_output.c @@ -194,7 +194,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; @@ -1135,7 +1137,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: sys/netinet6/in6_mcast.c =================================================================== --- sys/netinet6/in6_mcast.c +++ sys/netinet6/in6_mcast.c @@ -1235,11 +1235,8 @@ 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); IN6_MULTI_UNLOCK(); Index: sys/netinet6/in6_src.c =================================================================== --- sys/netinet6/in6_src.c +++ sys/netinet6/in6_src.c @@ -158,7 +158,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)); \ @@ -174,7 +173,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) @@ -192,7 +190,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__)); @@ -308,7 +306,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: sys/netinet6/mld6.c =================================================================== --- sys/netinet6/mld6.c +++ sys/netinet6/mld6.c @@ -2284,7 +2284,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; @@ -2296,7 +2296,6 @@ IN6_MULTI_LOCK_ASSERT(); - error = 0; ifp = inm->in6m_ifp; is_filter_list_change = 0; m = NULL; Index: sys/netinet6/nd6.c =================================================================== --- sys/netinet6/nd6.c +++ sys/netinet6/nd6.c @@ -2504,15 +2504,10 @@ 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; @@ -2524,7 +2519,7 @@ * note that intermediate errors are blindly ignored */ return (error); -} +} static int nd6_need_cache(struct ifnet *ifp) Index: sys/netinet6/nd6_nbr.c =================================================================== --- sys/netinet6/nd6_nbr.c +++ sys/netinet6/nd6_nbr.c @@ -1504,17 +1504,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: sys/netinet6/raw_ip6.c =================================================================== --- sys/netinet6/raw_ip6.c +++ sys/netinet6/raw_ip6.c @@ -337,9 +337,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; @@ -363,14 +360,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; } @@ -389,7 +381,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; @@ -411,7 +402,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: sys/netinet6/udp6_usrreq.c =================================================================== --- sys/netinet6/udp6_usrreq.c +++ sys/netinet6/udp6_usrreq.c @@ -1183,7 +1183,6 @@ { struct inpcb *inp; struct inpcbinfo *pcbinfo; - int error; pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); @@ -1205,8 +1204,8 @@ #endif if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) { - error = ENOTCONN; - goto out; + INP_WUNLOCK(inp); + return (ENOTCONN); } INP_HASH_WLOCK(pcbinfo); Index: sys/netipsec/key.c =================================================================== --- sys/netipsec/key.c +++ sys/netipsec/key.c @@ -5726,7 +5726,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")); @@ -5748,8 +5747,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) { @@ -7446,7 +7443,6 @@ SAHTREE_RLOCK_TRACKER; struct secashead *sah; struct secasvar *sav; - struct sadb_msg *newmsg; struct mbuf *n; uint32_t cnt; uint8_t proto, satype; @@ -7483,7 +7479,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: sys/netipsec/xform_ah.c =================================================================== --- sys/netipsec/xform_ah.c +++ sys/netipsec/xform_ah.c @@ -678,9 +678,7 @@ { 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; @@ -689,7 +687,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; @@ -702,8 +699,6 @@ 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) { if (crp->crp_etype == EAGAIN) { Index: sys/netipsec/xform_esp.c =================================================================== --- sys/netipsec/xform_esp.c +++ sys/netipsec/xform_esp.c @@ -436,7 +436,6 @@ 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; @@ -457,7 +456,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: sys/netipsec/xform_ipcomp.c =================================================================== --- sys/netipsec/xform_ipcomp.c +++ sys/netipsec/xform_ipcomp.c @@ -268,7 +268,6 @@ ipcomp_input_cb(struct cryptop *crp) { char buf[IPSEC_ADDRSTRLEN]; - struct cryptodesc *crd; struct xform_data *xd; struct mbuf *m; struct secasvar *sav; @@ -279,8 +278,6 @@ int skip, protoff; uint8_t nproto; - crd = crp->crp_desc; - m = (struct mbuf *) crp->crp_buf; xd = (struct xform_data *) crp->crp_opaque; sav = xd->sav; Index: sys/nfs/nfs_fha.c =================================================================== --- sys/nfs/nfs_fha.c +++ sys/nfs/nfs_fha.c @@ -229,11 +229,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; @@ -293,12 +291,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; @@ -473,17 +468,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: sys/nlm/nlm_prot_impl.c =================================================================== --- sys/nlm/nlm_prot_impl.c +++ sys/nlm/nlm_prot_impl.c @@ -346,7 +346,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; @@ -368,14 +367,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: sys/opencrypto/crypto.c =================================================================== --- sys/opencrypto/crypto.c +++ sys/opencrypto/crypto.c @@ -902,7 +902,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(); @@ -915,7 +915,6 @@ else match = CRYPTOCAP_F_SOFTWARE; best = NULL; - blocked = NULL; again: for (hid = 0; hid < crypto_drivers_num; hid++) { cap = &crypto_drivers[hid]; Index: sys/opencrypto/cryptosoft.c =================================================================== --- sys/opencrypto/cryptosoft.c +++ 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: sys/rpc/clnt_dg.c =================================================================== --- sys/rpc/clnt_dg.c +++ sys/rpc/clnt_dg.c @@ -344,7 +344,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; @@ -396,13 +395,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: sys/security/mac/mac_syscalls.c =================================================================== --- sys/security/mac/mac_syscalls.c +++ 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: sys/ufs/ffs/ffs_alloc.c =================================================================== --- sys/ufs/ffs/ffs_alloc.c +++ sys/ufs/ffs/ffs_alloc.c @@ -2443,13 +2443,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: sys/ufs/ffs/ffs_vnops.c =================================================================== --- sys/ufs/ffs/ffs_vnops.c +++ sys/ufs/ffs/ffs_vnops.c @@ -1367,7 +1367,6 @@ */ { struct inode *ip; - struct fs *fs; struct extattr *eap; uint32_t ul; int olen, error, i, easize; @@ -1375,7 +1374,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);