From: Sascha Wildner Date: Sat, 16 Feb 2013 11:32:10 +0000 (+0100) Subject: kernel: Handle some variables only used in debug output. X-Git-Tag: v3.4.0rc~305 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/037c6127e4ace1000bf74aa02b505ac32bf8f8a3 kernel: Handle some variables only used in debug output. --- diff --git a/sys/dev/raid/ciss/ciss.c b/sys/dev/raid/ciss/ciss.c index dc124059e7..a7b1a91666 100644 --- a/sys/dev/raid/ciss/ciss.c +++ b/sys/dev/raid/ciss/ciss.c @@ -2002,10 +2002,14 @@ ciss_free(struct ciss_softc *sc) static int ciss_start(struct ciss_request *cr) { - struct ciss_command *cc; /* XXX debugging only */ +#ifdef CISS_DEBUG + struct ciss_command *cc; +#endif int error; +#ifdef CISS_DEBUG cc = cr->cr_cc; +#endif debug(2, "post command %d tag %d ", cr->cr_tag, cc->header.host_tag); /* @@ -2986,12 +2990,16 @@ ciss_cam_action(struct cam_sim *sim, union ccb *ccb) case XPT_GET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; +#ifdef CISS_DEBUG int bus, target; +#endif struct ccb_trans_settings_spi *spi = &cts->xport_specific.spi; struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; +#ifdef CISS_DEBUG bus = cam_sim_bus(sim); target = cts->ccb_h.target_id; +#endif debug(1, "XPT_GET_TRAN_SETTINGS %d:%d", bus, target); /* disconnect always OK */ diff --git a/sys/dev/raid/iir/iir.c b/sys/dev/raid/iir/iir.c index cf23b2ddc6..f1a107ebfc 100644 --- a/sys/dev/raid/iir/iir.c +++ b/sys/dev/raid/iir/iir.c @@ -1310,13 +1310,18 @@ static void iir_action( struct cam_sim *sim, union ccb *ccb ) { struct gdt_softc *gdt; - int bus, target, lun; + int bus, target; +#ifdef GDT_DEBUG + int lun; +#endif gdt = (struct gdt_softc *)cam_sim_softc( sim ); ccb->ccb_h.ccb_sim_ptr = sim; bus = cam_sim_bus(sim); target = ccb->ccb_h.target_id; +#ifdef GDT_DEBUG lun = ccb->ccb_h.target_lun; +#endif GDT_DPRINTF(GDT_D_CMD, ("iir_action(%p) func 0x%x cmd 0x%x bus %d target %d lun %d\n", gdt, ccb->ccb_h.func_code, ccb->csio.cdb_io.cdb_bytes[0], diff --git a/sys/dev/raid/twe/twe.c b/sys/dev/raid/twe/twe.c index 4add740bbb..5153910034 100644 --- a/sys/dev/raid/twe/twe.c +++ b/sys/dev/raid/twe/twe.c @@ -1112,7 +1112,9 @@ int twe_start(struct twe_request *tr) { struct twe_softc *sc = tr->tr_sc; +#ifdef TWE_DEBUG TWE_Command *cmd; +#endif int i; u_int32_t status_reg; @@ -1122,7 +1124,9 @@ twe_start(struct twe_request *tr) /* mark the command as currently being processed */ tr->tr_status = TWE_CMD_BUSY; +#ifdef TWE_DEBUG cmd = TWE_FIND_COMMAND(tr); +#endif /* * Spin briefly waiting for the controller to come ready @@ -1174,7 +1178,9 @@ static void twe_done(struct twe_softc *sc, int startio) { TWE_Response_Queue rq; +#ifdef TWE_DEBUG TWE_Command *cmd; +#endif struct twe_request *tr; int found; u_int32_t status_reg; @@ -1191,7 +1197,9 @@ twe_done(struct twe_softc *sc, int startio) found = 1; rq.value = TWE_RESPONSE_QUEUE(sc); tr = sc->twe_lookup[rq.u.response_id]; /* find command */ +#ifdef TWE_DEBUG cmd = TWE_FIND_COMMAND(tr); +#endif if (tr->tr_status != TWE_CMD_BUSY) twe_printf(sc, "completion event for nonbusy command\n"); tr->tr_status = TWE_CMD_COMPLETE; diff --git a/sys/dev/raid/tws/tws_hdm.c b/sys/dev/raid/tws/tws_hdm.c index 3c1e5d14dc..0b27cc3189 100644 --- a/sys/dev/raid/tws/tws_hdm.c +++ b/sys/dev/raid/tws/tws_hdm.c @@ -82,7 +82,9 @@ void tws_display_ctlr_info(struct tws_softc *sc); int tws_init_ctlr(struct tws_softc *sc) { +#ifdef TWS_DEBUG u_int64_t reg; +#endif u_int32_t regh, regl; TWS_TRACE_DEBUG(sc, "entry", sc, sc->is64bit); @@ -98,7 +100,9 @@ tws_init_ctlr(struct tws_softc *sc) while( 1 ) { regh = tws_read_reg(sc, TWS_I2O0_IOPOBQPH, 4); regl = tws_read_reg(sc, TWS_I2O0_IOPOBQPL, 4); +#ifdef TWS_DEBUG reg = (((u_int64_t)regh) << 32) | regl; +#endif TWS_TRACE_DEBUG(sc, "host outbound cleanup", reg, regl); if ( regh == TWS_FIFO_EMPTY32 ) break; diff --git a/sys/vfs/hpfs/hpfs_subr.c b/sys/vfs/hpfs/hpfs_subr.c index 6fa7c9037e..4e642bf618 100644 --- a/sys/vfs/hpfs/hpfs_subr.c +++ b/sys/vfs/hpfs/hpfs_subr.c @@ -756,14 +756,19 @@ hpfs_truncate ( u_long size) { struct hpfsmount *hpmp = hp->h_hpmp; - lsn_t newblen, oldblen; + lsn_t newblen; +#ifdef HPFS_DEBUG + lsn_t oldblen; +#endif int error, pf; dprintf(("hpfs_truncate(0x%x, 0x%x -> 0x%lx): ", hp->h_no, hp->h_fn.fn_size, size)); newblen = (size + DEV_BSIZE - 1) >> DEV_BSHIFT; +#ifdef HPFS_DEBUG oldblen = (hp->h_fn.fn_size + DEV_BSIZE - 1) >> DEV_BSHIFT; +#endif dprintf(("blen: 0x%x -> 0x%x\n", oldblen, newblen));