From: Stelian Pop <stelian.pop@fr.alcove.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Linus Torvalds <torvalds@transmeta.com>,
Hugh Dickins <hugh@veritas.com>
Subject: [PATCH 2.4.8-pre1 and 2.4.7-ac1] Motion Eye camera driver updates.
Date: Fri, 27 Jul 2001 15:20:00 +0200 [thread overview]
Message-ID: <20010727152000.B6860@come.alcove-fr> (raw)
This patch applies cleanly to either 2.4.8-pre1 or 2.4.7-ac1
and updates the motion eye camera driver to remove an array
from the stack, and slightly optimize the code.
All the credit goes to Hugh Dickins <hugh@veritas.com>.
Alan, Linus, please apply.
Stelian.
diff -uNr --exclude-from=dontdiff linux-2.4.6-ac5.orig/drivers/media/video/meye.c linux-2.4.6-ac5/drivers/media/video/meye.c
--- linux-2.4.6-ac5.orig/drivers/media/video/meye.c Fri Jul 27 14:27:36 2001
+++ linux-2.4.6-ac5/drivers/media/video/meye.c Thu Jul 26 11:45:57 2001
@@ -209,28 +209,23 @@
/* return a page table pointing to N pages of locked memory */
static void *ptable_alloc(int npages, u32 *pt_addr) {
- int i = 0;
+ int i;
void *vmem;
- u32 ptable[npages+1];
- signed long size;
+ u32 *ptable;
unsigned long adr;
- size = (npages + 1) * PAGE_SIZE;
- vmem = rvmalloc(size);
+ vmem = rvmalloc((npages + 1) * PAGE_SIZE);
if (!vmem)
return NULL;
- memset(ptable, 0, sizeof(ptable));
adr = (unsigned long)vmem;
- while (size > 0) {
- ptable[i++] = virt_to_bus(__va(kvirt_to_pa(adr)));
+ ptable = (u32 *)(vmem + npages * PAGE_SIZE);
+ for (i = 0; i < npages; i++) {
+ ptable[i] = (u32) kvirt_to_bus(adr);
adr += PAGE_SIZE;
- size -= PAGE_SIZE;
}
- memcpy(vmem + npages * PAGE_SIZE, ptable, PAGE_SIZE);
- *pt_addr = ptable[npages];
-
+ *pt_addr = (u32) kvirt_to_bus(adr);
return vmem;
}
diff -uNr --exclude-from=dontdiff linux-2.4.6-ac5.orig/drivers/media/video/meye.h linux-2.4.6-ac5/drivers/media/video/meye.h
--- linux-2.4.6-ac5.orig/drivers/media/video/meye.h Fri Jul 27 14:27:36 2001
+++ linux-2.4.6-ac5/drivers/media/video/meye.h Fri Jul 27 10:12:35 2001
@@ -29,7 +29,7 @@
#define _MEYE_PRIV_H_
#define MEYE_DRIVER_MAJORVERSION 1
-#define MEYE_DRIVER_MINORVERSION 0
+#define MEYE_DRIVER_MINORVERSION 1
/****************************************************************************/
/* Motion JPEG chip registers */
--
Stelian Pop <stelian.pop@fr.alcove.com>
|---------------- Free Software Engineer -----------------|
| Alcôve - http://www.alcove.com - Tel: +33 1 49 22 68 00 |
|------------- Alcôve, liberating software ---------------|
reply other threads:[~2001-07-27 13:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010727152000.B6860@come.alcove-fr \
--to=stelian.pop@fr.alcove.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).