shm: fix unused warnings on nommu [Linux 2.6.30]

This Linux kernel change "shm: fix unused warnings on nommu" is included in the Linux 2.6.30 release. This change is authored by Mike Frysinger <vapier [at]> on Tue Jun 9 16:26:23 2009 -0700. The commit for this change in Linux stable tree is 586c7e6 (patch).

shm: fix unused warnings on nommu

The massive nommu update (8feae131) resulted in these warnings:
ipc/shm.c: In function `sys_shmdt':
ipc/shm.c:974: warning: unused variable `size'
ipc/shm.c:972: warning: unused variable `next'

Signed-off-by: Mike Frysinger <[email protected]>
Cc: David Howells <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>

There are 7 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 ipc/shm.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ipc/shm.c b/ipc/shm.c
index faa46da..4259716 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -969,10 +969,13 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
 SYSCALL_DEFINE1(shmdt, char __user *, shmaddr)
    struct mm_struct *mm = current->mm;
-   struct vm_area_struct *vma, *next;
+   struct vm_area_struct *vma;
    unsigned long addr = (unsigned long)shmaddr;
-   loff_t size = 0;
    int retval = -EINVAL;
+#ifdef CONFIG_MMU
+   loff_t size = 0;
+   struct vm_area_struct *next;

    if (addr & ~PAGE_MASK)
        return retval;

Leave a Reply

Your email address will not be published. Required fields are marked *