[PATCH] uml: fix a couple of warnings
authorJeff Dike <jdike@addtoit.com>
Sat, 28 May 2005 22:51:53 +0000 (15:51 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 28 May 2005 23:46:11 +0000 (16:46 -0700)
Eliminate an unused variable warning in ptrace.c and a size mismatch warning
by adding a cast to __pa.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/um/kernel/ptrace.c
include/asm-um/page.h

index 2925e15324de370b29689b9587cc6311d95f935a..71af4d5038994014f12e5030dd3187bcbaae9450 100644 (file)
@@ -322,11 +322,9 @@ void syscall_trace(union uml_pt_regs *regs, int entryexit)
                                            UPT_SYSCALL_ARG2(regs),
                                            UPT_SYSCALL_ARG3(regs),
                                            UPT_SYSCALL_ARG4(regs));
-               else {
-                        int res = UPT_SYSCALL_RET(regs);
-                       audit_syscall_exit(current, AUDITSC_RESULT(res),
-                                           res);
-                }
+               else audit_syscall_exit(current,
+                                        AUDITSC_RESULT(UPT_SYSCALL_RET(regs)),
+                                        UPT_SYSCALL_RET(regs));
        }
 
        /* Fake a debug trap */
@@ -356,14 +354,3 @@ void syscall_trace(union uml_pt_regs *regs, int entryexit)
                current->exit_code = 0;
        }
 }
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only.  This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
index 504ea8e486b0532d5d70c387cf262d3c92d8a148..5afee8a8cdf39ea0ec3135feab5b45c269daccdd 100644 (file)
@@ -98,7 +98,13 @@ extern unsigned long uml_physmem;
 
 extern unsigned long to_phys(void *virt);
 extern void *to_virt(unsigned long phys);
-#define __pa(virt) to_phys((void *) virt)
+
+/* Cast to unsigned long before casting to void * to avoid a warning from
+ * mmap_kmem about cutting a long long down to a void *.  Not sure that
+ * casting is the right thing, but 32-bit UML can't have 64-bit virtual
+ * addresses
+ */
+#define __pa(virt) to_phys((void *) (unsigned long) virt)
 #define __va(phys) to_virt((unsigned long) phys)
 
 #define page_to_pfn(page) ((page) - mem_map)