summaryrefslogtreecommitdiffstats
path: root/sys/dev/hptmv/ioctl.c
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2007-05-21 09:26:47 +0000
committermjacob <mjacob@FreeBSD.org>2007-05-21 09:26:47 +0000
commit8e5e208b6fee9f511574490356733b6db9314905 (patch)
treed1363d07e03198494c31e680ddfc2c41243b34c7 /sys/dev/hptmv/ioctl.c
parent5ae2356887315e5671c661e701fb25655d3ee52c (diff)
downloadFreeBSD-src-8e5e208b6fee9f511574490356733b6db9314905.zip
FreeBSD-src-8e5e208b6fee9f511574490356733b6db9314905.tar.gz
Perhaps a better fix- make the called function do the (possible never reached)
initialization. Do a token amount of style cleanup. Poked by: bde
Diffstat (limited to 'sys/dev/hptmv/ioctl.c')
-rw-r--r--sys/dev/hptmv/ioctl.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/dev/hptmv/ioctl.c b/sys/dev/hptmv/ioctl.c
index 829bc8c..bf80700 100644
--- a/sys/dev/hptmv/ioctl.c
+++ b/sys/dev/hptmv/ioctl.c
@@ -77,13 +77,16 @@ get_disk_location(PDevice pDev, int *controller, int *channel)
IAL_ADAPTER_T *pAdapTemp;
int i, j;
- for (i=1, pAdapTemp = gIal_Adapter; pAdapTemp; pAdapTemp = pAdapTemp->next, i++) {
- for (j=0; j<MV_SATA_CHANNELS_NUM; j++)
- if (pDev==&pAdapTemp->VDevices[j].u.disk) {
- *controller = i;
- *channel = j;
- return;
- }
+ *controller = *channel = 0;
+
+ for (i=1, pAdapTemp = gIal_Adapter; pAdapTemp; pAdapTemp = pAdapTemp->next, i++) {
+ for (j=0; j<MV_SATA_CHANNELS_NUM; j++) {
+ if (pDev == &pAdapTemp->VDevices[j].u.disk) {
+ *controller = i;
+ *channel = j;
+ return;
+ }
+ }
}
}
@@ -151,7 +154,7 @@ ioctl_ReportEvent(UCHAR event, PVOID param)
}
event_queue_add(&e);
if (event==ET_DEVICE_REMOVED) {
- int controller = 0, channel = 0;
+ int controller, channel;
get_disk_location(&((PVDevice)param)->u.disk, &controller, &channel);
hpt_printk(("Device removed: controller %d channel %d\n", controller, channel));
}
OpenPOWER on IntegriCloud