Skip to contentSkip to conversation

shm: fix unused warnings on nommu

PATCH In review Mike Frysinger 2 participants 2 messages Jun 5, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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’

---
 ipc/shm.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
ipc/shm.c +5 -2
index faa46da..4259716 100644
@@ -969,10 +969,13 @@ SYSCALL_DEFINE3(shmat, int, shmid, char __user *, shmaddr, int, shmflg)
 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;
+#endif
 
 	if (addr & ~PAGE_MASK)
 		return retval;
Signature · 1 line
1.6.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Mike Frysinger

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’

Quoted 32 lines

---
ipc/shm.c | 7 +++++--

1 files changed, 5 insertions(+), 2 deletions(-)
ipc/shm.c +5 -2
index faa46da..4259716 100644
@@ -969,10 +969,13 @@ SYSCALL_DEFINE3(shmat, int, shmid, char __user *, shmaddr, int, shmflg)
 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;
+#endif
 
 	if (addr & ~PAGE_MASK)
 		return retval;
Signature · 7 lines
1.6.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/