[patch-2.4.0-test1-ac15] optimization in drivers/sgi/char/shmiq.c

From: Tigran Aivazian (tigran@veritas.com)
Date: Mon Jun 12 2000 - 05:43:04 EST


Hi Alan,

Whilst reading Al Viro's dcache-threading patch I pointed out a bit in
shmiq.c that could be slightly optimized. Here is the patch.

this saves a function call (and return), two semaphore operations and a
variable assignment which is not used later on.

Regards,
Tigran

--- drivers/sgi/char/shmiq.c.0 Mon Jun 12 11:35:24 2000
+++ drivers/sgi/char/shmiq.c Mon Jun 12 11:37:47 2000
@@ -278,8 +278,8 @@
                         return -EINVAL;
                 }
                 s = req.arg * sizeof (struct shmqevent) + sizeof (struct sharedMemoryInputQueue);
- v = sys_munmap (vaddr, s);
                 down(&current->mm->mmap_sem);
+ do_munmap (current->mm, vaddr, s);
                 do_mmap (filp, vaddr, s, PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 0);
                 up(&current->mm->mmap_sem);
                 shmiqs [minor].events = req.arg;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:25 EST