[PATCH] w9966 egcs compile fix

From: Jakob Kemi (jakob.kemi@telia.com)
Date: Sat Jun 29 2002 - 18:03:07 EST


Hi Marcelo!

This patch fixes a compile error in w9966.c with egcs (spotted by Rolf Fokkens)
I also corrected the behavior in w9966_v4l_read() when too much data is
requested data size. It does now return bytes actually read instead of an error
code.
Please apply before 2.4.19 final.

Cheers,
        Jakob

--- w9966.c.2.4.19-rc1 Sat Jun 29 14:23:41 2002
+++ w9966.c Sat Jun 29 14:50:01 2002
@@ -50,23 +50,23 @@
 #include <linux/types.h>
 #include <linux/slab.h>
 
-//#define DEBUG // Uncomment for debug output.
+//#define DEBUG // Define for debug output.
 
 #ifdef DEBUG
 # define DPRINTF(f, a...) \
- do { \
- printk ("%s%s, %d (DEBUG) %s(): ", \
- KERN_DEBUG, __FILE__, __LINE__, __func__); \
- printk (f, ##a); \
- } while (0)
+ do { \
+ printk ("%s%s, %d (DEBUG) %s(): ", \
+ KERN_DEBUG, __FILE__, __LINE__, __func__); \
+ printk (f, ##a); \
+ } while (0)
 # define DASSERT(x) \
- do { \
- if (!x) \
- DPRINTF("Assertion failed at line %d.\n", __LINE__);\
- } while (0)
+ do { \
+ if (!x) \
+ DPRINTF("Assertion failed at line %d.\n", __LINE__); \
+ } while (0)
 #else
-# define DPRINTF(...) do {} while(0)
-# define DASSERT(...) do {} while(0)
+# define DPRINTF(f, a...) do {} while(0)
+# define DASSERT(f, a...) do {} while(0)
 #endif
 
 /*
@@ -1058,7 +1058,7 @@
 
         // Why would anyone want more than this??
         if (count > cam->width * cam->height * 2)
- return -EINVAL;
+ count = cam->width * cam->height * 2;
 
         w9966_wreg(cam, 0x00, 0x02); // Reset ECP-FIFO buffer
         w9966_wreg(cam, 0x00, 0x00); // Return to normal operation
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jun 30 2002 - 22:00:14 EST