condense for loop
authorMalte S. Stretz <mss@apache.org>
Tue, 11 Jan 2011 00:45:26 +0000 (01:45 +0100)
committerMalte S. Stretz <mss@apache.org>
Tue, 11 Jan 2011 00:46:35 +0000 (01:46 +0100)
ax89063.c

index dc62306..290b1b5 100644 (file)
--- a/ax89063.c
+++ b/ax89063.c
@@ -193,13 +193,12 @@ MODULE_EXPORT void ax89063_flush(Driver *drvthis) {
        FD_ZERO(&fdset);
        FD_SET(p->fd, &fdset);
 
-       ax89063_clear_if_needed(p);
-
        /* Map framebuffer */
-       obuf = p->framebuf_hw + 1;
-       for (ibuf = p->framebuf; ibuf < p->framebuf + p->framebuf_size; ibuf += p->width) {
+       ax89063_clear_if_needed(p);
+       for (ibuf = p->framebuf, obuf = p->framebuf_hw + 1;
+                       ibuf < p->framebuf + p->framebuf_size;
+                       ibuf += p->width, obuf += AX89063_HWFRAMEBUFLEN / p->height) {
                memcpy(obuf, ibuf, p->width);
-               obuf += AX89063_HWFRAMEBUFLEN / p->height;
        }
 
        if ((ret = select(FD_SETSIZE, NULL, &fdset, NULL, &selectTimeout)) < 0) {