[PATCH 2/5] UML - Style fixes in arch/um/os-Linux

2008-02-06 Thread Jeff Dike
Style changes under arch/um/os-Linux:
include trimming
CodingStyle fixes
some printks needed severity indicators 

make_tempfile turns out not to be used outside of mem.c, so it is now
static.  Its declaration in tempfile.h is no longer needed, and
tempfile.h itself is no longer needed.

create_tmp_file was also made static.

checkpatch moans about an EXPORT_SYMBOL in user_syms.c which is part
of a macro definition - this is copying a bit of kernel infrastructure
into the libc side of UML because the kernel headers can't be included
there.

Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>
---
 arch/um/include/tempfile.h   |   11 ---
 arch/um/os-Linux/aio.c   |2 
 arch/um/os-Linux/drivers/ethertap_kern.c |8 +-
 arch/um/os-Linux/drivers/tuntap_kern.c   |6 -
 arch/um/os-Linux/include/file.h  |   13 ---
 arch/um/os-Linux/mem.c   |  101 +++
 arch/um/os-Linux/process.c   |2 
 arch/um/os-Linux/signal.c|2 
 arch/um/os-Linux/skas/process.c  |6 -
 arch/um/os-Linux/sys-i386/registers.c|4 -
 arch/um/os-Linux/sys-x86_64/registers.c  |   21 +++---
 arch/um/os-Linux/uaccess.c   |4 -
 arch/um/os-Linux/user_syms.c |4 -
 arch/um/os-Linux/util.c  |   43 -
 14 files changed, 98 insertions(+), 129 deletions(-)

Index: linux-2.6.22/arch/um/os-Linux/user_syms.c
===
--- linux-2.6.22.orig/arch/um/os-Linux/user_syms.c  2007-12-14 
11:21:17.0 -0500
+++ linux-2.6.22/arch/um/os-Linux/user_syms.c   2007-12-14 11:23:36.0 
-0500
@@ -34,8 +34,8 @@ EXPORT_SYMBOL(printf);
  * good; so the versions of these symbols will always match
  */
 #define EXPORT_SYMBOL_PROTO(sym)   \
-   int sym(void);  \
-   EXPORT_SYMBOL(sym);
+   int sym(void);  \
+   EXPORT_SYMBOL(sym);
 
 extern void readdir64(void) __attribute__((weak));
 EXPORT_SYMBOL(readdir64);
