diff options
Diffstat (limited to 'drivers/block/floppy.c')
-rw-r--r-- | drivers/block/floppy.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index b86613b21cf1..374621a512e0 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -479,7 +479,6 @@ static struct floppy_struct floppy_type[32] = { | |||
479 | { 3200,20,2,80,0,0x1C,0x00,0xCF,0x2C,"H1600" }, /* 31 1.6MB 3.5" */ | 479 | { 3200,20,2,80,0,0x1C,0x00,0xCF,0x2C,"H1600" }, /* 31 1.6MB 3.5" */ |
480 | }; | 480 | }; |
481 | 481 | ||
482 | #define NUMBER(x) (sizeof(x) / sizeof(*(x))) | ||
483 | #define SECTSIZE (_FD_SECTSIZE(*floppy)) | 482 | #define SECTSIZE (_FD_SECTSIZE(*floppy)) |
484 | 483 | ||
485 | /* Auto-detection: Disk type used until the next media change occurs. */ | 484 | /* Auto-detection: Disk type used until the next media change occurs. */ |
@@ -3645,7 +3644,7 @@ static void __init config_types(void) | |||
3645 | const char *name = NULL; | 3644 | const char *name = NULL; |
3646 | static char temparea[32]; | 3645 | static char temparea[32]; |
3647 | 3646 | ||
3648 | if (type < NUMBER(default_drive_params)) { | 3647 | if (type < ARRAY_SIZE(default_drive_params)) { |
3649 | params = &default_drive_params[type].params; | 3648 | params = &default_drive_params[type].params; |
3650 | if (type) { | 3649 | if (type) { |
3651 | name = default_drive_params[type].name; | 3650 | name = default_drive_params[type].name; |
@@ -3961,7 +3960,7 @@ static void __init register_devfs_entries(int drive) | |||
3961 | { | 3960 | { |
3962 | int base_minor = (drive < 4) ? drive : (124 + drive); | 3961 | int base_minor = (drive < 4) ? drive : (124 + drive); |
3963 | 3962 | ||
3964 | if (UDP->cmos < NUMBER(default_drive_params)) { | 3963 | if (UDP->cmos < ARRAY_SIZE(default_drive_params)) { |
3965 | int i = 0; | 3964 | int i = 0; |
3966 | do { | 3965 | do { |
3967 | int minor = base_minor + (table_sup[UDP->cmos][i] << 2); | 3966 | int minor = base_minor + (table_sup[UDP->cmos][i] << 2); |
@@ -4219,7 +4218,7 @@ static struct kobject *floppy_find(dev_t dev, int *part, void *data) | |||
4219 | !(allowed_drive_mask & (1 << drive)) || | 4218 | !(allowed_drive_mask & (1 << drive)) || |
4220 | fdc_state[FDC(drive)].version == FDC_NONE) | 4219 | fdc_state[FDC(drive)].version == FDC_NONE) |
4221 | return NULL; | 4220 | return NULL; |
4222 | if (((*part >> 2) & 0x1f) >= NUMBER(floppy_type)) | 4221 | if (((*part >> 2) & 0x1f) >= ARRAY_SIZE(floppy_type)) |
4223 | return NULL; | 4222 | return NULL; |
4224 | *part = 0; | 4223 | *part = 0; |
4225 | return get_disk(disks[drive]); | 4224 | return get_disk(disks[drive]); |
@@ -4571,7 +4570,7 @@ static void unregister_devfs_entries(int drive) | |||
4571 | { | 4570 | { |
4572 | int i; | 4571 | int i; |
4573 | 4572 | ||
4574 | if (UDP->cmos < NUMBER(default_drive_params)) { | 4573 | if (UDP->cmos < ARRAY_SIZE(default_drive_params)) { |
4575 | i = 0; | 4574 | i = 0; |
4576 | do { | 4575 | do { |
4577 | devfs_remove("floppy/%d%s", drive, | 4576 | devfs_remove("floppy/%d%s", drive, |