Author: kan
Date: Mon Dec 25 04:48:39 2017
New Revision: 327173
URL: https://svnweb.freebsd.org/changeset/base/327173

Log:
  Do pass removing some write-only variables from the kernel.
  
  This reduces noise when kernel is compiled by newer GCC versions,
  such as one used by external toolchain ports.
  
  Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial)
  Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c)
  Differential Revision: https://reviews.freebsd.org/D10385

Modified:
  head/sys/arm/allwinner/aw_wdog.c
  head/sys/arm/allwinner/axp81x.c
  head/sys/arm/allwinner/clk/aw_pll.c
  head/sys/arm/allwinner/if_awg.c
  head/sys/arm/arm/gic.c
  head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c
  head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
  head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
  head/sys/arm64/arm64/gic_v3.c
  head/sys/arm64/arm64/gicv3_its.c
  head/sys/arm64/arm64/machdep.c
  head/sys/arm64/arm64/pmap.c
  head/sys/cam/ata/ata_da.c
  head/sys/cam/scsi/scsi_da.c
  head/sys/cam/scsi/scsi_pass.c
  head/sys/dev/al_eth/al_eth.c
  head/sys/dev/axgbe/xgbe-drv.c
  head/sys/dev/axgbe/xgbe-mdio.c
  head/sys/dev/e1000/igb_txrx.c
  head/sys/dev/extres/clk/clk_bus.c
  head/sys/dev/extres/regulator/regulator_bus.c
  head/sys/dev/fdt/fdt_common.c
  head/sys/dev/mii/rdcphy.c
  head/sys/dev/mmc/host/dwmmc.c
  head/sys/dev/mmc/mmc.c
  head/sys/dev/mmc/mmcsd.c
  head/sys/dev/ofw/ofw_bus_subr.c
  head/sys/dev/ofw/ofwpci.c
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pci_pci.c
  head/sys/dev/smc/if_smc_fdt.c
  head/sys/dev/uart/uart_bus_acpi.c
  head/sys/dev/uart/uart_dev_pl011.c
  head/sys/dev/uart/uart_dev_snps.c
  head/sys/dev/usb/controller/dwc_otg_fdt.c
  head/sys/dev/usb/controller/ehci.c
  head/sys/dev/usb/controller/ohci.c
  head/sys/dev/usb/controller/xhci.c
  head/sys/dev/usb/storage/umass.c
  head/sys/dev/usb/usb_dev.c
  head/sys/dev/vnic/nic_main.c
  head/sys/dev/vnic/nicvf_main.c
  head/sys/dev/vnic/nicvf_queues.c
  head/sys/fs/cd9660/cd9660_vfsops.c
  head/sys/fs/nfs/nfs_commonkrpc.c
  head/sys/fs/nfs/nfs_commonsubs.c
  head/sys/fs/nfsclient/nfs_clstate.c
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/fs/nfsserver/nfs_nfsdstate.c
  head/sys/geom/geom_subr.c
  head/sys/geom/raid/g_raid.c
  head/sys/geom/raid/md_ddf.c
  head/sys/geom/raid/md_promise.c
  head/sys/geom/raid/tr_raid5.c
  head/sys/kern/kern_synch.c
  head/sys/kern/link_elf.c
  head/sys/kern/subr_msgbuf.c
  head/sys/kern/subr_sleepqueue.c
  head/sys/kern/subr_witness.c
  head/sys/kern/vfs_aio.c
  head/sys/kern/vfs_subr.c
  head/sys/net/if_ethersubr.c
  head/sys/net/if_gif.c
  head/sys/netinet/tcp_output.c
  head/sys/netinet6/in6_mcast.c
  head/sys/netinet6/in6_src.c
  head/sys/netinet6/mld6.c
  head/sys/netinet6/nd6.c
  head/sys/netinet6/nd6.h
  head/sys/netinet6/nd6_nbr.c
  head/sys/netinet6/raw_ip6.c
  head/sys/netinet6/udp6_usrreq.c
  head/sys/netipsec/key.c
  head/sys/netipsec/xform_ah.c
  head/sys/netipsec/xform_esp.c
  head/sys/netipsec/xform_ipcomp.c
  head/sys/nfs/nfs_fha.c
  head/sys/nlm/nlm_prot_impl.c
  head/sys/opencrypto/crypto.c
  head/sys/opencrypto/cryptosoft.c
  head/sys/rpc/clnt_dg.c
  head/sys/security/mac/mac_syscalls.c
  head/sys/ufs/ffs/ffs_alloc.c
  head/sys/ufs/ffs/ffs_vnops.c

