Commit 2fe69724 authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds

[PATCH] uml: Make a bunch of driver functions static

Noticed by Frank Sorenson - the methods in arch/um/drivers/tty.c should be 
static.  It turns out that all the channels have the same problem, so these
are all fixed.  These files export only a structure of function pointers, so
that structure should be the only externally visible symbol.
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 34dffb15
......@@ -19,7 +19,7 @@ struct fd_chan {
char str[sizeof("1234567890\0")];
};
void *fd_init(char *str, int device, struct chan_opts *opts)
static void *fd_init(char *str, int device, struct chan_opts *opts)
{
struct fd_chan *data;
char *end;
......@@ -43,7 +43,7 @@ void *fd_init(char *str, int device, struct chan_opts *opts)
return(data);
}
int fd_open(int input, int output, int primary, void *d, char **dev_out)
static int fd_open(int input, int output, int primary, void *d, char **dev_out)
{
struct fd_chan *data = d;
int err;
......@@ -62,7 +62,7 @@ int fd_open(int input, int output, int primary, void *d, char **dev_out)
return(data->fd);
}
void fd_close(int fd, void *d)
static void fd_close(int fd, void *d)
{
struct fd_chan *data = d;
int err;
......@@ -76,7 +76,7 @@ void fd_close(int fd, void *d)
}
}
int fd_console_write(int fd, const char *buf, int n, void *d)
static int fd_console_write(int fd, const char *buf, int n, void *d)
{
struct fd_chan *data = d;
......
......@@ -10,23 +10,24 @@
static int null_chan;
void *null_init(char *str, int device, struct chan_opts *opts)
static void *null_init(char *str, int device, struct chan_opts *opts)
{
return(&null_chan);
}
int null_open(int input, int output, int primary, void *d, char **dev_out)
static int null_open(int input, int output, int primary, void *d,
char **dev_out)
{
*dev_out = NULL;
return(os_open_file(DEV_NULL, of_rdwr(OPENFLAGS()), 0));
}
int null_read(int fd, char *c_out, void *unused)
static int null_read(int fd, char *c_out, void *unused)
{
return(-ENODEV);
}
void null_free(void *data)
static void null_free(void *data)
{
}
......
......@@ -28,7 +28,7 @@ struct port_chan {
char dev[sizeof("32768\0")];
};
void *port_init(char *str, int device, struct chan_opts *opts)
static void *port_init(char *str, int device, struct chan_opts *opts)
{
struct port_chan *data;
void *kern_data;
......@@ -65,7 +65,7 @@ void *port_init(char *str, int device, struct chan_opts *opts)
return(NULL);
}
void port_free(void *d)
static void port_free(void *d)
{
struct port_chan *data = d;
......@@ -73,7 +73,8 @@ void port_free(void *d)
kfree(data);
}
int port_open(int input, int output, int primary, void *d, char **dev_out)
static int port_open(int input, int output, int primary, void *d,
char **dev_out)
{
struct port_chan *data = d;
int fd, err;
......@@ -92,7 +93,7 @@ int port_open(int input, int output, int primary, void *d, char **dev_out)
return(fd);
}
void port_close(int fd, void *d)
static void port_close(int fd, void *d)
{
struct port_chan *data = d;
......@@ -100,7 +101,7 @@ void port_close(int fd, void *d)
os_close_file(fd);
}
int port_console_write(int fd, const char *buf, int n, void *d)
static int port_console_write(int fd, const char *buf, int n, void *d)
{
struct port_chan *data = d;
......
......@@ -22,7 +22,7 @@ struct pty_chan {
char dev_name[sizeof("/dev/pts/0123456\0")];
};
void *pty_chan_init(char *str, int device, struct chan_opts *opts)
static void *pty_chan_init(char *str, int device, struct chan_opts *opts)
{
struct pty_chan *data;
......@@ -34,7 +34,8 @@ void *pty_chan_init(char *str, int device, struct chan_opts *opts)
return(data);
}
int pts_open(int input, int output, int primary, void *d, char **dev_out)
static int pts_open(int input, int output, int primary, void *d,
char **dev_out)
{
struct pty_chan *data = d;
char *dev;
......@@ -63,7 +64,7 @@ int pts_open(int input, int output, int primary, void *d, char **dev_out)
return(fd);
}
int getmaster(char *line)
static int getmaster(char *line)
{
char *pty, *bank, *cp;
int master, err;
......@@ -92,7 +93,8 @@ int getmaster(char *line)
return(-1);
}
int pty_open(int input, int output, int primary, void *d, char **dev_out)
static int pty_open(int input, int output, int primary, void *d,
char **dev_out)
{
struct pty_chan *data = d;
int fd, err;
......@@ -115,7 +117,7 @@ int pty_open(int input, int output, int primary, void *d, char **dev_out)
return(fd);
}
int pty_console_write(int fd, const char *buf, int n, void *d)
static int pty_console_write(int fd, const char *buf, int n, void *d)
{
struct pty_chan *data = d;
......
......@@ -18,7 +18,7 @@ struct tty_chan {
struct termios tt;
};
void *tty_chan_init(char *str, int device, struct chan_opts *opts)
static void *tty_chan_init(char *str, int device, struct chan_opts *opts)
{
struct tty_chan *data;
......@@ -38,7 +38,8 @@ void *tty_chan_init(char *str, int device, struct chan_opts *opts)
return(data);
}
int tty_open(int input, int output, int primary, void *d, char **dev_out)
static int tty_open(int input, int output, int primary, void *d,
char **dev_out)
{
struct tty_chan *data = d;
int fd, err;
......@@ -59,7 +60,7 @@ int tty_open(int input, int output, int primary, void *d, char **dev_out)
return(fd);
}
int tty_console_write(int fd, const char *buf, int n, void *d)
static int tty_console_write(int fd, const char *buf, int n, void *d)
{
struct tty_chan *data = d;
......
......@@ -31,6 +31,7 @@ struct xterm_chan {
int direct_rcv;
};
/* Not static because it's called directly by the tt mode gdb code */
void *xterm_init(char *str, int device, struct chan_opts *opts)
{
struct xterm_chan *data;
......@@ -83,8 +84,11 @@ __uml_setup("xterm=", xterm_setup,
" are 'xterm=gnome-terminal,-t,-x'.\n\n"
);
/* XXX This badly needs some cleaning up in the error paths */
int xterm_open(int input, int output, int primary, void *d, char **dev_out)
/* XXX This badly needs some cleaning up in the error paths
* Not static because it's called directly by the tt mode gdb code
*/
int xterm_open(int input, int output, int primary, void *d,
char **dev_out)
{
struct xterm_chan *data = d;
unsigned long stack;
......@@ -170,6 +174,7 @@ int xterm_open(int input, int output, int primary, void *d, char **dev_out)
return(new);
}
/* Not static because it's called directly by the tt mode gdb code */
void xterm_close(int fd, void *d)
{
struct xterm_chan *data = d;
......@@ -183,12 +188,12 @@ void xterm_close(int fd, void *d)
os_close_file(fd);
}
void xterm_free(void *d)
static void xterm_free(void *d)
{
free(d);
}
int xterm_console_write(int fd, const char *buf, int n, void *d)
static int xterm_console_write(int fd, const char *buf, int n, void *d)
{
struct xterm_chan *data = d;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment