Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187128
b: refs/heads/master
c: b87c9e0
h: refs/heads/master
v: v3
  • Loading branch information
Joe Perches authored and Linus Torvalds committed Mar 12, 2010
1 parent 7f4d5e3 commit 415ead6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bb57f0c662faa9879e8f265c9bc1f15bb238d2c7
refs/heads/master: b87c9e0a880f2992dc210eb4ea8b2da6c63883ca
12 changes: 5 additions & 7 deletions trunk/drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,6 @@ static int initialising = 1;
#define PH_HEAD(floppy, head) (((((floppy)->stretch & 2) >> 1) ^ head) << 2)
#define STRETCH(floppy) ((floppy)->stretch & FD_STRETCH)

#define CLEARSTRUCT(x) memset((x), 0, sizeof(*(x)))

/* read/write */
#define COMMAND (raw_cmd->cmd[0])
#define DR_SELECT (raw_cmd->cmd[1])
Expand Down Expand Up @@ -3509,7 +3507,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
return -EINVAL;

/* copyin */
CLEARSTRUCT(&inparam);
memset(&inparam, 0, sizeof(inparam));
if (_IOC_DIR(cmd) & _IOC_WRITE)
ECALL(fd_copyin((void __user *)param, &inparam, size))

Expand Down Expand Up @@ -3598,7 +3596,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
OUT(FDGETFDCSTAT, UFDCS);

case FDWERRORCLR:
CLEARSTRUCT(UDRWE);
memset(UDRWE, 0, sizeof(*UDRWE));
return 0;
OUT(FDWERRORGET, UDRWE);

Expand Down Expand Up @@ -4260,7 +4258,7 @@ static int __init floppy_init(void)

for (i = 0; i < N_FDC; i++) {
fdc = i;
CLEARSTRUCT(FDCS);
memset(FDCS, 0, sizeof(*FDCS));
FDCS->dtr = -1;
FDCS->dor = 0x4;
#if defined(__sparc__) || defined(__mc68000__)
Expand Down Expand Up @@ -4293,8 +4291,8 @@ static int __init floppy_init(void)

/* initialise drive state */
for (drive = 0; drive < N_DRIVE; drive++) {
CLEARSTRUCT(UDRS);
CLEARSTRUCT(UDRWE);
memset(UDRS, 0, sizeof(*UDRS));
memset(UDRWE, 0, sizeof(*UDRWE));
USETF(FD_DISK_NEWCHANGE);
USETF(FD_DISK_CHANGED);
USETF(FD_VERIFY);
Expand Down

0 comments on commit 415ead6

Please sign in to comment.