Modified: head/sys/arm/allwinner/aw_wdog.c
==============================================================================
--- head/sys/arm/allwinner/aw_wdog.c    Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/arm/allwinner/aw_wdog.c    Mon Dec 25 04:48:39 2017        
(r327173)
@@ -115,9 +115,6 @@ static void aw_wdog_shutdown_fn(void *, int);
 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);

Modified: head/sys/arm/allwinner/axp81x.c
==============================================================================
--- head/sys/arm/allwinner/axp81x.c     Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/arm/allwinner/axp81x.c     Mon Dec 25 04:48:39 2017        
(r327173)
@@ -352,13 +352,11 @@ axp81x_shutdown(void *devp, int howto)
 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)

Modified: head/sys/arm/allwinner/clk/aw_pll.c
==============================================================================
--- head/sys/arm/allwinner/clk/aw_pll.c Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/arm/allwinner/clk/aw_pll.c Mon Dec 25 04:48:39 2017        
(r327173)
@@ -865,7 +865,7 @@ h3_pll1_set_freq(struct aw_pll_sc *sc, uint64_t fin, u
     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 @@ h3_pll1_set_freq(struct aw_pll_sc *sc, uint64_t fin, u
        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;
 

Modified: head/sys/arm/allwinner/if_awg.c
==============================================================================
--- head/sys/arm/allwinner/if_awg.c     Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/arm/allwinner/if_awg.c     Mon Dec 25 04:48:39 2017        
(r327173)
@@ -1266,12 +1266,10 @@ awg_setup_extres(device_t dev)
        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 @@ awg_attach(device_t dev)
 {
        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");

Modified: head/sys/arm/arm/gic.c
==============================================================================
--- head/sys/arm/arm/gic.c      Mon Dec 25 04:34:10 2017        (r327172)
+++ head/sys/arm/arm/gic.c      Mon Dec 25 04:48:39 2017        (r327173)
@@ -1384,11 +1384,9 @@ int
 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;

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c     Mon Dec 25 04:34:10 
2017        (r327172)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c     Mon Dec 25 04:48:39 
2017        (r327173)
@@ -1386,10 +1386,7 @@ bcm2835_cpufreq_attach(device_t dev)
 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 @@ bcm2835_cpufreq_set(device_t dev, const struct cf_sett
 {
        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 @@ bcm2835_cpufreq_set(device_t dev, const struct cf_sett
 
        /* 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);

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c        Mon Dec 25 04:34:10 
2017        (r327172)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c        Mon Dec 25 04:48:39 
2017        (r327173)
@@ -1017,7 +1017,7 @@ bcm_gpio_pic_map_fdt(struct bcm_gpio_softc *sc, struct
     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 @@ bcm_gpio_pic_map_fdt(struct bcm_gpio_softc *sc, struct
                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)

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c        Mon Dec 25 04:34:10 
2017        (r327172)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c        Mon Dec 25 04:48:39 
2017        (r327173)
@@ -103,14 +103,18 @@ static struct ofw_compat_data compat_data[] = {
 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);

Modified: head/sys/arm64/arm64/gic_v3.c
==============================================================================
--- head/sys/arm64/arm64/gic_v3.c       Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/arm64/arm64/gic_v3.c       Mon Dec 25 04:48:39 2017        
(r327173)
@@ -408,9 +408,7 @@ arm_gic_v3_intr(void *arg)
        struct intr_pic *pic;
        uint64_t active_irq;
        struct trapframe *tf;
-       bool first;
 
-       first = true;
        pic = sc->gic_pic;
 
        while (1) {

Modified: head/sys/arm64/arm64/gicv3_its.c
==============================================================================
--- head/sys/arm64/arm64/gicv3_its.c    Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/arm64/arm64/gicv3_its.c    Mon Dec 25 04:48:39 2017        
(r327173)
@@ -1105,12 +1105,10 @@ static int
 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 @@ gicv3_its_alloc_msix(device_t dev, device_t child, dev
 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 @@ its_cmd_prepare(struct its_cmd *cmd, struct its_cmd_de
        uint64_t target;
        uint8_t cmd_type;
        u_int size;
-       boolean_t error;
 
-       error = FALSE;
        cmd_type = desc->cmd_type;
        target = ITS_TARGET_NONE;
 

Modified: head/sys/arm64/arm64/machdep.c
==============================================================================
--- head/sys/arm64/arm64/machdep.c      Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/arm64/arm64/machdep.c      Mon Dec 25 04:48:39 2017        
(r327173)
@@ -630,14 +630,13 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
        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);
 

Modified: head/sys/arm64/arm64/pmap.c
==============================================================================
--- head/sys/arm64/arm64/pmap.c Mon Dec 25 04:34:10 2017        (r327172)
+++ head/sys/arm64/arm64/pmap.c Mon Dec 25 04:48:39 2017        (r327173)
@@ -621,7 +621,7 @@ pmap_bootstrap_l2(vm_offset_t l1pt, vm_offset_t va, vm
 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 @@ pmap_bootstrap_l3(vm_offset_t l1pt, vm_offset_t va, vm
 
        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;
 

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c   Mon Dec 25 04:34:10 2017        (r327172)
+++ head/sys/cam/ata/ata_da.c   Mon Dec 25 04:48:39 2017        (r327173)
@@ -2631,10 +2631,8 @@ adaprobedone(struct cam_periph *periph, union ccb *ccb
 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 @@ adazonedone(struct cam_periph *periph, union ccb *ccb)
                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 @@ adazonedone(struct cam_periph *periph, union ccb *ccb)
                 * 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)) {
                        /*

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c Mon Dec 25 04:34:10 2017        (r327172)
+++ head/sys/cam/scsi/scsi_da.c Mon Dec 25 04:48:39 2017        (r327173)
@@ -1525,7 +1525,6 @@ daclose(struct disk *dp)
        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 @@ daclose(struct disk *dp)
                            /*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 @@ dadeletemethodsysctl(SYSCTL_HANDLER_ARGS)
        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 @@ dadeletemethodsysctl(SYSCTL_HANDLER_ARGS)
        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 @@ dazonedone(struct cam_periph *periph, union ccb *ccb)
                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 @@ dazonedone(struct cam_periph *periph, union ccb *ccb)
                 * 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)) {
                        /*

Modified: head/sys/cam/scsi/scsi_pass.c
==============================================================================
--- head/sys/cam/scsi/scsi_pass.c       Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/cam/scsi/scsi_pass.c       Mon Dec 25 04:48:39 2017        
(r327173)
@@ -1699,13 +1699,11 @@ static int
 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:

Modified: head/sys/dev/al_eth/al_eth.c
==============================================================================
--- head/sys/dev/al_eth/al_eth.c        Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/al_eth/al_eth.c        Mon Dec 25 04:48:39 2017        
(r327173)
@@ -272,7 +272,6 @@ al_probe(device_t dev)
 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_attach(device_t dev)
        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,

Modified: head/sys/dev/axgbe/xgbe-drv.c
==============================================================================
--- head/sys/dev/axgbe/xgbe-drv.c       Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/axgbe/xgbe-drv.c       Mon Dec 25 04:48:39 2017        
(r327173)
@@ -954,7 +954,7 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, 
        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 @@ read_again:
                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) {

Modified: head/sys/dev/axgbe/xgbe-mdio.c
==============================================================================
--- head/sys/dev/axgbe/xgbe-mdio.c      Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/axgbe/xgbe-mdio.c      Mon Dec 25 04:48:39 2017        
(r327173)
@@ -752,36 +752,30 @@ static void xgbe_an_init(struct xgbe_prv_data *pdata)
 
 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;
        }

Modified: head/sys/dev/e1000/igb_txrx.c
==============================================================================
--- head/sys/dev/e1000/igb_txrx.c       Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/e1000/igb_txrx.c       Mon Dec 25 04:48:39 2017        
(r327173)
@@ -237,7 +237,7 @@ igb_isc_txd_encap(void *arg, if_pkt_info_t pi)
        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 @@ igb_isc_txd_encap(void *arg, if_pkt_info_t pi)
        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 */

Modified: head/sys/dev/extres/clk/clk_bus.c
==============================================================================
--- head/sys/dev/extres/clk/clk_bus.c   Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/extres/clk/clk_bus.c   Mon Dec 25 04:48:39 2017        
(r327173)
@@ -60,11 +60,9 @@ ofw_clkbus_probe(device_t dev)
 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);
 

Modified: head/sys/dev/extres/regulator/regulator_bus.c
==============================================================================
--- head/sys/dev/extres/regulator/regulator_bus.c       Mon Dec 25 04:34:10 
2017        (r327172)
+++ head/sys/dev/extres/regulator/regulator_bus.c       Mon Dec 25 04:48:39 
2017        (r327173)
@@ -58,10 +58,8 @@ ofw_regulator_bus_probe(device_t dev)
 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);
 

Modified: head/sys/dev/fdt/fdt_common.c
==============================================================================
--- head/sys/dev/fdt/fdt_common.c       Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/fdt/fdt_common.c       Mon Dec 25 04:48:39 2017        
(r327173)
@@ -155,7 +155,7 @@ fdt_get_range(phandle_t node, int range_id, u_long *ba
        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 @@ fdt_get_range(phandle_t node, int range_id, u_long *ba
        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 @@ fdt_get_reserved_regions(struct mem_region *mr, int *m
        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 @@ fdt_get_reserved_regions(struct mem_region *mr, int *m
                goto out;
        }
 
-       memory_size = 0;
        tuples = res_len / tuple_size;
        reservep = (pcell_t *)&reserve;
        for (i = 0; i < tuples; i++) {
@@ -662,9 +655,8 @@ fdt_get_mem_regions(struct mem_region *mr, int *mrcnt,
        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;

Modified: head/sys/dev/mii/rdcphy.c
==============================================================================
--- head/sys/dev/mii/rdcphy.c   Mon Dec 25 04:34:10 2017        (r327172)
+++ head/sys/dev/mii/rdcphy.c   Mon Dec 25 04:48:39 2017        (r327173)
@@ -185,11 +185,9 @@ static void
 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;

Modified: head/sys/dev/mmc/host/dwmmc.c
==============================================================================
--- head/sys/dev/mmc/host/dwmmc.c       Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/mmc/host/dwmmc.c       Mon Dec 25 04:48:39 2017        
(r327173)
@@ -751,12 +751,10 @@ static int
 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);

Modified: head/sys/dev/mmc/mmc.c
==============================================================================
--- head/sys/dev/mmc/mmc.c      Mon Dec 25 04:34:10 2017        (r327172)
+++ head/sys/dev/mmc/mmc.c      Mon Dec 25 04:48:39 2017        (r327173)
@@ -1559,17 +1559,14 @@ mmc_host_timing(device_t dev, enum mmc_bus_timing timi
 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",

Modified: head/sys/dev/mmc/mmcsd.c
==============================================================================
--- head/sys/dev/mmc/mmcsd.c    Mon Dec 25 04:34:10 2017        (r327172)
+++ head/sys/dev/mmc/mmcsd.c    Mon Dec 25 04:48:39 2017        (r327173)
@@ -755,11 +755,9 @@ mmcsd_close(struct disk *dp __unused)
 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);

Modified: head/sys/dev/ofw/ofw_bus_subr.c
==============================================================================
--- head/sys/dev/ofw/ofw_bus_subr.c     Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/ofw/ofw_bus_subr.c     Mon Dec 25 04:48:39 2017        
(r327173)
@@ -386,9 +386,8 @@ ofw_bus_search_intrmap(void *intr, int intrsz, void *r
        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 @@ ofw_bus_msimap(phandle_t node, uint16_t pci_rid, phand
 {
        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 @@ ofw_bus_msimap(phandle_t node, uint16_t pci_rid, phand
        }
 
        err = ENOENT;
-       rid = 0;
        mask = 0xffffffff;
        OF_getencprop(node, "msi-map-mask", &mask, sizeof(mask));
 

Modified: head/sys/dev/ofw/ofwpci.c
==============================================================================
--- head/sys/dev/ofw/ofwpci.c   Mon Dec 25 04:34:10 2017        (r327172)
+++ head/sys/dev/ofw/ofwpci.c   Mon Dec 25 04:48:39 2017        (r327173)
@@ -558,10 +558,7 @@ static int
 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,

Modified: head/sys/dev/pci/pci.c
==============================================================================
--- head/sys/dev/pci/pci.c      Mon Dec 25 04:34:10 2017        (r327172)
+++ head/sys/dev/pci/pci.c      Mon Dec 25 04:48:39 2017        (r327173)
@@ -3980,7 +3980,6 @@ pci_rescan_method(device_t dev)
 {
 #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 @@ pci_rescan_method(device_t dev)
        } 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 @@ device_t
 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);
 

Modified: head/sys/dev/pci/pci_pci.c
==============================================================================
--- head/sys/dev/pci/pci_pci.c  Mon Dec 25 04:34:10 2017        (r327172)
+++ head/sys/dev/pci/pci_pci.c  Mon Dec 25 04:48:39 2017        (r327173)
@@ -1241,10 +1241,8 @@ static void
 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 @@ pcib_cfg_save(struct pcib_softc *sc)
 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)

Modified: head/sys/dev/smc/if_smc_fdt.c
==============================================================================
--- head/sys/dev/smc/if_smc_fdt.c       Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/smc/if_smc_fdt.c       Mon Dec 25 04:48:39 2017        
(r327173)
@@ -84,17 +84,8 @@ smc_fdt_probe(device_t dev)
 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

Modified: head/sys/dev/uart/uart_bus_acpi.c
==============================================================================
--- head/sys/dev/uart/uart_bus_acpi.c   Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/uart/uart_bus_acpi.c   Mon Dec 25 04:48:39 2017        
(r327173)
@@ -104,13 +104,11 @@ static int
 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));
        }

Modified: head/sys/dev/uart/uart_dev_pl011.c
==============================================================================
--- head/sys/dev/uart/uart_dev_pl011.c  Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/uart/uart_dev_pl011.c  Mon Dec 25 04:48:39 2017        
(r327173)
@@ -381,10 +381,8 @@ uart_pl011_bus_getsig(struct uart_softc *sc)
 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) {

Modified: head/sys/dev/uart/uart_dev_snps.c
==============================================================================
--- head/sys/dev/uart/uart_dev_snps.c   Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/uart/uart_dev_snps.c   Mon Dec 25 04:48:39 2017        
(r327173)
@@ -110,9 +110,7 @@ UART_FDT_CLASS(compat_data);
 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;
 

Modified: head/sys/dev/usb/controller/dwc_otg_fdt.c
==============================================================================
--- head/sys/dev/usb/controller/dwc_otg_fdt.c   Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/usb/controller/dwc_otg_fdt.c   Mon Dec 25 04:48:39 2017        
(r327173)
@@ -170,7 +170,6 @@ int
 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_detach(device_t dev)
                 */
                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;
        }

Modified: head/sys/dev/usb/controller/ehci.c
==============================================================================
--- head/sys/dev/usb/controller/ehci.c  Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/usb/controller/ehci.c  Mon Dec 25 04:48:39 2017        
(r327173)
@@ -1194,9 +1194,7 @@ ehci_non_isoc_done_sub(struct usb_xfer *xfer)
 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 @@ ehci_non_isoc_done(struct usb_xfer *xfer)
        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 */
 

Modified: head/sys/dev/usb/controller/ohci.c
==============================================================================
--- head/sys/dev/usb/controller/ohci.c  Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/usb/controller/ohci.c  Mon Dec 25 04:48:39 2017        
(r327173)
@@ -2385,7 +2385,6 @@ ohci_xfer_setup(struct usb_setup_params *parm)
 {
        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 @@ ohci_xfer_setup(struct usb_setup_params *parm)
        uint32_t nqh;
        uint32_t n;
 
-       sc = OHCI_BUS2SC(parm->udev->bus);
        xfer = parm->curr_xfer;
 
        parm->hc_max_packet_size = 0x500;

Modified: head/sys/dev/usb/controller/xhci.c
==============================================================================
--- head/sys/dev/usb/controller/xhci.c  Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/usb/controller/xhci.c  Mon Dec 25 04:48:39 2017        
(r327173)
@@ -3714,13 +3714,11 @@ xhci_xfer_setup(struct usb_setup_params *parm)
 {
        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;
 
        /*

Modified: head/sys/dev/usb/storage/umass.c
==============================================================================
--- head/sys/dev/usb/storage/umass.c    Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/usb/storage/umass.c    Mon Dec 25 04:48:39 2017        
(r327173)
@@ -1089,7 +1089,6 @@ static void
 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 @@ umass_init_shuttle(struct umass_softc *sc)
        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]);

Modified: head/sys/dev/usb/usb_dev.c
==============================================================================
--- head/sys/dev/usb/usb_dev.c  Mon Dec 25 04:34:10 2017        (r327172)
+++ head/sys/dev/usb/usb_dev.c  Mon Dec 25 04:48:39 2017        (r327173)
@@ -878,7 +878,7 @@ usb_open(struct cdev *dev, int fflags, int devtype, st
        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 @@ usb_open(struct cdev *dev, int fflags, int devtype, st
        }
 
        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 @@ usb_read(struct cdev *dev, struct uio *uio, int ioflag
        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 @@ usb_read(struct cdev *dev, struct uio *uio, int ioflag
        if (err)
                return (ENXIO);
 
-       fflags = cpd->fflags;
-
        f = refs.rxfifo;
        if (f == NULL) {
                /* should not happen */
@@ -1435,8 +1430,6 @@ usb_read(struct cdev *dev, struct uio *uio, int ioflag
                return (EPERM);
        }
 
-       resid = uio->uio_resid;
-
        mtx_lock(f->priv_mtx);
 
        /* check for permanent read error */
@@ -1536,8 +1529,6 @@ usb_write(struct cdev *dev, struct uio *uio, int iofla
        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 @@ usb_write(struct cdev *dev, struct uio *uio, int iofla
        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);
 

Modified: head/sys/dev/vnic/nic_main.c
==============================================================================
--- head/sys/dev/vnic/nic_main.c        Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/vnic/nic_main.c        Mon Dec 25 04:48:39 2017        
(r327173)
@@ -761,9 +761,6 @@ static void
 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;

Modified: head/sys/dev/vnic/nicvf_main.c
==============================================================================
--- head/sys/dev/vnic/nicvf_main.c      Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/vnic/nicvf_main.c      Mon Dec 25 04:48:39 2017        
(r327173)
@@ -425,7 +425,6 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t 
        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_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t 
                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 */

Modified: head/sys/dev/vnic/nicvf_queues.c
==============================================================================
--- head/sys/dev/vnic/nicvf_queues.c    Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/dev/vnic/nicvf_queues.c    Mon Dec 25 04:48:39 2017        
(r327173)
@@ -1714,13 +1714,12 @@ nicvf_sq_disable(struct nicvf *nic, int qidx)
 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) {

Modified: head/sys/fs/cd9660/cd9660_vfsops.c
==============================================================================
--- head/sys/fs/cd9660/cd9660_vfsops.c  Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/fs/cd9660/cd9660_vfsops.c  Mon Dec 25 04:48:39 2017        
(r327173)
@@ -680,7 +680,6 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, i
        struct iso_node *ip;
        struct buf *bp;
        struct vnode *vp;
-       struct cdev *dev;
        int error;
        struct thread *td;
 
@@ -707,7 +706,6 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, i
         */
 
        imp = VFSTOISOFS(mp);
-       dev = imp->im_dev;
 
        /* Allocate a new vnode/iso_node. */
        if ((error = getnewvnode("isofs", mp, &cd9660_vnodeops, &vp)) != 0) {

Modified: head/sys/fs/nfs/nfs_commonkrpc.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonkrpc.c    Mon Dec 25 04:34:10 2017        
(r327172)
+++ head/sys/fs/nfs/nfs_commonkrpc.c    Mon Dec 25 04:48:39 2017        
(r327173)
@@ -493,7 +493,7 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmo
        uint32_t retseq, retval, slotseq, *tl;
        time_t waituntil;
        int i = 0, j = 0, opcnt, set_sigset = 0, slot;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to