ChangeSet 1.2181.4.94, 2005/03/29 22:47:47-08:00, [EMAIL PROTECTED]

        USB: fix up a lot of sparse warnings and bugs in the pwc driver.
        
        Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>



 pwc-ctrl.c  |    4 ++--
 pwc-dec23.c |    4 ++--
 pwc-if.c    |   39 ++++++++++++++++++++-------------------
 3 files changed, 24 insertions(+), 23 deletions(-)


diff -Nru a/drivers/usb/media/pwc/pwc-ctrl.c b/drivers/usb/media/pwc/pwc-ctrl.c
--- a/drivers/usb/media/pwc/pwc-ctrl.c  2005-03-30 15:24:18 -08:00
+++ b/drivers/usb/media/pwc/pwc-ctrl.c  2005-03-30 15:24:18 -08:00
@@ -341,7 +341,7 @@
 
 static inline int set_video_mode_Kiara(struct pwc_device *pdev, int size, int 
frames, int compression, int snapshot)
 {
-       const struct Kiara_table_entry *pChoose = 0;
+       const struct Kiara_table_entry *pChoose = NULL;
        int fps, ret;
        unsigned char buf[12];
        struct Kiara_table_entry RawEntry = {6, 773, 1272, {0xAD, 0xF4, 0x10, 
0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x03, 0x80}};
@@ -1087,7 +1087,7 @@
        return 0;
 }
 
