From: David van Moolenbroek Date: Sun, 28 Jul 2013 12:03:07 +0000 (+0200) Subject: Move SUB_PER_DRIVE definition into minix/drvlib.h X-Git-Tag: v3.3.0~597 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=a1f00d5527f3556b425e7704655c126e7b8a1933;p=minix.git Move SUB_PER_DRIVE definition into minix/drvlib.h Change-Id: Id25761085ce1868955da34d8e530e170448ea154 --- diff --git a/drivers/ahci/ahci.h b/drivers/ahci/ahci.h index 5b77d9e63..ab7c52c74 100644 --- a/drivers/ahci/ahci.h +++ b/drivers/ahci/ahci.h @@ -264,7 +264,6 @@ typedef struct vumap_phys prd_t; */ #define MAX_DRIVES 8 #define NR_MINORS (MAX_DRIVES * DEV_PER_DRIVE) -#define SUB_PER_DRIVE (NR_PARTITIONS * NR_PARTITIONS) #define NR_SUBDEVS (MAX_DRIVES * SUB_PER_DRIVE) /* Port states. */ diff --git a/drivers/at_wini/at_wini.h b/drivers/at_wini/at_wini.h index 868c8cd0d..3385dc014 100644 --- a/drivers/at_wini/at_wini.h +++ b/drivers/at_wini/at_wini.h @@ -194,7 +194,6 @@ #define MAX_SECS 256 /* controller can transfer this many sectors */ #define MAX_ERRORS 4 /* how often to try rd/wt before quitting */ #define NR_MINORS (MAX_DRIVES * DEV_PER_DRIVE) -#define SUB_PER_DRIVE (NR_PARTITIONS * NR_PARTITIONS) #define NR_SUBDEVS (MAX_DRIVES * SUB_PER_DRIVE) #define DELAY_USECS 1000 /* controller timeout in microseconds */ #define DELAY_TICKS 1 /* controller timeout in ticks */ diff --git a/drivers/mmc/mmcblk.c b/drivers/mmc/mmcblk.c index 7541a0605..9664408be 100644 --- a/drivers/mmc/mmcblk.c +++ b/drivers/mmc/mmcblk.c @@ -32,7 +32,6 @@ static struct log log = { /* holding the current host controller */ static struct mmc_host host; -#define SUB_PER_DRIVE (NR_PARTITIONS * NR_PARTITIONS) #define NR_SUBDEVS (MAX_DRIVES * SUB_PER_DRIVE) /* When passing data over a grant one needs to pass diff --git a/drivers/virtio_blk/virtio_blk.c b/drivers/virtio_blk/virtio_blk.c index cc1b7d069..141552438 100644 --- a/drivers/virtio_blk/virtio_blk.c +++ b/drivers/virtio_blk/virtio_blk.c @@ -60,9 +60,8 @@ static int terminating = 0; static int open_count = 0; /* Partition magic */ -#define VIRTIO_BLK_SUB_PER_DRIVE (NR_PARTITIONS * NR_PARTITIONS) struct device part[DEV_PER_DRIVE]; -struct device subpart[VIRTIO_BLK_SUB_PER_DRIVE]; +struct device subpart[SUB_PER_DRIVE]; /* Headers for requests */ static struct virtio_blk_outhdr *hdrs_vir; diff --git a/include/minix/drvlib.h b/include/minix/drvlib.h index b2a71e381..402a89c93 100644 --- a/include/minix/drvlib.h +++ b/include/minix/drvlib.h @@ -8,6 +8,7 @@ void partition(struct blockdriver *bdr, int device, int style, int atapi); #define DEV_PER_DRIVE (1 + NR_PARTITIONS) +#define SUB_PER_DRIVE (NR_PARTITIONS * NR_PARTITIONS) #define MINOR_t0 64 #define MINOR_r0 120 #define MINOR_d0p0s0 128