Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e7672ec authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds
Browse files

[PATCH] uml: const more data



Make lots of structures const in order to make it obvious that they need no
locking.

Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 48af05ed
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ static void not_configged_free(void *data)
	       "UML\n");
}

static struct chan_ops not_configged_ops = {
static const struct chan_ops not_configged_ops = {
	.init		= not_configged_init,
	.open		= not_configged_open,
	.close		= not_configged_close,
@@ -373,7 +373,7 @@ int console_write_chan(struct list_head *chans, const char *buf, int len)
}

int console_open_chan(struct line *line, struct console *co,
		      struct chan_opts *opts)
		      const struct chan_opts *opts)
{
	int err;

@@ -494,10 +494,10 @@ int chan_config_string(struct list_head *chans, char *str, int size,

struct chan_type {
	char *key;
	struct chan_ops *ops;
	const struct chan_ops *ops;
};

static struct chan_type chan_table[] = {
static const struct chan_type chan_table[] = {
	{ "fd", &fd_ops },

#ifdef CONFIG_NULL_CHAN
@@ -534,10 +534,10 @@ static struct chan_type chan_table[] = {
};

static struct chan *parse_chan(struct line *line, char *str, int device,
			       struct chan_opts *opts)
			       const struct chan_opts *opts)
{
	struct chan_type *entry;
	struct chan_ops *ops;
	const struct chan_type *entry;
	const struct chan_ops *ops;
	struct chan *chan;
	void *data;
	int i;
@@ -582,7 +582,7 @@ static struct chan *parse_chan(struct line *line, char *str, int device,
}

int parse_chan_pair(char *str, struct line *line, int device,
		    struct chan_opts *opts)
		    const struct chan_opts *opts)
{
	struct list_head *chans = &line->chan_list;
	struct chan *new, *chan;
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ struct daemon_data {
	void *dev;
};

extern struct net_user_info daemon_user_info;
extern const struct net_user_info daemon_user_info;

extern int daemon_user_write(int fd, void *buf, int len, 
			     struct daemon_data *pri);
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ static int daemon_write(int fd, struct sk_buff **skb,
				 (struct daemon_data *) &lp->user));
}

static struct net_kern_info daemon_kern_info = {
static const struct net_kern_info daemon_kern_info = {
	.init			= daemon_init,
	.protocol		= eth_protocol,
	.read			= daemon_read,
+1 −1
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ static int daemon_set_mtu(int mtu, void *data)
	return(mtu);
}

struct net_user_info daemon_user_info = {
const struct net_user_info daemon_user_info = {
	.init		= daemon_user_init,
	.open		= daemon_open,
	.close	 	= NULL,
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ struct fd_chan {
	char str[sizeof("1234567890\0")];
};

static void *fd_init(char *str, int device, struct chan_opts *opts)
static void *fd_init(char *str, int device, const struct chan_opts *opts)
{
	struct fd_chan *data;
	char *end;
@@ -77,7 +77,7 @@ static void fd_close(int fd, void *d)
	}
}

struct chan_ops fd_ops = {
const struct chan_ops fd_ops = {
	.type		= "fd",
	.init		= fd_init,
	.open		= fd_open,
Loading