aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kabaev <kan@FreeBSD.org>2017-12-25 04:48:39 +0000
committerAlexander Kabaev <kan@FreeBSD.org>2017-12-25 04:48:39 +0000
commit151ba7933aab5c8edc094715bffd9b97d84d2407 (patch)
tree167df86be6de8b19aed984ed6729a169885f0c33
parent280d15cd0af7a89bbb9703ead1a83a3258fa3495 (diff)
downloadsrc-151ba7933aab5c8edc094715bffd9b97d84d2407.tar.gz
src-151ba7933aab5c8edc094715bffd9b97d84d2407.zip
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
Notes
Notes: svn path=/head/; revision=327173
-rw-r--r--sys/arm/allwinner/aw_wdog.c3
-rw-r--r--sys/arm/allwinner/axp81x.c2
-rw-r--r--sys/arm/allwinner/clk/aw_pll.c4
-rw-r--r--sys/arm/allwinner/if_awg.c4
-rw-r--r--sys/arm/arm/gic.c2
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c10
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_gpio.c3
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_mbox.c4
-rw-r--r--sys/arm64/arm64/gic_v3.c2
-rw-r--r--sys/arm64/arm64/gicv3_its.c6
-rw-r--r--sys/arm64/arm64/machdep.c3
-rw-r--r--sys/arm64/arm64/pmap.c3
-rw-r--r--sys/cam/ata/ata_da.c5
-rw-r--r--sys/cam/scsi/scsi_da.c9
-rw-r--r--sys/cam/scsi/scsi_pass.c2
-rw-r--r--sys/dev/al_eth/al_eth.c3
-rw-r--r--sys/dev/axgbe/xgbe-drv.c5
-rw-r--r--sys/dev/axgbe/xgbe-mdio.c6
-rw-r--r--sys/dev/e1000/igb_txrx.c4
-rw-r--r--sys/dev/extres/clk/clk_bus.c2
-rw-r--r--sys/dev/extres/regulator/regulator_bus.c2
-rw-r--r--sys/dev/fdt/fdt_common.c14
-rw-r--r--sys/dev/mii/rdcphy.c2
-rw-r--r--sys/dev/mmc/host/dwmmc.c2
-rw-r--r--sys/dev/mmc/mmc.c7
-rw-r--r--sys/dev/mmc/mmcsd.c2
-rw-r--r--sys/dev/ofw/ofw_bus_subr.c6
-rw-r--r--sys/dev/ofw/ofwpci.c3
-rw-r--r--sys/dev/pci/pci.c6
-rw-r--r--sys/dev/pci/pci_pci.c6
-rw-r--r--sys/dev/smc/if_smc_fdt.c11
-rw-r--r--sys/dev/uart/uart_bus_acpi.c4
-rw-r--r--sys/dev/uart/uart_dev_pl011.c2
-rw-r--r--sys/dev/uart/uart_dev_snps.c2
-rw-r--r--sys/dev/usb/controller/dwc_otg_fdt.c3
-rw-r--r--sys/dev/usb/controller/ehci.c4
-rw-r--r--sys/dev/usb/controller/ohci.c2
-rw-r--r--sys/dev/usb/controller/xhci.c2
-rw-r--r--sys/dev/usb/storage/umass.c3
-rw-r--r--sys/dev/usb/usb_dev.c14
-rw-r--r--sys/dev/vnic/nic_main.c3
-rw-r--r--sys/dev/vnic/nicvf_main.c2
-rw-r--r--sys/dev/vnic/nicvf_queues.c3
-rw-r--r--sys/fs/cd9660/cd9660_vfsops.c2
-rw-r--r--sys/fs/nfs/nfs_commonkrpc.c7
-rw-r--r--sys/fs/nfs/nfs_commonsubs.c3
-rw-r--r--sys/fs/nfsclient/nfs_clstate.c5
-rw-r--r--sys/fs/nfsserver/nfs_nfsdport.c4
-rw-r--r--sys/fs/nfsserver/nfs_nfsdstate.c3
-rw-r--r--sys/geom/geom_subr.c3
-rw-r--r--sys/geom/raid/g_raid.c2
-rw-r--r--sys/geom/raid/md_ddf.c10
-rw-r--r--sys/geom/raid/md_promise.c3
-rw-r--r--sys/geom/raid/tr_raid5.c2
-rw-r--r--sys/kern/kern_synch.c8
-rw-r--r--sys/kern/link_elf.c8
-rw-r--r--sys/kern/subr_msgbuf.c3
-rw-r--r--sys/kern/subr_sleepqueue.c3
-rw-r--r--sys/kern/subr_witness.c13
-rw-r--r--sys/kern/vfs_aio.c4
-rw-r--r--sys/kern/vfs_subr.c3
-rw-r--r--sys/net/if_ethersubr.c2
-rw-r--r--sys/net/if_gif.c2
-rw-r--r--sys/netinet/tcp_output.c4
-rw-r--r--sys/netinet6/in6_mcast.c3
-rw-r--r--sys/netinet6/in6_src.c5
-rw-r--r--sys/netinet6/mld6.c3
-rw-r--r--sys/netinet6/nd6.c15
-rw-r--r--sys/netinet6/nd6.h2
-rw-r--r--sys/netinet6/nd6_nbr.c8
-rw-r--r--sys/netinet6/raw_ip6.c10
-rw-r--r--sys/netinet6/udp6_usrreq.c6
-rw-r--r--sys/netipsec/key.c5
-rw-r--r--sys/netipsec/xform_ah.c5
-rw-r--r--sys/netipsec/xform_esp.c2
-rw-r--r--sys/netipsec/xform_ipcomp.c3
-rw-r--r--sys/nfs/nfs_fha.c9
-rw-r--r--sys/nlm/nlm_prot_impl.c4
-rw-r--r--sys/opencrypto/crypto.c3
-rw-r--r--sys/opencrypto/cryptosoft.c3
-rw-r--r--sys/rpc/clnt_dg.c8
-rw-r--r--sys/security/mac/mac_syscalls.c2
-rw-r--r--sys/ufs/ffs/ffs_alloc.c2
-rw-r--r--sys/ufs/ffs/ffs_vnops.c2
84 files changed, 68 insertions, 313 deletions
diff --git a/sys/arm/allwinner/aw_wdog.c b/sys/arm/allwinner/aw_wdog.c
index 8ca9b7d34158..af704d183855 100644
--- a/sys/arm/allwinner/aw_wdog.c
+++ b/sys/arm/allwinner/aw_wdog.c
@@ -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);
diff --git a/sys/arm/allwinner/axp81x.c b/sys/arm/allwinner/axp81x.c
index 9693b1007ceb..31942e88d91f 100644
--- a/sys/arm/allwinner/axp81x.c
+++ b/sys/arm/allwinner/axp81x.c
@@ -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)
diff --git a/sys/arm/allwinner/clk/aw_pll.c b/sys/arm/allwinner/clk/aw_pll.c
index fadc13def6ff..254d101918f7 100644
--- a/sys/arm/allwinner/clk/aw_pll.c
+++ b/sys/arm/allwinner/clk/aw_pll.c
@@ -865,7 +865,7 @@ h3_pll1_set_freq(struct aw_pll_sc *sc, uint64_t fin, uint64_t *fout,
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, uint64_t *fout,
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;
diff --git a/sys/arm/allwinner/if_awg.c b/sys/arm/allwinner/if_awg.c
index 81aca029082f..c31b1775a45c 100644
--- a/sys/arm/allwinner/if_awg.c
+++ b/sys/arm/allwinner/if_awg.c
@@ -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");
diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c
index 912c6a5b17f4..5987186b20d3 100644
--- a/sys/arm/arm/gic.c
+++ b/sys/arm/arm/gic.c
@@ -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;
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c b/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c
index 52f3651ee670..d890683c83eb 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c
@@ -1386,9 +1386,6 @@ 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);
@@ -1400,7 +1397,10 @@ bcm2835_cpufreq_set(device_t dev, const struct cf_setting *cf)
{
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_setting *cf)
/* 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);
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_gpio.c b/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
index 23328ac6bc4d..fbe0ac2561cf 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
@@ -1017,7 +1017,7 @@ bcm_gpio_pic_map_fdt(struct bcm_gpio_softc *sc, struct intr_map_data_fdt *daf,
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 intr_map_data_fdt *daf,
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)
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_mbox.c b/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
index f3b5363268ed..0546264c3c87 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
@@ -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);
diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c
index e07dad15b99f..924cf8ce936e 100644
--- a/sys/arm64/arm64/gic_v3.c
+++ b/sys/arm64/arm64/gic_v3.c
@@ -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) {
diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c
index 0191003e4d19..e365e678f0c9 100644
--- a/sys/arm64/arm64/gicv3_its.c
+++ b/sys/arm64/arm64/gicv3_its.c
@@ -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, device_t *pic,
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_desc *desc)
uint64_t target;
uint8_t cmd_type;
u_int size;
- boolean_t error;
- error = FALSE;
cmd_type = desc->cmd_type;
target = ITS_TARGET_NONE;
diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c
index 99938499eaaa..157081d68dd4 100644
--- a/sys/arm64/arm64/machdep.c
+++ b/sys/arm64/arm64/machdep.c
@@ -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);
diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
index f4831b5c34ba..76b07e730902 100644
--- a/sys/arm64/arm64/pmap.c
+++ b/sys/arm64/arm64/pmap.c
@@ -621,7 +621,7 @@ pmap_bootstrap_l2(vm_offset_t l1pt, vm_offset_t va, vm_offset_t l2_start)
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_offset_t l3_start)
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;
diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c
index 21a7f60a7d9c..4e75bc5e2fda 100644
--- a/sys/cam/ata/ata_da.c
+++ b/sys/cam/ata/ata_da.c
@@ -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)) {
/*
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index ac70ae4f9bbd..16085cf8390b 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -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)) {
/*
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index 1e8eeb4b69b9..160f6b118867 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -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:
diff --git a/sys/dev/al_eth/al_eth.c b/sys/dev/al_eth/al_eth.c
index 79523fd189c3..211e55c40fde 100644
--- a/sys/dev/al_eth/al_eth.c
+++ b/sys/dev/al_eth/al_eth.c
@@ -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;
@@ -305,8 +304,6 @@ al_attach(device_t dev)
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);
diff --git a/sys/dev/axgbe/xgbe-drv.c b/sys/dev/axgbe/xgbe-drv.c
index 32a6cfe239c1..81f8f30b927a 100644
--- a/sys/dev/axgbe/xgbe-drv.c
+++ b/sys/dev/axgbe/xgbe-drv.c
@@ -954,7 +954,7 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget)
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) {
diff --git a/sys/dev/axgbe/xgbe-mdio.c b/sys/dev/axgbe/xgbe-mdio.c
index 6967d54da521..850a58e04107 100644
--- a/sys/dev/axgbe/xgbe-mdio.c
+++ b/sys/dev/axgbe/xgbe-mdio.c
@@ -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;
}
diff --git a/sys/dev/e1000/igb_txrx.c b/sys/dev/e1000/igb_txrx.c
index 8a56c64b6c18..1a2f7fbbd41b 100644
--- a/sys/dev/e1000/igb_txrx.c
+++ b/sys/dev/e1000/igb_txrx.c
@@ -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 */
diff --git a/sys/dev/extres/clk/clk_bus.c b/sys/dev/extres/clk/clk_bus.c
index e475736a901c..e083ed0595d4 100644
--- a/sys/dev/extres/clk/clk_bus.c
+++ b/sys/dev/extres/clk/clk_bus.c
@@ -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);
diff --git a/sys/dev/extres/regulator/regulator_bus.c b/sys/dev/extres/regulator/regulator_bus.c
index 5e7f4c92d0e3..bac88904a543 100644
--- a/sys/dev/extres/regulator/regulator_bus.c
+++ b/sys/dev/extres/regulator/regulator_bus.c
@@ -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);
diff --git a/sys/dev/fdt/fdt_common.c b/sys/dev/fdt/fdt_common.c
index d163cac3e67b..be7dd218e5fb 100644
--- a/sys/dev/fdt/fdt_common.c
+++ b/sys/dev/fdt/fdt_common.c
@@ -155,7 +155,7 @@ fdt_get_range(phandle_t node, int range_id, u_long *base, u_long *size)
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 *base, u_long *size)
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 *mrcnt)
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 *mrcnt)
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, uint64_t *memsize)
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;
diff --git a/sys/dev/mii/rdcphy.c b/sys/dev/mii/rdcphy.c
index c03cf550eec6..d7fa8ced4fdb 100644
--- a/sys/dev/mii/rdcphy.c
+++ b/sys/dev/mii/rdcphy.c
@@ -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;
diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c
index cb374a0e240e..80e719686185 100644
--- a/sys/dev/mmc/host/dwmmc.c
+++ b/sys/dev/mmc/host/dwmmc.c
@@ -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);
diff --git a/sys/dev/mmc/mmc.c b/sys/dev/mmc/mmc.c
index b8ddb48f84e3..4c46158b8773 100644
--- a/sys/dev/mmc/mmc.c
+++ b/sys/dev/mmc/mmc.c
@@ -1559,17 +1559,14 @@ mmc_host_timing(device_t dev, enum mmc_bus_timing timing)
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",
diff --git a/sys/dev/mmc/mmcsd.c b/sys/dev/mmc/mmcsd.c
index 03ec0fc0dc9f..530dd27a43bb 100644
--- a/sys/dev/mmc/mmcsd.c
+++ b/sys/dev/mmc/mmcsd.c
@@ -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);
diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c
index c9e0a5f34510..957520bd9778 100644
--- a/sys/dev/ofw/ofw_bus_subr.c
+++ b/sys/dev/ofw/ofw_bus_subr.c
@@ -386,9 +386,8 @@ ofw_bus_search_intrmap(void *intr, int intrsz, void *regs, int physsz,
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, phandle_t *msi_parent,
{
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, phandle_t *msi_parent,
}
err = ENOENT;
- rid = 0;
mask = 0xffffffff;
OF_getencprop(node, "msi-map-mask", &mask, sizeof(mask));
diff --git a/sys/dev/ofw/ofwpci.c b/sys/dev/ofw/ofwpci.c
index 7b52704b79c8..7ebfe4ab86a1 100644
--- a/sys/dev/ofw/ofwpci.c
+++ b/sys/dev/ofw/ofwpci.c
@@ -558,11 +558,8 @@ 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,
res));
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 42cb89547c78..fb2989aa4d19 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -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,12 +4075,10 @@ 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);
PCIB_DECODE_RID(pcib, rid, &busno, &slot, &func);
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c
index 939ff4f0abe0..be5b56bc578a 100644
--- a/sys/dev/pci/pci_pci.c
+++ b/sys/dev/pci/pci_pci.c
@@ -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)
diff --git a/sys/dev/smc/if_smc_fdt.c b/sys/dev/smc/if_smc_fdt.c
index d010f93723ce..baca0bd6113e 100644
--- a/sys/dev/smc/if_smc_fdt.c
+++ b/sys/dev/smc/if_smc_fdt.c
@@ -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
diff --git a/sys/dev/uart/uart_bus_acpi.c b/sys/dev/uart/uart_bus_acpi.c
index b1bb55a3410d..88b1480064f4 100644
--- a/sys/dev/uart/uart_bus_acpi.c
+++ b/sys/dev/uart/uart_bus_acpi.c
@@ -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));
}
diff --git a/sys/dev/uart/uart_dev_pl011.c b/sys/dev/uart/uart_dev_pl011.c
index 7568327d875c..3f232d5f6e8a 100644
--- a/sys/dev/uart/uart_dev_pl011.c
+++ b/sys/dev/uart/uart_dev_pl011.c
@@ -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) {
diff --git a/sys/dev/uart/uart_dev_snps.c b/sys/dev/uart/uart_dev_snps.c
index e83e75182844..a29b805ea9cf 100644
--- a/sys/dev/uart/uart_dev_snps.c
+++ b/sys/dev/uart/uart_dev_snps.c
@@ -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;
diff --git a/sys/dev/usb/controller/dwc_otg_fdt.c b/sys/dev/usb/controller/dwc_otg_fdt.c
index b33184c97214..c333aa98add7 100644
--- a/sys/dev/usb/controller/dwc_otg_fdt.c
+++ b/sys/dev/usb/controller/dwc_otg_fdt.c
@@ -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;
}
diff --git a/sys/dev/usb/controller/ehci.c b/sys/dev/usb/controller/ehci.c
index 4229d96ab204..aa1f9b31b4d2 100644
--- a/sys/dev/usb/controller/ehci.c
+++ b/sys/dev/usb/controller/ehci.c
@@ -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",
@@ -1216,8 +1214,6 @@ ehci_non_isoc_done(struct usb_xfer *xfer)
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;
diff --git a/sys/dev/usb/controller/ohci.c b/sys/dev/usb/controller/ohci.c
index ae9ae4488b89..dffa3676cb7d 100644
--- a/sys/dev/usb/controller/ohci.c
+++ b/sys/dev/usb/controller/ohci.c
@@ -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;
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c
index 12ecdefffd81..ac4916700e12 100644
--- a/sys/dev/usb/controller/xhci.c
+++ b/sys/dev/usb/controller/xhci.c
@@ -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;
/*
diff --git a/sys/dev/usb/storage/umass.c b/sys/dev/usb/storage/umass.c
index 3dd3bfa4b3df..cfd2ba174b41 100644
--- a/sys/dev/usb/storage/umass.c
+++ b/sys/dev/usb/storage/umass.c
@@ -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]);
diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c
index 206d0ec3c716..72c75dcd2468 100644
--- a/sys/dev/usb/usb_dev.c
+++ b/sys/dev/usb/usb_dev.c
@@ -878,7 +878,7 @@ usb_open(struct cdev *dev, int fflags, int devtype, struct thread *td)
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, struct thread *td)
}
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 ioflag)
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 ioflag)
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);
diff --git a/sys/dev/vnic/nic_main.c b/sys/dev/vnic/nic_main.c
index 9391e6a702b9..8e6aa60f6ca8 100644
--- a/sys/dev/vnic/nic_main.c
+++ b/sys/dev/vnic/nic_main.c
@@ -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;
diff --git a/sys/dev/vnic/nicvf_main.c b/sys/dev/vnic/nicvf_main.c
index 5e6cf9e6884a..19ea5bcdb7e5 100644
--- a/sys/dev/vnic/nicvf_main.c
+++ b/sys/dev/vnic/nicvf_main.c
@@ -425,7 +425,6 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
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 data)
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 */
diff --git a/sys/dev/vnic/nicvf_queues.c b/sys/dev/vnic/nicvf_queues.c
index 7a1dda8f3570..d469067c1cf8 100644
--- a/sys/dev/vnic/nicvf_queues.c
+++ b/sys/dev/vnic/nicvf_queues.c
@@ -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) {
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c
index 5d0e8348a3fb..a5a2ec65659d 100644
--- a/sys/fs/cd9660/cd9660_vfsops.c
+++ b/sys/fs/cd9660/cd9660_vfsops.c
@@ -680,7 +680,6 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir)
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, isodir)
*/
imp = VFSTOISOFS(mp);
- dev = imp->im_dev;
/* Allocate a new vnode/iso_node. */
if ((error = getnewvnode("isofs", mp, &cd9660_vnodeops, &vp)) != 0) {
diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c
index a2915fbff022..f5aee810173a 100644
--- a/sys/fs/nfs/nfs_commonkrpc.c
+++ b/sys/fs/nfs/nfs_commonkrpc.c
@@ -493,7 +493,7 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp,
uint32_t retseq, retval, slotseq, *tl;
time_t waituntil;
int i = 0, j = 0, opcnt, set_sigset = 0, slot;
- int trycnt, error = 0, usegssname = 0, secflavour = AUTH_SYS;
+ int error = 0, usegssname = 0, secflavour = AUTH_SYS;
int freeslot, maxslot, reterr, slotpos, timeo;
u_int16_t procnum;
u_int trylater_delay = 1;
@@ -702,7 +702,6 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp,
}
#endif
}
- trycnt = 0;
freeslot = -1; /* Set to slot that needs to be free'd */
tryagain:
slot = -1; /* Slot that needs a sequence# increment. */
@@ -1229,8 +1228,7 @@ newnfs_msleep(struct thread *td, void *ident, struct mtx *mtx, int priority, cha
{
sigset_t oldset;
int error;
- struct proc *p;
-
+
if ((priority & PCATCH) == 0)
return msleep(ident, mtx, priority, wmesg, timo);
if (td == NULL)
@@ -1238,7 +1236,6 @@ newnfs_msleep(struct thread *td, void *ident, struct mtx *mtx, int priority, cha
newnfs_set_sigmask(td, &oldset);
error = msleep(ident, mtx, priority, wmesg, timo);
newnfs_restore_sigmask(td, &oldset);
- p = td->td_proc;
return (error);
}
diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c
index 1856b98d744f..7d47a70ef89f 100644
--- a/sys/fs/nfs/nfs_commonsubs.c
+++ b/sys/fs/nfs/nfs_commonsubs.c
@@ -487,7 +487,7 @@ nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, int size, int set_true)
{
u_int32_t *tl;
u_int8_t *cp;
- int fullsiz, rem, bytesize = 0;
+ int fullsiz, bytesize = 0;
if (size == 0)
size = NFSX_MYFH;
@@ -504,7 +504,6 @@ nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, int size, int set_true)
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);
diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c
index 8f4281accad2..ff04cde0ac9f 100644
--- a/sys/fs/nfsclient/nfs_clstate.c
+++ b/sys/fs/nfsclient/nfs_clstate.c
@@ -4116,7 +4116,6 @@ nfscl_relock(vnode_t vp, struct nfsclclient *clp, struct nfsmount *nmp,
struct nfscllockowner *nlp;
struct nfsfh *nfhp;
u_int64_t off, len;
- u_int32_t clidrev = 0;
int error, newone, donelocally;
off = lop->nfslo_first;
@@ -4126,10 +4125,6 @@ nfscl_relock(vnode_t vp, struct nfsclclient *clp, struct nfsmount *nmp,
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,
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
index 81ab56659459..604ca1970c6d 100644
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -347,7 +347,7 @@ nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp,
struct iovec aiov;
struct uio auio;
int lockleaf = (cnp->cn_flags & LOCKLEAF) != 0, linklen;
- int error = 0, crossmnt;
+ int error = 0;
char *cp;
*retdirp = NULL;
@@ -372,7 +372,6 @@ nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp,
if (NFSVNO_EXRDONLY(exp))
cnp->cn_flags |= RDONLY;
ndp->ni_segflg = UIO_SYSSPACE;
- crossmnt = 1;
if (nd->nd_flag & ND_PUBLOOKUP) {
ndp->ni_loopcnt = 0;
@@ -400,7 +399,6 @@ nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp,
* the mount point, unless nfsrv_enable_crossmntpt is set.
*/
cnp->cn_flags |= NOCROSSMOUNT;
- crossmnt = 0;
}
/*
diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c
index 94c3cf4f05aa..06d08518a195 100644
--- a/sys/fs/nfsserver/nfs_nfsdstate.c
+++ b/sys/fs/nfsserver/nfs_nfsdstate.c
@@ -3267,7 +3267,7 @@ APPLESTATIC int
nfsrv_openupdate(vnode_t vp, struct nfsstate *new_stp, nfsquad_t clientid,
nfsv4stateid_t *stateidp, struct nfsrv_descript *nd, NFSPROC_T *p)
{
- struct nfsstate *stp, *ownerstp;
+ struct nfsstate *stp;
struct nfsclient *clp;
struct nfslockfile *lfp;
u_int32_t bits;
@@ -3366,7 +3366,6 @@ nfsrv_openupdate(vnode_t vp, struct nfsstate *new_stp, nfsquad_t clientid,
}
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 */
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index 3bc2eb6f2d92..b74f9293ee8e 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -876,7 +876,7 @@ int
g_access(struct g_consumer *cp, int dcr, int dcw, int dce)
{
struct g_provider *pp;
- int pr,pw,pe;
+ int pw, pe;
int error;
g_topology_assert();
@@ -907,7 +907,6 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int dce)
* 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;
diff --git a/sys/geom/raid/g_raid.c b/sys/geom/raid/g_raid.c
index f6d347e53ab3..46748bba15cf 100644
--- a/sys/geom/raid/g_raid.c
+++ b/sys/geom/raid/g_raid.c
@@ -955,7 +955,6 @@ g_raid_dirty(struct g_raid_volume *vol)
void
g_raid_tr_flush_common(struct g_raid_tr_object *tr, struct bio *bp)
{
- struct g_raid_softc *sc;
struct g_raid_volume *vol;
struct g_raid_subdisk *sd;
struct bio_queue_head queue;
@@ -963,7 +962,6 @@ g_raid_tr_flush_common(struct g_raid_tr_object *tr, struct bio *bp)
int i;
vol = tr->tro_volume;
- sc = vol->v_softc;
/*
* Allocate all bios before sending any request, so we can return
diff --git a/sys/geom/raid/md_ddf.c b/sys/geom/raid/md_ddf.c
index 5b1c7f0b88dc..05e24ed06e6c 100644
--- a/sys/geom/raid/md_ddf.c
+++ b/sys/geom/raid/md_ddf.c
@@ -757,10 +757,8 @@ ddf_meta_create(struct g_raid_disk *disk, struct ddf_meta *sample)
static void
ddf_meta_copy(struct ddf_meta *dst, struct ddf_meta *src)
{
- struct ddf_header *hdr;
u_int ss;
- hdr = src->hdr;
dst->bigendian = src->bigendian;
ss = dst->sectorsize = src->sectorsize;
dst->hdr = malloc(ss, M_MD_DDF, M_WAITOK);
@@ -845,10 +843,8 @@ ddf_vol_meta_create(struct ddf_vol_meta *meta, struct ddf_meta *sample)
{
struct timespec ts;
struct clocktime ct;
- struct ddf_header *hdr;
u_int ss, size;
- hdr = sample->hdr;
meta->bigendian = sample->bigendian;
ss = meta->sectorsize = sample->sectorsize;
meta->hdr = malloc(ss, M_MD_DDF, M_WAITOK);
@@ -874,13 +870,11 @@ static void
ddf_vol_meta_update(struct ddf_vol_meta *dst, struct ddf_meta *src,
uint8_t *GUID, int started)
{
- struct ddf_header *hdr;
struct ddf_vd_entry *vde;
struct ddf_vdc_record *vdc;
int vnew, bvnew, bvd, size;
u_int ss;
- hdr = src->hdr;
vde = &src->vdr->entry[ddf_meta_find_vd(src, GUID)];
vdc = ddf_meta_find_vdc(src, GUID);
if (GET8D(src, vdc->Secondary_Element_Count) == 1)
@@ -1427,12 +1421,10 @@ static int
g_raid_md_ddf_purge_volumes(struct g_raid_softc *sc)
{
struct g_raid_volume *vol, *tvol;
- struct g_raid_md_ddf_pervolume *pv;
int i, res;
res = 0;
TAILQ_FOREACH_SAFE(vol, &sc->sc_volumes, v_next, tvol) {
- pv = vol->v_md_data;
if (vol->v_stopping)
continue;
for (i = 0; i < vol->v_disks_count; i++) {
@@ -1866,7 +1858,6 @@ g_raid_md_ddf_start(struct g_raid_volume *vol)
struct g_raid_md_ddf_pervolume *pv;
struct g_raid_md_ddf_object *mdi;
struct ddf_vol_meta *vmeta;
- struct ddf_vdc_record *vdc;
uint64_t *val2;
int i, j, bvd;
@@ -1875,7 +1866,6 @@ g_raid_md_ddf_start(struct g_raid_volume *vol)
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);
diff --git a/sys/geom/raid/md_promise.c b/sys/geom/raid/md_promise.c
index ab5e6ccb631a..edbcd074184f 100644
--- a/sys/geom/raid/md_promise.c
+++ b/sys/geom/raid/md_promise.c
@@ -1100,7 +1100,7 @@ g_raid_md_taste_promise(struct g_raid_md_object *md, struct g_class *mp,
struct g_provider *pp;
struct g_raid_softc *sc;
struct g_raid_disk *disk;
- struct promise_raid_conf *meta, *metaarr[4];
+ struct promise_raid_conf *metaarr[4];
struct g_raid_md_promise_perdisk *pd;
struct g_geom *geom;
int i, j, result, len, subdisks;
@@ -1111,7 +1111,6 @@ g_raid_md_taste_promise(struct g_raid_md_object *md, struct g_class *mp,
pp = cp->provider;
/* Read metadata from device. */
- meta = NULL;
g_topology_unlock();
vendor = 0xffff;
len = sizeof(vendor);
diff --git a/sys/geom/raid/tr_raid5.c b/sys/geom/raid/tr_raid5.c
index 49c90da2a9e6..3ff8f81cc3ac 100644
--- a/sys/geom/raid/tr_raid5.c
+++ b/sys/geom/raid/tr_raid5.c
@@ -344,10 +344,8 @@ static void
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;
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 94ca92380946..8384ad991480 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -131,14 +131,12 @@ _sleep(void *ident, struct lock_object *lock, int priority,
const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags)
{
struct thread *td;
- struct proc *p;
struct lock_class *class;
uintptr_t lock_state;
int catch, pri, rval, sleepq_flags;
WITNESS_SAVE_DECL(lock_witness);
td = curthread;
- p = td->td_proc;
#ifdef KTRACE
if (KTRPOINT(td, KTR_CSW))
ktrcsw(1, 0, wmesg);
@@ -177,7 +175,7 @@ _sleep(void *ident, struct lock_object *lock, int priority,
sleepq_lock(ident);
CTR5(KTR_PROC, "sleep: thread %ld (pid %ld, %s) on %s (%p)",
- td->td_tid, p->p_pid, td->td_name, wmesg, ident);
+ td->td_tid, td->td_proc->p_pid, td->td_name, wmesg, ident);
if (lock == &Giant.lock_object)
mtx_assert(&Giant, MA_OWNED);
@@ -235,12 +233,10 @@ msleep_spin_sbt(void *ident, struct mtx *mtx, const char *wmesg,
sbintime_t sbt, sbintime_t pr, int flags)
{
struct thread *td;
- struct proc *p;
int rval;
WITNESS_SAVE_DECL(mtx);
td = curthread;
- p = td->td_proc;
KASSERT(mtx != NULL, ("sleeping without a mutex"));
KASSERT(ident != NULL, ("msleep_spin_sbt: NULL ident"));
KASSERT(TD_IS_RUNNING(td), ("msleep_spin_sbt: curthread not running"));
@@ -250,7 +246,7 @@ msleep_spin_sbt(void *ident, struct mtx *mtx, const char *wmesg,
sleepq_lock(ident);
CTR5(KTR_PROC, "msleep_spin: thread %ld (pid %ld, %s) on %s (%p)",
- td->td_tid, p->p_pid, td->td_name, wmesg, ident);
+ td->td_tid, td->td_proc->p_pid, td->td_name, wmesg, ident);
DROP_GIANT();
mtx_assert(mtx, MA_OWNED | MA_NOTRECURSED);
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index f645ceb88d85..3977ab1e0821 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -767,10 +767,8 @@ link_elf_load_file(linker_class_t cls, const char* filename,
Elf_Phdr *segs[MAXSEGS];
int nsegs;
Elf_Phdr *phdyn;
- Elf_Phdr *phphdr;
caddr_t mapbase;
size_t mapsize;
- Elf_Off base_offset;
Elf_Addr base_vaddr;
Elf_Addr base_vlimit;
int error = 0;
@@ -869,7 +867,6 @@ link_elf_load_file(linker_class_t cls, const char* filename,
phlimit = phdr + hdr->e_phnum;
nsegs = 0;
phdyn = NULL;
- phphdr = NULL;
while (phdr < phlimit) {
switch (phdr->p_type) {
case PT_LOAD:
@@ -885,10 +882,6 @@ link_elf_load_file(linker_class_t cls, const char* filename,
++nsegs;
break;
- case PT_PHDR:
- phphdr = phdr;
- break;
-
case PT_DYNAMIC:
phdyn = phdr;
break;
@@ -916,7 +909,6 @@ link_elf_load_file(linker_class_t cls, const char* filename,
* 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);
diff --git a/sys/kern/subr_msgbuf.c b/sys/kern/subr_msgbuf.c
index 0231fe074d59..883cf2a78f63 100644
--- a/sys/kern/subr_msgbuf.c
+++ b/sys/kern/subr_msgbuf.c
@@ -187,11 +187,10 @@ msgbuf_addstr(struct msgbuf *mbp, int pri, char *str, int filter_cr)
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)
diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c
index c2ad80fd2541..48edcc359b84 100644
--- a/sys/kern/subr_sleepqueue.c
+++ b/sys/kern/subr_sleepqueue.c
@@ -1141,11 +1141,10 @@ sleepq_sbuf_print_stacks(struct sbuf *sb, void *wchan, int queue,
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));
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index 4959cf3dc616..4f4716e58faf 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -1806,7 +1806,6 @@ static struct witness *
enroll(const char *description, struct lock_class *lock_class)
{
struct witness *w;
- struct witness_list *typelist;
MPASS(description != NULL);
@@ -1815,11 +1814,7 @@ enroll(const char *description, struct lock_class *lock_class)
if ((lock_class->lc_flags & LC_SPINLOCK)) {
if (witness_skipspin)
return (NULL);
- else
- typelist = &w_spin;
- } else if ((lock_class->lc_flags & LC_SLEEPLOCK)) {
- typelist = &w_sleep;
- } else {
+ } else if ((lock_class->lc_flags & LC_SLEEPLOCK) == 0) {
kassert_panic("lock class %s is not sleep or spin",
lock_class->lc_name);
return (NULL);
@@ -1865,14 +1860,11 @@ found:
static void
depart(struct witness *w)
{
- struct witness_list *list;
MPASS(w->w_refcount == 0);
if (w->w_class->lc_flags & LC_SLEEPLOCK) {
- list = &w_sleep;
w_sleep_cnt--;
} else {
- list = &w_spin;
w_spin_cnt--;
}
/*
@@ -2546,7 +2538,6 @@ sbuf_print_witness_badstacks(struct sbuf *sb, size_t *oldidx)
{
struct witness_lock_order_data *data1, *data2, *tmp_data1, *tmp_data2;
struct witness *tmp_w1, *tmp_w2, *w1, *w2;
- u_int w_rmatrix1, w_rmatrix2;
int generation, i, j;
tmp_data1 = NULL;
@@ -2616,8 +2607,6 @@ restart:
* 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);
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index e34c2a96683f..817a0d71641f 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -963,7 +963,6 @@ aio_schedule_fsync(void *context, int pending)
bool
aio_cancel_cleared(struct kaiocb *job)
{
- struct kaioinfo *ki;
/*
* The caller should hold the same queue lock held when
@@ -971,7 +970,6 @@ aio_cancel_cleared(struct kaiocb *job)
* ensuring this check sees an up-to-date value. However,
* there is no way to assert that.
*/
- ki = job->userproc->p_aioinfo;
return ((job->jobflags & KAIOCB_CLEARED) != 0);
}
@@ -1692,7 +1690,6 @@ aio_cancel_sync(struct kaiocb *job)
int
aio_queue_file(struct file *fp, struct kaiocb *job)
{
- struct aioliojob *lj;
struct kaioinfo *ki;
struct kaiocb *job2;
struct vnode *vp;
@@ -1700,7 +1697,6 @@ aio_queue_file(struct file *fp, struct kaiocb *job)
int error, opcode;
bool safe;
- lj = job->lio;
ki = job->userproc->p_aioinfo;
opcode = job->uaiocb.aio_lio_opcode;
if (opcode == LIO_SYNC)
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index ed0a1942fe15..6790fc7ddca5 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1133,7 +1133,7 @@ static void
vnlru_proc(void)
{
struct mount *mp, *nmp;
- unsigned long ofreevnodes, onumvnodes;
+ unsigned long onumvnodes;
int done, force, reclaim_nc_src, trigger, usevnodes;
EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, vnlruproc,
@@ -1170,7 +1170,6 @@ vnlru_proc(void)
}
mtx_unlock(&vnode_free_list_mtx);
done = 0;
- ofreevnodes = freevnodes;
onumvnodes = numvnodes;
/*
* Calculate parameters for recycling. These are the same
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 455a507973ed..8f280055da83 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -290,7 +290,6 @@ ether_output(struct ifnet *ifp, struct mbuf *m,
int hlen; /* link layer header length */
uint32_t pflags;
struct llentry *lle = NULL;
- struct rtentry *rt0 = NULL;
int addref = 0;
phdr = NULL;
@@ -320,7 +319,6 @@ ether_output(struct ifnet *ifp, struct mbuf *m,
pflags = lle->r_flags;
}
}
- rt0 = ro->ro_rt;
}
#ifdef MAC
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index 38c1182cd118..0d738c598be8 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -520,7 +520,6 @@ gif_input(struct mbuf *m, struct ifnet *ifp, int proto, uint8_t ecn)
struct ip6_hdr *ip6;
uint32_t t;
#endif
- struct gif_softc *sc;
struct ether_header *eh;
struct ifnet *oldifp;
int isr, n, af;
@@ -530,7 +529,6 @@ gif_input(struct mbuf *m, struct ifnet *ifp, int proto, uint8_t ecn)
m_freem(m);
return;
}
- sc = ifp->if_softc;
m->m_pkthdr.rcvif = ifp;
m_clrprotoflags(m);
switch (proto) {
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index 0ef64cbaef3b..66fe00d5a227 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -198,7 +198,9 @@ tcp_output(struct tcpcb *tp)
int off, flags, error = 0; /* Keep compiler happy */
struct mbuf *m;
struct ip *ip = NULL;
+#ifdef TCPDEBUG
struct ipovly *ipov = NULL;
+#endif
struct tcphdr *th;
u_char opt[TCP_MAXOLEN];
unsigned ipoptlen, optlen, hdrlen;
@@ -1091,7 +1093,9 @@ send:
#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);
}
diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c
index a0efcc833685..2d37ba9802b4 100644
--- a/sys/netinet6/in6_mcast.c
+++ b/sys/netinet6/in6_mcast.c
@@ -1238,11 +1238,8 @@ out_in6m_release:
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();
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
index bd4b5dee0c4e..7b3b5553c2e8 100644
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -160,7 +160,6 @@ static struct in6_addrpolicy *match_addrsel_policy(struct sockaddr_in6 *);
*/
#define REPLACE(r) do {\
IP6STAT_INC(ip6s_sources_rule[(r)]); \
- rule = (r); \
/* { \
char ip6buf[INET6_ADDRSTRLEN], ip6b[INET6_ADDRSTRLEN]; \
printf("in6_selectsrc: replace %s with %s by %d\n", ia_best ? ip6_sprintf(ip6buf, &ia_best->ia_addr.sin6_addr) : "none", ip6_sprintf(ip6b, &ia->ia_addr.sin6_addr), (r)); \
@@ -176,7 +175,6 @@ static struct in6_addrpolicy *match_addrsel_policy(struct sockaddr_in6 *);
} while(0)
#define BREAK(r) do { \
IP6STAT_INC(ip6s_sources_rule[(r)]); \
- rule = (r); \
goto out; /* XXX: we can't use 'break' here */ \
} while(0)
@@ -194,7 +192,7 @@ in6_selectsrc(uint32_t fibnum, struct sockaddr_in6 *dstsock,
struct in6_addrpolicy *dst_policy = NULL, *best_policy = NULL;
u_int32_t odstzone;
int prefer_tempaddr;
- int error, rule;
+ int error;
struct ip6_moptions *mopts;
KASSERT(srcp != NULL, ("%s: srcp is NULL", __func__));
@@ -310,7 +308,6 @@ in6_selectsrc(uint32_t fibnum, struct sockaddr_in6 *dstsock,
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;
diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c
index 37d6c3196a39..805a9f429cb7 100644
--- a/sys/netinet6/mld6.c
+++ b/sys/netinet6/mld6.c
@@ -2286,7 +2286,7 @@ mld_v2_enqueue_group_record(struct mbufq *mq, struct in6_multi *inm,
struct ifnet *ifp;
struct ip6_msource *ims, *nims;
struct mbuf *m0, *m, *md;
- int error, is_filter_list_change;
+ int is_filter_list_change;
int minrec0len, m0srcs, msrcs, nbytes, off;
int record_has_sources;
int now;
@@ -2298,7 +2298,6 @@ mld_v2_enqueue_group_record(struct mbufq *mq, struct in6_multi *inm,
IN6_MULTI_LOCK_ASSERT();
- error = 0;
ifp = inm->in6m_ifp;
is_filter_list_change = 0;
m = NULL;
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 4c5986330451..df4400b49d48 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -2113,7 +2113,7 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr,
LLE_RUNLOCK(ln);
if (chain != NULL)
- nd6_flush_holdchain(ifp, ifp, chain, &sin6);
+ nd6_flush_holdchain(ifp, chain, &sin6);
/*
* When the link-layer address of a router changes, select the
@@ -2502,23 +2502,18 @@ nd6_resolve_addr(struct ifnet *ifp, int flags, const struct sockaddr *dst,
}
int
-nd6_flush_holdchain(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *chain,
+nd6_flush_holdchain(struct ifnet *ifp, struct mbuf *chain,
struct sockaddr_in6 *dst)
{
struct mbuf *m, *m_head;
- struct ifnet *outifp;
int error = 0;
m_head = chain;
- if ((ifp->if_flags & IFF_LOOPBACK) != 0)
- outifp = origifp;
- else
- outifp = ifp;
-
+
while (m_head) {
m = m_head;
m_head = m_head->m_nextpkt;
- error = nd6_output_ifp(ifp, origifp, m, dst, NULL);
+ error = nd6_output_ifp(ifp, ifp, m, dst, NULL);
}
/*
@@ -2526,7 +2521,7 @@ nd6_flush_holdchain(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *chain
* note that intermediate errors are blindly ignored
*/
return (error);
-}
+}
static int
nd6_need_cache(struct ifnet *ifp)
diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h
index 30990637cc21..cabfeec0dbac 100644
--- a/sys/netinet6/nd6.h
+++ b/sys/netinet6/nd6.h
@@ -448,7 +448,7 @@ void nd6_cache_lladdr(struct ifnet *, struct in6_addr *,
char *, int, int, int);
void nd6_grab_holdchain(struct llentry *, struct mbuf **,
struct sockaddr_in6 *);
-int nd6_flush_holdchain(struct ifnet *, struct ifnet *, struct mbuf *,
+int nd6_flush_holdchain(struct ifnet *, struct mbuf *,
struct sockaddr_in6 *);
int nd6_add_ifa_lle(struct in6_ifaddr *);
void nd6_rem_ifa_lle(struct in6_ifaddr *, int);
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index 6766e1b80004..786f6bdbfd54 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -894,7 +894,7 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len)
LLE_WUNLOCK(ln);
if (chain != NULL)
- nd6_flush_holdchain(ifp, ifp, chain, &sin6);
+ nd6_flush_holdchain(ifp, chain, &sin6);
if (checklink)
pfxlist_onlink_check();
@@ -1515,17 +1515,11 @@ nd6_dad_ns_output(struct dadq *dp)
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;
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index 0cd7c5c93ec2..b27b99098d36 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -339,9 +339,6 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
void
rip6_ctlinput(int cmd, struct sockaddr *sa, void *d)
{
- struct ip6_hdr *ip6;
- struct mbuf *m;
- int off = 0;
struct ip6ctlparam *ip6cp = NULL;
const struct sockaddr_in6 *sa6_src = NULL;
void *cmdarg;
@@ -365,14 +362,9 @@ rip6_ctlinput(int cmd, struct sockaddr *sa, void *d)
*/
if (d != NULL) {
ip6cp = (struct ip6ctlparam *)d;
- m = ip6cp->ip6c_m;
- ip6 = ip6cp->ip6c_ip6;
- off = ip6cp->ip6c_off;
cmdarg = ip6cp->ip6c_cmdarg;
sa6_src = ip6cp->ip6c_src;
} else {
- m = NULL;
- ip6 = NULL;
cmdarg = NULL;
sa6_src = &sa6_any;
}
@@ -391,7 +383,6 @@ rip6_output(struct mbuf *m, struct socket *so, ...)
struct mbuf *control;
struct m_tag *mtag;
struct sockaddr_in6 *dstsock;
- struct in6_addr *dst;
struct ip6_hdr *ip6;
struct inpcb *in6p;
u_int plen = m->m_pkthdr.len;
@@ -413,7 +404,6 @@ rip6_output(struct mbuf *m, struct socket *so, ...)
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,
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index 1c14bf55157c..a8afdf59d178 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -1190,7 +1190,6 @@ udp6_disconnect(struct socket *so)
{
struct inpcb *inp;
struct inpcbinfo *pcbinfo;
- int error;
pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
@@ -1212,8 +1211,8 @@ udp6_disconnect(struct socket *so)
#endif
if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) {
- error = ENOTCONN;
- goto out;
+ INP_WUNLOCK(inp);
+ return (ENOTCONN);
}
INP_HASH_WLOCK(pcbinfo);
@@ -1223,7 +1222,6 @@ udp6_disconnect(struct socket *so)
SOCK_LOCK(so);
so->so_state &= ~SS_ISCONNECTED; /* XXX */
SOCK_UNLOCK(so);
-out:
INP_WUNLOCK(inp);
return (0);
}
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index cf198547509c..1fd0e8e6c11b 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -5744,7 +5744,6 @@ static int
key_setident(struct secashead *sah, const struct sadb_msghdr *mhp)
{
const struct sadb_ident *idsrc, *iddst;
- int idsrclen, iddstlen;
IPSEC_ASSERT(sah != NULL, ("null secashead"));
IPSEC_ASSERT(mhp != NULL, ("null msghdr"));
@@ -5766,8 +5765,6 @@ key_setident(struct secashead *sah, const struct sadb_msghdr *mhp)
idsrc = (const struct sadb_ident *)mhp->ext[SADB_EXT_IDENTITY_SRC];
iddst = (const struct sadb_ident *)mhp->ext[SADB_EXT_IDENTITY_DST];
- idsrclen = mhp->extlen[SADB_EXT_IDENTITY_SRC];
- iddstlen = mhp->extlen[SADB_EXT_IDENTITY_DST];
/* validity check */
if (idsrc->sadb_ident_type != iddst->sadb_ident_type) {
@@ -7464,7 +7461,6 @@ key_dump(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp)
SAHTREE_RLOCK_TRACKER;
struct secashead *sah;
struct secasvar *sav;
- struct sadb_msg *newmsg;
struct mbuf *n;
uint32_t cnt;
uint8_t proto, satype;
@@ -7501,7 +7497,6 @@ key_dump(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp)
}
/* 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)
diff --git a/sys/netipsec/xform_ah.c b/sys/netipsec/xform_ah.c
index 5d8c62bb7ff8..d6100b6838ad 100644
--- a/sys/netipsec/xform_ah.c
+++ b/sys/netipsec/xform_ah.c
@@ -685,9 +685,7 @@ ah_input_cb(struct cryptop *crp)
{
IPSEC_DEBUG_DECLARE(char buf[IPSEC_ADDRSTRLEN]);
unsigned char calc[AH_ALEN_MAX];
- const struct auth_hash *ahx;
struct mbuf *m;
- struct cryptodesc *crd;
struct xform_data *xd;
struct secasvar *sav;
struct secasindex *saidx;
@@ -696,7 +694,6 @@ ah_input_cb(struct cryptop *crp)
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;
@@ -709,8 +706,6 @@ ah_input_cb(struct cryptop *crp)
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) {
diff --git a/sys/netipsec/xform_esp.c b/sys/netipsec/xform_esp.c
index 02064a909d4b..7eaaab6ae3cb 100644
--- a/sys/netipsec/xform_esp.c
+++ b/sys/netipsec/xform_esp.c
@@ -441,7 +441,6 @@ esp_input_cb(struct cryptop *crp)
IPSEC_DEBUG_DECLARE(char buf[128]);
u_int8_t lastthree[3], aalg[AH_HMAC_MAXHASHLEN];
const struct auth_hash *esph;
- const struct enc_xform *espx;
struct mbuf *m;
struct cryptodesc *crd;
struct xform_data *xd;
@@ -462,7 +461,6 @@ esp_input_cb(struct cryptop *crp)
cryptoid = xd->cryptoid;
saidx = &sav->sah->saidx;
esph = sav->tdb_authalgxform;
- espx = sav->tdb_encalgxform;
/* Check for crypto errors */
if (crp->crp_etype) {
diff --git a/sys/netipsec/xform_ipcomp.c b/sys/netipsec/xform_ipcomp.c
index cfbb78728c74..d5f60b7e2147 100644
--- a/sys/netipsec/xform_ipcomp.c
+++ b/sys/netipsec/xform_ipcomp.c
@@ -274,7 +274,6 @@ static int
ipcomp_input_cb(struct cryptop *crp)
{
IPSEC_DEBUG_DECLARE(char buf[IPSEC_ADDRSTRLEN]);
- struct cryptodesc *crd;
struct xform_data *xd;
struct mbuf *m;
struct secasvar *sav;
@@ -285,8 +284,6 @@ ipcomp_input_cb(struct cryptop *crp)
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;
diff --git a/sys/nfs/nfs_fha.c b/sys/nfs/nfs_fha.c
index 9a534b025394..8c5c144d2501 100644
--- a/sys/nfs/nfs_fha.c
+++ b/sys/nfs/nfs_fha.c
@@ -225,11 +225,9 @@ fha_hash_entry_remove(struct fha_hash_entry *e)
static struct fha_hash_entry *
fha_hash_entry_lookup(struct fha_params *softc, u_int64_t fh)
{
- SVCPOOL *pool;
struct fha_hash_slot *fhs;
struct fha_hash_entry *fhe, *new_fhe;
- pool = *softc->pool;
fhs = &softc->fha_hash[fh % FHA_HASH_SIZE];
new_fhe = fha_hash_entry_new(fh);
new_fhe->mtx = &fhs->mtx;
@@ -289,12 +287,9 @@ fha_hash_entry_choose_thread(struct fha_params *softc,
struct fha_hash_entry *fhe, struct fha_info *i, SVCTHREAD *this_thread)
{
SVCTHREAD *thread, *min_thread = NULL;
- SVCPOOL *pool;
int req_count, min_count = 0;
off_t offset1, offset2;
- pool = *softc->pool;
-
LIST_FOREACH(thread, &fhe->threads, st_alink) {
req_count = thread->st_p2;
@@ -475,17 +470,13 @@ fhe_stats_sysctl(SYSCTL_HANDLER_ARGS, struct fha_params *softc)
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))
diff --git a/sys/nlm/nlm_prot_impl.c b/sys/nlm/nlm_prot_impl.c
index 0f9c4d485ac2..56818c122634 100644
--- a/sys/nlm/nlm_prot_impl.c
+++ b/sys/nlm/nlm_prot_impl.c
@@ -348,7 +348,6 @@ static CLIENT *
nlm_get_rpc(struct sockaddr *sa, rpcprog_t prog, rpcvers_t vers)
{
char *wchan = "nlmrcv";
- const char* protofmly;
struct sockaddr_storage ss;
struct socket *so;
CLIENT *rpcb;
@@ -370,14 +369,11 @@ nlm_get_rpc(struct sockaddr *sa, rpcprog_t prog, rpcvers_t vers)
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
diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c
index f4e71e7189e4..8922f71e055b 100644
--- a/sys/opencrypto/crypto.c
+++ b/sys/opencrypto/crypto.c
@@ -994,7 +994,7 @@ kdriver_suitable(const struct cryptocap *cap, const struct cryptkop *krp)
static struct cryptocap *
crypto_select_kdriver(const struct cryptkop *krp, int flags)
{
- struct cryptocap *cap, *best, *blocked;
+ struct cryptocap *cap, *best;
int match, hid;
CRYPTO_DRIVER_ASSERT();
@@ -1007,7 +1007,6 @@ crypto_select_kdriver(const struct cryptkop *krp, int flags)
else
match = CRYPTOCAP_F_SOFTWARE;
best = NULL;
- blocked = NULL;
again:
for (hid = 0; hid < crypto_drivers_num; hid++) {
cap = &crypto_drivers[hid];
diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c
index e26390a9b5c7..f8b519ff947e 100644
--- a/sys/opencrypto/cryptosoft.c
+++ b/sys/opencrypto/cryptosoft.c
@@ -986,7 +986,6 @@ swcr_freesession_locked(device_t dev, u_int64_t tid)
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 @@ swcr_freesession_locked(device_t dev, u_int64_t tid)
break;
case CRYPTO_DEFLATE_COMP:
- cxf = swd->sw_cxf;
+ /* Nothing to do */
break;
}
diff --git a/sys/rpc/clnt_dg.c b/sys/rpc/clnt_dg.c
index 8ffa410d587b..4c40a494325e 100644
--- a/sys/rpc/clnt_dg.c
+++ b/sys/rpc/clnt_dg.c
@@ -346,7 +346,6 @@ clnt_dg_call(
int retransmit_time;
int next_sendtime, starttime, rtt, time_waited, tv = 0;
struct sockaddr *sa;
- socklen_t salen;
uint32_t xid = 0;
struct mbuf *mreq = NULL, *results;
struct cu_request *cr;
@@ -398,13 +397,10 @@ clnt_dg_call(
}
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) {
diff --git a/sys/security/mac/mac_syscalls.c b/sys/security/mac/mac_syscalls.c
index 304d31359183..82623e561376 100644
--- a/sys/security/mac/mac_syscalls.c
+++ b/sys/security/mac/mac_syscalls.c
@@ -230,7 +230,6 @@ sys___mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap)
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 @@ sys___mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap)
if (error)
goto out;
- label_type = fp->f_type;
switch (fp->f_type) {
case DTYPE_FIFO:
case DTYPE_VNODE:
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 3df4f542f21d..f2bf0a45f20f 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -2414,13 +2414,11 @@ ffs_vfree(pvp, ino, mode)
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));
}
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 5ecb49e2f1e9..ce039d9adc8c 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -1369,7 +1369,6 @@ vop_deleteextattr {
*/
{
struct inode *ip;
- struct fs *fs;
struct extattr *eap;
uint32_t ul;
int olen, error, i, easize;
@@ -1377,7 +1376,6 @@ vop_deleteextattr {
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);