diff options
author | Joe Perches <joe@perches.com> | 2010-03-10 18:20:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-12 18:52:29 -0500 |
commit | b87c9e0a880f2992dc210eb4ea8b2da6c63883ca (patch) | |
tree | 52874078468d1a381fb6ec99837bca94e0c052e2 /drivers/block/floppy.c | |
parent | bb57f0c662faa9879e8f265c9bc1f15bb238d2c7 (diff) |
drivers/block/floppy.c: remove CLEARSTRUCT macro, use memset
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/floppy.c')
-rw-r--r-- | drivers/block/floppy.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 48aefd9c5662..0cea96ceb78c 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -314,8 +314,6 @@ static int initialising = 1; | |||
314 | #define PH_HEAD(floppy, head) (((((floppy)->stretch & 2) >> 1) ^ head) << 2) | 314 | #define PH_HEAD(floppy, head) (((((floppy)->stretch & 2) >> 1) ^ head) << 2) |
315 | #define STRETCH(floppy) ((floppy)->stretch & FD_STRETCH) | 315 | #define STRETCH(floppy) ((floppy)->stretch & FD_STRETCH) |
316 | 316 | ||
317 | #define CLEARSTRUCT(x) memset((x), 0, sizeof(*(x))) | ||
318 | |||
319 | /* read/write */ | 317 | /* read/write */ |
320 | #define COMMAND (raw_cmd->cmd[0]) | 318 | #define COMMAND (raw_cmd->cmd[0]) |
321 | #define DR_SELECT (raw_cmd->cmd[1]) | 319 | #define DR_SELECT (raw_cmd->cmd[1]) |
@@ -3509,7 +3507,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, | |||
3509 | return -EINVAL; | 3507 | return -EINVAL; |
3510 | 3508 | ||
3511 | /* copyin */ | 3509 | /* copyin */ |
3512 | CLEARSTRUCT(&inparam); | 3510 | memset(&inparam, 0, sizeof(inparam)); |
3513 | if (_IOC_DIR(cmd) & _IOC_WRITE) | 3511 | if (_IOC_DIR(cmd) & _IOC_WRITE) |
3514 | ECALL(fd_copyin((void __user *)param, &inparam, size)) | 3512 | ECALL(fd_copyin((void __user *)param, &inparam, size)) |
3515 | 3513 | ||
@@ -3598,7 +3596,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, | |||
3598 | OUT(FDGETFDCSTAT, UFDCS); | 3596 | OUT(FDGETFDCSTAT, UFDCS); |
3599 | 3597 | ||
3600 | case FDWERRORCLR: | 3598 | case FDWERRORCLR: |
3601 | CLEARSTRUCT(UDRWE); | 3599 | memset(UDRWE, 0, sizeof(*UDRWE)); |
3602 | return 0; | 3600 | return 0; |
3603 | OUT(FDWERRORGET, UDRWE); | 3601 | OUT(FDWERRORGET, UDRWE); |
3604 | 3602 | ||
@@ -4260,7 +4258,7 @@ static int __init floppy_init(void) | |||
4260 | 4258 | ||
4261 | for (i = 0; i < N_FDC; i++) { | 4259 | for (i = 0; i < N_FDC; i++) { |
4262 | fdc = i; | 4260 | fdc = i; |
4263 | CLEARSTRUCT(FDCS); | 4261 | memset(FDCS, 0, sizeof(*FDCS)); |
4264 | FDCS->dtr = -1; | 4262 | FDCS->dtr = -1; |
4265 | FDCS->dor = 0x4; | 4263 | FDCS->dor = 0x4; |
4266 | #if defined(__sparc__) || defined(__mc68000__) | 4264 | #if defined(__sparc__) || defined(__mc68000__) |
@@ -4293,8 +4291,8 @@ static int __init floppy_init(void) | |||
4293 | 4291 | ||
4294 | /* initialise drive state */ | 4292 | /* initialise drive state */ |
4295 | for (drive = 0; drive < N_DRIVE; drive++) { | 4293 | for (drive = 0; drive < N_DRIVE; drive++) { |
4296 | CLEARSTRUCT(UDRS); | 4294 | memset(UDRS, 0, sizeof(*UDRS)); |
4297 | CLEARSTRUCT(UDRWE); | 4295 | memset(UDRWE, 0, sizeof(*UDRWE)); |
4298 | USETF(FD_DISK_NEWCHANGE); | 4296 | USETF(FD_DISK_NEWCHANGE); |
4299 | USETF(FD_DISK_CHANGED); | 4297 | USETF(FD_DISK_CHANGED); |
4300 | USETF(FD_VERIFY); | 4298 | USETF(FD_VERIFY); |