Thread (4 messages) 4 messages, 3 authors, 2011-02-04

Re: [PATCHv2] evdev: fix evdev_write return value on partial writes

From: Peter Korsgaard <jacmet@sunsite.dk>
Date: 2011-02-04 11:00:38

quoted
quoted
quoted
quoted
"Henrik" == Henrik Rydberg [off-list ref] writes:
Hi,

 >> I think that returning -EINVAL is good idea, so I am going to apply it.
 >> I also think we can change this loop to do-while kind since we already
 >> checked there enough space for an event.

 Henrik> The code below will return -EINVAL even if some parts of the buffer
 Henrik> was successfully read, though.

You mean written? I don't see that. The only place we return -EINVAL is
at the initial check.

 >> --- a/drivers/input/evdev.c
 >> +++ b/drivers/input/evdev.c
 >> @@ -321,6 +321,9 @@ static ssize_t evdev_write(struct file *file, const char __user *buffer,
 >> struct input_event event;
 >> int retval;

 Henrik> Alternatively,

 Henrik> size_t num_written = 0;
 Henrik> int ret = 0;

Any reason for this bigger change? It's imho pretty clear as is. I don't
see any functional change from your version.

-- 
Bye, Peter Korsgaard
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help