Index: linux-2.6.22/arch/um/include/tempfile.h
===
--- linux-2.6.22.orig/arch/um/include/tempfile.h2007-12-14 
11:21:17.0 -0500
+++ /dev/null   1970-01-01 00:00:00.0 +
@@ -1,11 +0,0 @@
-/* 
- * Copyright (C) 2000, 2001, 2002 Jeff Dike ([EMAIL PROTECTED])
- * Licensed under the GPL
- */
-
-#ifndef __TEMPFILE_H__
-#define __TEMPFILE_H__
-
-extern int make_tempfile(const char *template, char **tempname, int do_unlink);
-
-#endif
Index: linux-2.6.22/arch/um/os-Linux/aio.c
===
--- linux-2.6.22.orig/arch/um/os-Linux/aio.c2007-12-14 11:21:17.0 
-0500
+++ linux-2.6.22/arch/um/os-Linux/aio.c 2007-12-14 11:28:05.0 -0500
@@ -142,7 +142,7 @@ static int do_not_aio(struct aio_thread_
if (actual != req->offset)
return -errno;
 
-   switch(req->type) {
+   switch (req->type) {
case AIO_READ:
n = read(req->io_fd, req->buf, req->len);
break;
Index: linux-2.6.22/arch/um/os-Linux/include/file.h
===
--- linux-2.6.22.orig/arch/um/os-Linux/include/file.h   2007-12-14 
11:21:17.0 -0500
+++ linux-2.6.22/arch/um/os-Linux/include/file.h2007-12-14 
11:23:36.0 -0500
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2002 Jeff Dike ([EMAIL PROTECTED])
+ * Copyright (C) 2002 - 2007 Jeff Dike ([EMAIL PROTECTED],linux.intel}.com)
  * Licensed under the GPL
  */
 
@@ -9,14 +9,3 @@
 #define DEV_NULL "/dev/null"
 
 #endif
-
-/*
- * 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: linux-2.6.22/arch/um/os-Linux/mem.c
===
--- linux-2.6.22.orig/arch/um/os-Linux/mem.c2007-12-14 11:21:17.0 
-0500
+++ linux-2.6.22/arch/um/os-Linux/mem.c 2007-12-14 11:35:12.0 -0500
@@ -1,22 +1,21 @@
+/*
+ * Copyright (C) 2007 Jeff Dike ([EMAIL PROTECTED],linux.intel}.com)
+ * Licensed under the GPL
+ */
+
 #include 
-#include 
 #include 
-#include 
+#include 
 #include 
 #include 
-#include 
 #include 
-#include 
+#include 
 #include 
-#include 
-#include "user.h"
-#include "mem_user.h"
+#include 
 #include "init.h"
-#include "os.h"
-#include "tempfile.h"
 #include "kern_constants.h"
-
-#include 
+#include "os.h"
+#include "user.h"
 
 /* Modified by which_tmpdir, which is called during early boot */
 static char *default_tmpdir = "/tmp";
@@ -33,18 +32,19 @@ static void __init 

[PATCH 2/5] UML - Style fixes in arch/um/os-Linux

2008-02-06 Thread Jeff Dike
Style changes under arch/um/os-Linux:
include trimming
CodingStyle fixes
some printks needed severity indicators 

make_tempfile turns out not to be used outside of mem.c, so it is now
static.  Its declaration in tempfile.h is no longer needed, and
tempfile.h itself is no longer needed.

create_tmp_file was also made static.

checkpatch moans about an EXPORT_SYMBOL in user_syms.c which is part
of a macro definition - this is copying a bit of kernel infrastructure
into the libc side of UML because the kernel headers can't be included
there.

Signed-off-by: Jeff Dike [EMAIL PROTECTED]
---
 arch/um/include/tempfile.h   |   11 ---
 arch/um/os-Linux/aio.c   |2 
 arch/um/os-Linux/drivers/ethertap_kern.c |8 +-
 arch/um/os-Linux/drivers/tuntap_kern.c   |6 -
 arch/um/os-Linux/include/file.h  |   13 ---
 arch/um/os-Linux/mem.c   |  101 +++
 arch/um/os-Linux/process.c   |2 
 arch/um/os-Linux/signal.c|2 
 arch/um/os-Linux/skas/process.c  |6 -
 arch/um/os-Linux/sys-i386/registers.c|4 -
 arch/um/os-Linux/sys-x86_64/registers.c  |   21 +++---
 arch/um/os-Linux/uaccess.c   |4 -
 arch/um/os-Linux/user_syms.c |4 -
 arch/um/os-Linux/util.c  |   43 -
 14 files changed, 98 insertions(+), 129 deletions(-)

Index: linux-2.6.22/arch/um/os-Linux/user_syms.c
===
--- linux-2.6.22.orig/arch/um/os-Linux/user_syms.c  2007-12-14 
11:21:17.0 -0500
+++ linux-2.6.22/arch/um/os-Linux/user_syms.c   2007-12-14 11:23:36.0 
-0500
@@ -34,8 +34,8 @@ EXPORT_SYMBOL(printf);
  * good; so the versions of these symbols will always match
  */
 #define EXPORT_SYMBOL_PROTO(sym)   \
-   int sym(void);  \
-   EXPORT_SYMBOL(sym);
+   int sym(void);  \
+   EXPORT_SYMBOL(sym);
 
 extern void readdir64(void) __attribute__((weak));
 EXPORT_SYMBOL(readdir64);
Index: linux-2.6.22/arch/um/include/tempfile.h
===
--- linux-2.6.22.orig/arch/um/include/tempfile.h2007-12-14 
11:21:17.0 -0500
+++ /dev/null   1970-01-01 00:00:00.0 +
@@ -1,11 +0,0 @@
-/* 
- * Copyright (C) 2000, 2001, 2002 Jeff Dike ([EMAIL PROTECTED])
- * Licensed under the GPL
- */
-
-#ifndef __TEMPFILE_H__
-#define __TEMPFILE_H__
-
-extern int make_tempfile(const char *template, char **tempname, int do_unlink);
-
-#endif
Index: linux-2.6.22/arch/um/os-Linux/aio.c
===
--- linux-2.6.22.orig/arch/um/os-Linux/aio.c2007-12-14 11:21:17.0 
-0500
+++ linux-2.6.22/arch/um/os-Linux/aio.c 2007-12-14 11:28:05.0 -0500
@@ -142,7 +142,7 @@ static int do_not_aio(struct aio_thread_
if (actual != req-offset)
return -errno;
 
-   switch(req-type) {
+   switch (req-type) {
case AIO_READ:
n = read(req-io_fd, req-buf, req-len);
break;
Index: linux-2.6.22/arch/um/os-Linux/include/file.h
===
--- linux-2.6.22.orig/arch/um/os-Linux/include/file.h   2007-12-14 
11:21:17.0 -0500
+++ linux-2.6.22/arch/um/os-Linux/include/file.h2007-12-14 
11:23:36.0 -0500
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2002 Jeff Dike ([EMAIL PROTECTED])
+ * Copyright (C) 2002 - 2007 Jeff Dike ([EMAIL PROTECTED],linux.intel}.com)
  * Licensed under the GPL
  */
 
@@ -9,14 +9,3 @@
 #define DEV_NULL /dev/null
 
 #endif
-
-/*
- * 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: linux-2.6.22/arch/um/os-Linux/mem.c
===
--- linux-2.6.22.orig/arch/um/os-Linux/mem.c2007-12-14 11:21:17.0 
-0500
+++ linux-2.6.22/arch/um/os-Linux/mem.c 2007-12-14 11:35:12.0 -0500
@@ -1,22 +1,21 @@
+/*
+ * Copyright (C) 2007 Jeff Dike ([EMAIL PROTECTED],linux.intel}.com)
+ * Licensed under the GPL
+ */
+
 #include stdio.h
-#include stdlib.h
 #include stddef.h
-#include stdarg.h
+#include stdlib.h
 #include unistd.h
 #include errno.h
-#include string.h
 #include fcntl.h
-#include sys/types.h
+#include string.h
 #include sys/mman.h
-#include sys/statfs.h
-#include user.h
-#include mem_user.h
+#include sys/param.h
 #include init.h
-#include os.h
-#include tempfile.h
 #include kern_constants.h
-
-#include sys/param.h
+#include os.h
+#include user.h
 
 /* Modified by which_tmpdir, which is called