aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorGreg Lehey <grog@FreeBSD.org>2000-03-02 07:46:10 +0000
committerGreg Lehey <grog@FreeBSD.org>2000-03-02 07:46:10 +0000
commite7a1a7d809c55a9a224975e10a9464a2440948bd (patch)
tree0c78664aa6bb330010d559ab3cb1b3d5ae94114a /sys/dev
parent1d324174685638e34f8a66c8f78435962b1c0d36 (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/vinum/vinumio.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/vinum/vinumio.c b/sys/dev/vinum/vinumio.c
index 50203e327b330..17fc5fe37f798 100644
--- a/sys/dev/vinum/vinumio.c
+++ b/sys/dev/vinum/vinumio.c
@@ -90,9 +90,9 @@ open_drive(struct drive *drive, struct proc *p, int verbose)
* Create a minor number for each of them.
*/
unit = 0;
- while ((dname[0] >= '0') /* invalid unit */
- &&(dname[0] <= '9')) {
- unit += dname[0] - '0';
+ while ((*dname >= '0') /* unit number */
+ &&(*dname <= '9')) {
+ unit = unit * 10 + *dname - '0';
dname++;
}
@@ -104,9 +104,9 @@ open_drive(struct drive *drive, struct proc *p, int verbose)
+(dname[2] - 'a') /* partition */
+((dname[1] - '0' + 1) << 16); /* slice */
} else { /* compatibility partition */
- if ((dname[0] < 'a') || (dname[0] > 'h')) /* or invalid partition */
+ if ((*dname < 'a') || (*dname > 'h')) /* or invalid partition */
return ENODEV;
- devminor = (dname[0] - 'a') /* partition */
+ devminor = (*dname - 'a') /* partition */
+(unit << 3); /* unit */
}