Remove instances of variables that were set, but never used. gcc 4.9

warns about these by default.
This commit is contained in:
Warner Losh 2014-03-30 23:43:36 +00:00
parent 63e4d6f712
commit 8a27a339b6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=263954
14 changed files with 22 additions and 63 deletions

View File

@ -3013,13 +3013,11 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
struct disk_params *dp;
uint32_t block_size;
uint64_t maxsector;
u_int lbppbe; /* LB per physical block exponent. */
u_int lalba; /* Lowest aligned LBA. */
if (state == DA_CCB_PROBE_RC) {
block_size = scsi_4btoul(rdcap->length);
maxsector = scsi_4btoul(rdcap->addr);
lbppbe = 0;
lalba = 0;
/*
@ -3040,7 +3038,6 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
} else {
block_size = scsi_4btoul(rcaplong->length);
maxsector = scsi_8btou64(rcaplong->addr);
lbppbe = rcaplong->prot_lbppbe & SRC16_LBPPBE;
lalba = scsi_2btoul(rcaplong->lalba_lbp);
}

View File

@ -1162,7 +1162,6 @@ ses_page_cdb(char *cdb, int bufsiz, SesDiagPageCodes pagenum, int dir)
static int
ses_set_timed_completion(enc_softc_t *enc, uint8_t tc_en)
{
int err;
union ccb *ccb;
struct cam_periph *periph;
struct ses_mgmt_mode_page *mgmt;
@ -1187,7 +1186,7 @@ ses_set_timed_completion(enc_softc_t *enc, uint8_t tc_en)
* Ignore illegal request errors, as they are quite common and we
* will print something out in that case anyway.
*/
err = cam_periph_runccb(ccb, enc_error, ENC_CFLAGS,
cam_periph_runccb(ccb, enc_error, ENC_CFLAGS,
ENC_FLAGS|SF_QUIET_IR, NULL);
if (ccb->ccb_h.status != CAM_REQ_CMP) {
ENC_VLOG(enc, "Timed Completion Unsupported\n");
@ -1211,7 +1210,7 @@ ses_set_timed_completion(enc_softc_t *enc, uint8_t tc_en)
/*page_fmt*/FALSE, /*save_pages*/TRUE, mode_buf, mode_buf_len,
SSD_FULL_SIZE, /*timeout*/60 * 1000);
err = cam_periph_runccb(ccb, enc_error, ENC_CFLAGS, ENC_FLAGS, NULL);
cam_periph_runccb(ccb, enc_error, ENC_CFLAGS, ENC_FLAGS, NULL);
if (ccb->ccb_h.status != CAM_REQ_CMP) {
ENC_VLOG(enc, "Timed Completion Set Failed\n");
goto release;
@ -1881,11 +1880,9 @@ ses_publish_physpaths(enc_softc_t *enc, struct enc_fsm_state *state,
{
struct ses_iterator iter;
enc_cache_t *enc_cache;
ses_cache_t *ses_cache;
enc_element_t *element;
enc_cache = &enc->enc_daemon_cache;
ses_cache = enc_cache->private;
ses_iter_init(enc, enc_cache, &iter);
while ((element = ses_iter_next(&iter)) != NULL) {

View File

@ -540,7 +540,6 @@ static int
passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
struct cam_periph *periph;
struct pass_softc *softc;
int error;
uint32_t priority;
@ -549,7 +548,6 @@ passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread
return(ENXIO);
cam_periph_lock(periph);
softc = (struct pass_softc *)periph->softc;
error = 0;

View File

@ -1664,15 +1664,12 @@ freebsd32_do_sendfile(struct thread *td,
off_t offset;
int error;
off_t sbytes;
struct sendfile_sync *sfs;
int do_kqueue = 0;
offset = PAIR32TO64(off_t, uap->offset);
if (offset < 0)
return (EINVAL);
hdr_uio = trl_uio = NULL;
sfs = NULL;
if (uap->hdtr != NULL) {
error = copyin(uap->hdtr, &hdtr32, sizeof(hdtr32));
@ -1714,7 +1711,6 @@ freebsd32_do_sendfile(struct thread *td,
CP(hdtr_kq32, hdtr_kq, kq_flags);
PTRIN_CP(hdtr_kq32, hdtr_kq, kq_udata);
CP(hdtr_kq32, hdtr_kq, kq_ident);
do_kqueue = 1;
}
}

View File

@ -242,13 +242,11 @@ aac_cam_event(struct aac_softc *sc, struct aac_event *event, void *arg)
static int
aac_cam_probe(device_t dev)
{
struct aac_softc *sc;
struct aac_cam *camsc;
camsc = (struct aac_cam *)device_get_softc(dev);
if (!camsc->inf)
return (0);
sc = camsc->inf->aac_sc;
fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
return (0);
}
@ -1133,11 +1131,9 @@ aac_cam_poll(struct cam_sim *sim)
static void
aac_container_complete(struct aac_command *cm)
{
struct aac_softc *sc;
union ccb *ccb;
u_int32_t status;
sc = cm->cm_sc;
fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
ccb = cm->cm_ccb;
status = ((u_int32_t *)cm->cm_fib->data)[0];

View File

@ -111,12 +111,10 @@ static struct aac_ident *
aac_find_ident(device_t dev)
{
struct aac_ident *m;
u_int16_t vendid, devid, sub_vendid, sub_devid;
u_int16_t vendid, devid;
vendid = pci_get_vendor(dev);
devid = pci_get_device(dev);
sub_vendid = pci_get_subvendor(dev);
sub_devid = pci_get_subdevice(dev);
for (m = aacraid_family_identifiers; m->vendor != 0; m++) {
if ((m->vendor == vendid) && (m->device == devid))

View File

@ -696,7 +696,6 @@ acpi_set_power_children(device_t dev, int state)
{
device_t child, parent;
device_t *devlist;
struct pci_devinfo *dinfo;
int dstate, i, numdevs;
if (device_get_children(dev, &devlist, &numdevs) != 0)
@ -709,7 +708,6 @@ acpi_set_power_children(device_t dev, int state)
parent = device_get_parent(dev);
for (i = 0; i < numdevs; i++) {
child = devlist[i];
dinfo = device_get_ivars(child);
dstate = state;
if (device_is_attached(child) &&
acpi_device_pwr_for_sleep(parent, dev, &dstate) == 0)

View File

@ -183,7 +183,6 @@ acpi_parse_resource(ACPI_RESOURCE *res, void *context)
struct acpi_parse_resource_set *set;
struct acpi_resource_context *arc;
UINT64 min, max, length, gran;
const char *name;
device_t dev;
arc = context;
@ -300,21 +299,18 @@ acpi_parse_resource(ACPI_RESOURCE *res, void *context)
min = res->Data.Address16.Minimum;
max = res->Data.Address16.Maximum;
length = res->Data.Address16.AddressLength;
name = "Address16";
break;
case ACPI_RESOURCE_TYPE_ADDRESS32:
gran = res->Data.Address32.Granularity;
min = res->Data.Address32.Minimum;
max = res->Data.Address32.Maximum;
length = res->Data.Address32.AddressLength;
name = "Address32";
break;
case ACPI_RESOURCE_TYPE_ADDRESS64:
gran = res->Data.Address64.Granularity;
min = res->Data.Address64.Minimum;
max = res->Data.Address64.Maximum;
length = res->Data.Address64.AddressLength;
name = "Address64";
break;
default:
KASSERT(res->Type == ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64,
@ -323,7 +319,6 @@ acpi_parse_resource(ACPI_RESOURCE *res, void *context)
min = res->Data.ExtAddress64.Minimum;
max = res->Data.ExtAddress64.Maximum;
length = res->Data.ExtAddress64.AddressLength;
name = "ExtAddress64";
break;
}
if (length <= 0)

View File

@ -345,7 +345,7 @@ acpi_smbat_get_bst(device_t dev, struct acpi_bst *bst)
{
struct acpi_smbat_softc *sc;
int error;
uint32_t cap_units, factor;
uint32_t factor;
int16_t val;
uint8_t addr;
@ -362,13 +362,10 @@ acpi_smbat_get_bst(device_t dev, struct acpi_bst *bst)
if (acpi_smbus_read_2(sc, addr, SMBATT_CMD_BATTERY_MODE, &val))
goto out;
if (val & SMBATT_BM_CAPACITY_MODE) {
if (val & SMBATT_BM_CAPACITY_MODE)
factor = 10;
cap_units = ACPI_BIF_UNITS_MW;
} else {
else
factor = 1;
cap_units = ACPI_BIF_UNITS_MA;
}
/* get battery status */
if (acpi_smbus_read_2(sc, addr, SMBATT_CMD_BATTERY_STATUS, &val))

View File

@ -1005,7 +1005,6 @@ adv_run_doneq(struct adv_softc *adv)
struct adv_ccb_info *cinfo;
u_int done_qaddr;
u_int sg_queue_cnt;
int aborted;
done_qaddr = ADV_QNO_TO_QADDR(done_qno);
@ -1050,8 +1049,6 @@ adv_run_doneq(struct adv_softc *adv)
#endif
adv->cur_active -= sg_queue_cnt + 1;
aborted = (scsiq.q_status & QS_ABORTED) != 0;
if ((scsiq.q_status != QS_DONE)
&& (scsiq.q_status & QS_ABORTED) == 0)
panic("adv_qdone: completed scsiq with unknown status");

View File

@ -1051,12 +1051,10 @@ adv_isr_chip_halted(struct adv_softc *adv)
q_cntl &= ~QC_MSG_OUT;
adv_write_lram_8(adv, halt_q_addr + ADV_SCSIQ_B_CNTL, q_cntl);
} else if (int_halt_code == ADV_HALT_SS_QUEUE_FULL) {
u_int8_t scsi_status;
union ccb *ccb;
u_int32_t cinfo_index;
scsi_status = adv_read_lram_8(adv, halt_q_addr
+ ADV_SCSIQ_SCSI_STATUS);
adv_read_lram_8(adv, halt_q_addr + ADV_SCSIQ_SCSI_STATUS);
cinfo_index =
adv_read_lram_32(adv, halt_q_addr + ADV_SCSIQ_D_CINFO_IDX);
ccb = adv->ccb_infos[cinfo_index].ccb;
@ -1714,13 +1712,9 @@ adv_send_scsi_queue(struct adv_softc *adv, struct adv_scsi_q *scsiq,
{
u_int8_t free_q_head;
u_int8_t next_qp;
u_int8_t tid_no;
u_int8_t target_ix;
int retval;
retval = 1;
target_ix = scsiq->q2.target_ix;
tid_no = ADV_TIX_TO_TID(target_ix);
free_q_head = adv_read_lram_16(adv, ADVV_FREE_Q_HEAD_W) & 0xFF;
if ((next_qp = adv_alloc_free_queues(adv, free_q_head, n_q_required))
!= ADV_QLINK_END) {

View File

@ -344,12 +344,10 @@ adw_action(struct cam_sim *sim, union ccb *ccb)
case XPT_SCSI_IO: /* Execute the requested I/O operation */
{
struct ccb_scsiio *csio;
struct ccb_hdr *ccbh;
struct acb *acb;
int error;
csio = &ccb->csio;
ccbh = &ccb->ccb_h;
/* Max supported CDB length is 12 bytes */
if (csio->cdb_len > 12) {

View File

@ -1059,9 +1059,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
{
struct ahd_devinfo devinfo;
struct scb *scb;
struct ahd_initiator_tinfo *targ_info;
struct ahd_tmode_tstate *tstate;
struct ahd_transinfo *tinfo;
u_int scbid;
/*
@ -1090,12 +1088,11 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
SCB_GET_LUN(scb),
SCB_GET_CHANNEL(ahd, scb),
ROLE_INITIATOR);
targ_info = ahd_fetch_transinfo(ahd,
devinfo.channel,
devinfo.our_scsiid,
devinfo.target,
&tstate);
tinfo = &targ_info->curr;
ahd_fetch_transinfo(ahd,
devinfo.channel,
devinfo.our_scsiid,
devinfo.target,
&tstate);
ahd_set_width(ahd, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
AHD_TRANS_ACTIVE, /*paused*/TRUE);
ahd_set_syncrate(ahd, &devinfo, /*period*/0,
@ -1817,7 +1814,6 @@ ahd_handle_transmission_error(struct ahd_softc *ahd)
struct scb *scb;
u_int scbid;
u_int lqistat1;
u_int lqistat2;
u_int msg_out;
u_int curphase;
u_int lastphase;
@ -1828,7 +1824,7 @@ ahd_handle_transmission_error(struct ahd_softc *ahd)
scb = NULL;
ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
lqistat1 = ahd_inb(ahd, LQISTAT1) & ~(LQIPHASE_LQ|LQIPHASE_NLQ);
lqistat2 = ahd_inb(ahd, LQISTAT2);
ahd_inb(ahd, LQISTAT2);
if ((lqistat1 & (LQICRCI_NLQ|LQICRCI_LQ)) == 0
&& (ahd->bugs & AHD_NLQICRC_DELAYED_BUG) != 0) {
u_int lqistate;
@ -2780,10 +2776,8 @@ ahd_dump_sglist(struct scb *scb)
sg_list = (struct ahd_dma64_seg*)scb->sg_list;
for (i = 0; i < scb->sg_count; i++) {
uint64_t addr;
uint32_t len;
addr = aic_le64toh(sg_list[i].addr);
len = aic_le32toh(sg_list[i].len);
printf("sg[%d] - Addr 0x%x%x : Length %d%s\n",
i,
(uint32_t)((addr >> 32) & 0xFFFFFFFF),
@ -3418,13 +3412,12 @@ ahd_update_pending_scbs(struct ahd_softc *ahd)
pending_scb_count = 0;
LIST_FOREACH(pending_scb, &ahd->pending_scbs, pending_links) {
struct ahd_devinfo devinfo;
struct ahd_initiator_tinfo *tinfo;
struct ahd_tmode_tstate *tstate;
ahd_scb_devinfo(ahd, &devinfo, pending_scb);
tinfo = ahd_fetch_transinfo(ahd, devinfo.channel,
devinfo.our_scsiid,
devinfo.target, &tstate);
ahd_fetch_transinfo(ahd, devinfo.channel,
devinfo.our_scsiid,
devinfo.target, &tstate);
if ((tstate->auto_negotiate & devinfo.target_mask) == 0
&& (pending_scb->flags & SCB_AUTO_NEGOTIATE) != 0) {
pending_scb->flags &= ~SCB_AUTO_NEGOTIATE;

View File

@ -172,7 +172,10 @@ buf_ring_dequeue_mc(struct buf_ring *br)
static __inline void *
buf_ring_dequeue_sc(struct buf_ring *br)
{
uint32_t cons_head, cons_next, cons_next_next;
uint32_t cons_head, cons_next;
#ifdef PREFETCH_DEFINED
uint32_t cons_next_next;
#endif
uint32_t prod_tail;
void *buf;
@ -180,7 +183,9 @@ buf_ring_dequeue_sc(struct buf_ring *br)
prod_tail = br->br_prod_tail;
cons_next = (cons_head + 1) & br->br_cons_mask;
#ifdef PREFETCH_DEFINED
cons_next_next = (cons_head + 2) & br->br_cons_mask;
#endif
if (cons_head == prod_tail)
return (NULL);