diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/speakup/devsynth.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/speakup/devsynth.c b/drivers/staging/speakup/devsynth.c index 39dc586fc8bb..940769ef883f 100644 --- a/drivers/staging/speakup/devsynth.c +++ b/drivers/staging/speakup/devsynth.c | |||
@@ -18,13 +18,14 @@ static ssize_t speakup_file_write(struct file *fp, const char *buffer, | |||
18 | { | 18 | { |
19 | size_t count = nbytes; | 19 | size_t count = nbytes; |
20 | const char *ptr = buffer; | 20 | const char *ptr = buffer; |
21 | int bytes; | 21 | size_t bytes; |
22 | unsigned long flags; | 22 | unsigned long flags; |
23 | u_char buf[256]; | 23 | u_char buf[256]; |
24 | |||
24 | if (synth == NULL) | 25 | if (synth == NULL) |
25 | return -ENODEV; | 26 | return -ENODEV; |
26 | while (count > 0) { | 27 | while (count > 0) { |
27 | bytes = min_t(size_t, count, sizeof(buf)); | 28 | bytes = min(count, sizeof(buf)); |
28 | if (copy_from_user(buf, ptr, bytes)) | 29 | if (copy_from_user(buf, ptr, bytes)) |
29 | return -EFAULT; | 30 | return -EFAULT; |
30 | count -= bytes; | 31 | count -= bytes; |