Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187136
b: refs/heads/master
c: 86b12b4
h: refs/heads/master
v: v3
  • Loading branch information
Joe Perches authored and Linus Torvalds committed Mar 12, 2010
1 parent 4abfb74 commit 0809817
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 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: 4575b55281825d157573bbc5aa28b9144193ddd2
refs/heads/master: 86b12b48a29f4795e2e550f510d39931576bdf75
17 changes: 6 additions & 11 deletions trunk/drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,6 @@ static DECLARE_WAIT_QUEUE_HEAD(command_done);

#define NO_SIGNAL (!interruptible || !signal_pending(current))
#define CALL(x) if ((x) == -EINTR) return -EINTR
#define ECALL(x) if ((ret = (x))) return ret;
#define _WAIT(x,i) CALL(ret=wait_til_done((x),i))
#define WAIT(x) _WAIT((x),interruptible)
#define IWAIT(x) _WAIT((x),1)
Expand Down Expand Up @@ -3061,14 +3060,6 @@ static inline int fd_copyin(void __user *param, void *address,
return copy_from_user(address, param, size) ? -EFAULT : 0;
}

#define _COPYOUT(x) (copy_to_user((void __user *)param, &(x), sizeof(x)) \
? -EFAULT : 0)
#define _COPYIN(x) (copy_from_user(&(x), (void __user *)param, sizeof(x)) \
? -EFAULT : 0)

#define COPYOUT(x) ECALL(_COPYOUT(x))
#define COPYIN(x) ECALL(_COPYIN(x))

static inline const char *drive_name(int type, int drive)
{
struct floppy_struct *floppy;
Expand Down Expand Up @@ -3145,7 +3136,9 @@ static inline int raw_cmd_copyout(int cmd, char __user *param,
int ret;

while (ptr) {
COPYOUT(*ptr);
ret = copy_to_user((void __user *)param, ptr, sizeof(*ptr));
if (ret)
return -EFAULT;
param += sizeof(struct floppy_raw_cmd);
if ((ptr->flags & FD_RAW_READ) && ptr->buffer_length) {
if (ptr->length >= 0 &&
Expand Down Expand Up @@ -3195,7 +3188,9 @@ static inline int raw_cmd_copyin(int cmd, char __user *param,
if (!ptr)
return -ENOMEM;
*rcmd = ptr;
COPYIN(*ptr);
ret = copy_from_user(ptr, (void __user *)param, sizeof(*ptr));
if (ret)
return -EFAULT;
ptr->next = NULL;
ptr->buffer_length = 0;
param += sizeof(struct floppy_raw_cmd);
Expand Down

0 comments on commit 0809817

Please sign in to comment.