-int pwc_mpt_reset(struct pwc_device *pdev, int flags)
+static int pwc_mpt_reset(struct pwc_device *pdev, int flags)
 {
        unsigned char buf;
        
diff -Nru a/drivers/usb/media/pwc/pwc-dec23.c 
b/drivers/usb/media/pwc/pwc-dec23.c
--- a/drivers/usb/media/pwc/pwc-dec23.c 2005-03-30 15:24:18 -08:00
+++ b/drivers/usb/media/pwc/pwc-dec23.c 2005-03-30 15:24:18 -08:00
@@ -87,7 +87,7 @@
  * Timon: 0 <= ver <= 15
  *
  */
-void fill_table_color(unsigned int version, const unsigned int *romtable, 
+static void fill_table_color(unsigned int version, const unsigned int 
*romtable, 
     unsigned char *p0004, 
     unsigned char *p8004)
 {
@@ -150,7 +150,7 @@
  * precision = (pdev->xx + pdev->yy)
  *
  */
-void fill_table_dc00_d800(unsigned int precision, unsigned int *pdc00, 
unsigned int *pd800)
+static void fill_table_dc00_d800(unsigned int precision, unsigned int *pdc00, 
unsigned int *pd800)
 {
   int i;
   unsigned int offset1, offset2;
diff -Nru a/drivers/usb/media/pwc/pwc-if.c b/drivers/usb/media/pwc/pwc-if.c
--- a/drivers/usb/media/pwc/pwc-if.c    2005-03-30 15:24:18 -08:00
+++ b/drivers/usb/media/pwc/pwc-if.c    2005-03-30 15:24:18 -08:00
@@ -141,7 +141,7 @@
 
 static int pwc_video_open(struct inode *inode, struct file *file);
 static int pwc_video_close(struct inode *inode, struct file *file);
-static ssize_t pwc_video_read(struct file *file, char *buf,
+static ssize_t pwc_video_read(struct file *file, char __user * buf,
                          size_t count, loff_t *ppos);
 static unsigned int pwc_video_poll(struct file *file, poll_table *wait);
 static int  pwc_video_ioctl(struct inode *inode, struct file *file,
@@ -618,7 +618,7 @@
        int i, fst, flen;
        int awake;
        struct pwc_frame_buf *fbuf;
-       unsigned char *fillptr = 0, *iso_buf = 0;
+       unsigned char *fillptr = NULL, *iso_buf = NULL;
 
        awake = 0;
        pdev = (struct pwc_device *)urb->context;
@@ -844,7 +844,7 @@
        pdev->vmax_packet_size = -1;
        for (i = 0; i < idesc->desc.bNumEndpoints; i++)
                if ((idesc->endpoint[i].desc.bEndpointAddress & 0xF) == 
pdev->vendpoint) {
-                       pdev->vmax_packet_size = 
idesc->endpoint[i].desc.wMaxPacketSize;
+                       pdev->vmax_packet_size = 
le16_to_cpu(idesc->endpoint[i].desc.wMaxPacketSize);
                        break;
                }
        
@@ -1170,7 +1170,7 @@
                 device is tricky anyhow.
  */
 
-static ssize_t pwc_video_read(struct file *file, char *buf,
+static ssize_t pwc_video_read(struct file *file, char __user * buf,
                          size_t count, loff_t *ppos)
 {
        struct video_device *vdev = file->private_data;
@@ -1653,7 +1653,8 @@
 
        /* Check if we can handle this device */
        Trace(TRACE_PROBE, "probe() called [%04X %04X], if %d\n", 
-               udev->descriptor.idVendor, udev->descriptor.idProduct, 
+               le16_to_cpu(udev->descriptor.idVendor),
+               le16_to_cpu(udev->descriptor.idProduct),
                intf->altsetting->desc.bInterfaceNumber);
 
        /* the interfaces are probed one by one. We are only interested in the
@@ -1663,8 +1664,8 @@
        if (intf->altsetting->desc.bInterfaceNumber > 0)
                return -ENODEV;
 
-       vendor_id = udev->descriptor.idVendor;
-       product_id = udev->descriptor.idProduct;
+       vendor_id = le16_to_cpu(udev->descriptor.idVendor);
+       product_id = le16_to_cpu(udev->descriptor.idProduct);
 
        if (vendor_id == 0x0471) {
                switch (product_id) {
@@ -1915,7 +1916,7 @@
        pdev->vdev->owner = THIS_MODULE;
        video_set_drvdata(pdev->vdev, pdev);
 
-       pdev->release = udev->descriptor.bcdDevice;
+       pdev->release = le16_to_cpu(udev->descriptor.bcdDevice);
        Trace(TRACE_PROBE, "Release: %04x\n", pdev->release);
 
        /* Now search device_hint[] table for a match, so we can hint a node 
number. */
@@ -2027,7 +2028,7 @@
  * Initialization code & module stuff 
  */
 
-static char *size = NULL;
+static char size[10];
 static int fps = 0;
 static int fbufs = 0;
 static int mbufs = 0;
@@ -2036,23 +2037,23 @@
 static int leds[2] = { -1, -1 };
 static char *dev_hint[MAX_DEV_HINTS] = { };
 
-MODULE_PARM(size, "s");
+module_param_string(size, size, sizeof(size), 0);
 MODULE_PARM_DESC(size, "Initial image size. One of sqcif, qsif, qcif, sif, 
cif, vga");
-MODULE_PARM(fps, "i");
+module_param(fps, int, 0000);
 MODULE_PARM_DESC(fps, "Initial frames per second. Varies with model, useful 
range 5-30");
-MODULE_PARM(fbufs, "i");
+module_param(fbufs, int, 0000);
 MODULE_PARM_DESC(fbufs, "Number of internal frame buffers to reserve");
-MODULE_PARM(mbufs, "i");
+module_param(mbufs, int, 0000);
 MODULE_PARM_DESC(mbufs, "Number of external (mmap()ed) image buffers");
-MODULE_PARM(trace, "i");
+module_param(trace, int, 0000);
 MODULE_PARM_DESC(trace, "For debugging purposes");
-MODULE_PARM(power_save, "i");
+module_param(power_save, bool, 0000);
 MODULE_PARM_DESC(power_save, "Turn power save feature in camera on or off");
-MODULE_PARM(compression, "i");
+module_param(compression, int, 0000);
 MODULE_PARM_DESC(compression, "Preferred compression quality. Range 0 
(uncompressed) to 3 (high compression)");
-MODULE_PARM(leds, "2i");
+module_param_array(leds, int, NULL, 0000);
 MODULE_PARM_DESC(leds, "LED on,off time in milliseconds");
-MODULE_PARM(dev_hint, "0-20s");
+module_param_array(dev_hint, charp, NULL, 0000);
 MODULE_PARM_DESC(dev_hint, "Device node hints");
 
 MODULE_DESCRIPTION("Philips & OEM USB webcam driver");
@@ -2078,7 +2079,7 @@
                Info("Default framerate set to %d.\n", default_fps);
        }
 
-       if (size) {
+       if (size[0]) {
                /* string; try matching with array */
                for (sz = 0; sz < PSZ_MAX; sz++) {
                        if (!strcmp(sizenames[sz], size)) { /* Found! */
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to