ChangeSet 1.1843.4.12, 2004/08/24 11:43:27-07:00, [EMAIL PROTECTED]

[PATCH] USB: legousbtower.c module_param fix

drivers/usb/misc/legousbtower.c: In function `__check_read_buffer_size':
drivers/usb/misc/legousbtower.c:119: warning: return from incompatible pointer type
drivers/usb/misc/legousbtower.c: In function `__check_write_buffer_size':
drivers/usb/misc/legousbtower.c:129: warning: return from incompatible pointer type

The fix is awkward - module_param() doesn't like size_t's.

Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>


 drivers/usb/misc/legousbtower.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


diff -Nru a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
--- a/drivers/usb/misc/legousbtower.c   2004-08-26 16:42:45 -07:00
+++ b/drivers/usb/misc/legousbtower.c   2004-08-26 16:42:45 -07:00
@@ -115,7 +115,7 @@
  * In this case read_buffer_size should exceed the maximal packet length
  * (417 for datalog uploads), and packet_timeout should be set.
  */
-static size_t read_buffer_size = 480;
+static int read_buffer_size = 480;
 module_param(read_buffer_size, int, 0);
 MODULE_PARM_DESC(read_buffer_size, "Read buffer size");
 
@@ -125,7 +125,7 @@
  * A problem with long writes is that the following read may time out
  * if the software is not prepared to wait long enough.
  */
-static size_t write_buffer_size = 480;
+static int write_buffer_size = 480;
 module_param(write_buffer_size, int, 0);
 MODULE_PARM_DESC(write_buffer_size, "Write buffer size");
 
@@ -714,7 +714,7 @@
        }
 
        /* write the data into interrupt_out_buffer from userspace */
-       bytes_to_write = min(count, write_buffer_size);
+       bytes_to_write = min_t(int, count, write_buffer_size);
        dbg(4, "%s: count = %Zd, bytes_to_write = %Zd", __FUNCTION__, count, 
bytes_to_write);
 
        if (copy_from_user (dev->interrupt_out_buffer, buffer, bytes_to_write)) {



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to