summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2011-04-18 13:59:56 +0000
committermav <mav@FreeBSD.org>2011-04-18 13:59:56 +0000
commit154daa04a737c2531d316f218a829989f45283cd (patch)
tree659045e055926acbbb40bd7d49047cfdc5433acf /sys/cam
parentced1036047d11e5cae5a25ac10e3566a20b2bd4c (diff)
downloadFreeBSD-src-154daa04a737c2531d316f218a829989f45283cd.zip
FreeBSD-src-154daa04a737c2531d316f218a829989f45283cd.tar.gz
Remove some used variables.
Found with: Clang Static Analyzer
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/ata/ata_da.c9
-rw-r--r--sys/cam/ata/ata_pmp.c22
2 files changed, 10 insertions, 21 deletions
diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c
index 48bbc0c..0c1a6f7 100644
--- a/sys/cam/ata/ata_da.c
+++ b/sys/cam/ata/ata_da.c
@@ -274,7 +274,6 @@ adaopen(struct disk *dp)
{
struct cam_periph *periph;
struct ada_softc *softc;
- int unit;
int error;
periph = (struct cam_periph *)dp->d_drv1;
@@ -293,13 +292,12 @@ adaopen(struct disk *dp)
return (error);
}
- unit = periph->unit_number;
softc = (struct ada_softc *)periph->softc;
softc->flags |= ADA_FLAG_OPEN;
CAM_DEBUG(periph->path, CAM_DEBUG_TRACE,
("adaopen: disk=%s%d (unit %d)\n", dp->d_name, dp->d_unit,
- unit));
+ periph->unit_number));
if ((softc->flags & ADA_FLAG_PACK_INVALID) != 0) {
/* Invalidate our pack information. */
@@ -1314,11 +1312,6 @@ adadone(struct cam_periph *periph, union ccb *done_ccb)
static int
adaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
{
- struct ada_softc *softc;
- struct cam_periph *periph;
-
- periph = xpt_path_periph(ccb->ccb_h.path);
- softc = (struct ada_softc *)periph->softc;
return(cam_periph_error(ccb, cam_flags, sense_flags, NULL));
}
diff --git a/sys/cam/ata/ata_pmp.c b/sys/cam/ata/ata_pmp.c
index e6eb4a2..91b9186 100644
--- a/sys/cam/ata/ata_pmp.c
+++ b/sys/cam/ata/ata_pmp.c
@@ -215,12 +215,9 @@ pmprelease(struct cam_periph *periph, int mask)
static void
pmponinvalidate(struct cam_periph *periph)
{
- struct pmp_softc *softc;
struct cam_path *dpath;
int i;
- softc = (struct pmp_softc *)periph->softc;
-
/*
* De-register any async callbacks.
*/
@@ -548,7 +545,7 @@ pmpdone(struct cam_periph *periph, union ccb *done_ccb)
struct ccb_trans_settings cts;
struct pmp_softc *softc;
struct ccb_ataio *ataio;
- struct cam_path *path, *dpath;
+ struct cam_path *dpath;
u_int32_t priority, res;
int i;
@@ -557,7 +554,6 @@ pmpdone(struct cam_periph *periph, union ccb *done_ccb)
CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("pmpdone\n"));
- path = done_ccb->ccb_h.path;
priority = done_ccb->ccb_h.pinfo.priority;
if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
@@ -583,10 +579,10 @@ pmpdone(struct cam_periph *periph, union ccb *done_ccb)
switch (softc->state) {
case PMP_STATE_PORTS:
- softc->pm_ports = (done_ccb->ataio.res.lba_high << 24) +
- (done_ccb->ataio.res.lba_mid << 16) +
- (done_ccb->ataio.res.lba_low << 8) +
- done_ccb->ataio.res.sector_count;
+ softc->pm_ports = (ataio->res.lba_high << 24) +
+ (ataio->res.lba_mid << 16) +
+ (ataio->res.lba_low << 8) +
+ ataio->res.sector_count;
/* This PMP declares 6 ports, while only 5 of them are real.
* Port 5 is enclosure management bridge port, which has implementation
* problems, causing probe faults. Hide it for now. */
@@ -650,10 +646,10 @@ pmpdone(struct cam_periph *periph, union ccb *done_ccb)
xpt_schedule(periph, priority);
return;
case PMP_STATE_CHECK:
- res = (done_ccb->ataio.res.lba_high << 24) +
- (done_ccb->ataio.res.lba_mid << 16) +
- (done_ccb->ataio.res.lba_low << 8) +
- done_ccb->ataio.res.sector_count;
+ res = (ataio->res.lba_high << 24) +
+ (ataio->res.lba_mid << 16) +
+ (ataio->res.lba_low << 8) +
+ ataio->res.sector_count;
if (((res & 0xf0f) == 0x103 && (res & 0x0f0) != 0) ||
(res & 0x600) != 0) {
if (bootverbose) {
OpenPOWER on IntegriCloud