Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=93566ad8068a968c3e72951b4539eb9da661446d
Commit:     93566ad8068a968c3e72951b4539eb9da661446d
Parent:     cf3c34c87f921c5c63d47285c9860345cdaf5170
Author:     Trent Piepho <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 7 18:19:49 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 15:44:19 2007 -0300

    V4L/DVB (5392): Zr364xx: Use kernel's byte-swapping function
    
    Some code to swap bytes wasn't using the swab16() function that the
    kernel provides for this.  Make use of it, which results in more
    efficient code.
    
    Signed-off-by: Trent Piepho <[EMAIL PROTECTED]>
    Acked-by: Antoine Jacquet <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/zr364xx.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c
index 16bb357..b5d3364 100644
--- a/drivers/media/video/zr364xx.c
+++ b/drivers/media/video/zr364xx.c
@@ -277,7 +277,7 @@ static unsigned char header3;
 static int read_frame(struct zr364xx_camera *cam, int framenum)
 {
        int i, n, temp, head, size, actual_length;
-       unsigned char *ptr = NULL, *jpeg, swap;
+       unsigned char *ptr = NULL, *jpeg;
 
       redo:
        /* hardware brightness */
@@ -308,12 +308,11 @@ static int read_frame(struct zr364xx_camera *cam, int 
framenum)
                }
 
                /* swap bytes if camera needs it */
-               if (cam->method == METHOD0)
-                       for (i = 0; i < BUFFER_SIZE; i += 2) {
-                               swap = cam->buffer[i];
-                               cam->buffer[i] = cam->buffer[i + 1];
-                               cam->buffer[i + 1] = swap;
-                       }
+               if (cam->method == METHOD0) {
+                       u16 *buf = (u16*)cam->buffer;
+                       for (i = 0; i < BUFFER_SIZE/2; i++)
+                               swab16s(buf + i);
+               }
 
                /* write the JPEG header */
                if (!head) {
-
To unsubscribe from this list: send the line "unsubscribe git-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