]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] uml: const more data
authorJeff Dike <jdike@addtoit.com>
Wed, 27 Sep 2006 08:50:33 +0000 (01:50 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 27 Sep 2006 15:26:15 +0000 (08:26 -0700)
Make lots of structures const in order to make it obvious that they need no
locking.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
40 files changed:
arch/um/drivers/chan_kern.c
arch/um/drivers/daemon.h
arch/um/drivers/daemon_kern.c
arch/um/drivers/daemon_user.c
arch/um/drivers/fd.c
arch/um/drivers/hostaudio_kern.c
arch/um/drivers/line.c
arch/um/drivers/mcast.h
arch/um/drivers/mcast_kern.c
arch/um/drivers/mcast_user.c
arch/um/drivers/mmapper_kern.c
arch/um/drivers/null.c
arch/um/drivers/pcap_kern.c
arch/um/drivers/pcap_user.c
arch/um/drivers/port_user.c
arch/um/drivers/pty.c
arch/um/drivers/random.c
arch/um/drivers/slip.h
arch/um/drivers/slip_kern.c
arch/um/drivers/slip_user.c
arch/um/drivers/slirp.h
arch/um/drivers/slirp_kern.c
arch/um/drivers/slirp_user.c
arch/um/drivers/ssl.c
arch/um/drivers/stdio_console.c
arch/um/drivers/tty.c
arch/um/drivers/xterm.c
arch/um/include/chan_kern.h
arch/um/include/chan_user.h
arch/um/include/kern_util.h
arch/um/include/line.h
arch/um/include/net_kern.h
arch/um/kernel/trap.c
arch/um/kernel/um_arch.c
arch/um/os-Linux/drivers/etap.h
arch/um/os-Linux/drivers/ethertap_kern.c
arch/um/os-Linux/drivers/ethertap_user.c
arch/um/os-Linux/drivers/tuntap.h
arch/um/os-Linux/drivers/tuntap_kern.c
arch/um/os-Linux/drivers/tuntap_user.c

index e82764f75e7f149c5144f3d4d984c9cac990c06b..3576b3cc505e65432a3068dbce33f6aecc1f666b 100644 (file)
@@ -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;
index 7326c42f7ef9c9572c1f32488c3ffc2df117afc6..3bc3cf6b94aaf41b2e7e64eeff26ddaa74d36626 100644 (file)
@@ -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);
index 53d09ed78b425391c3e118f998fcd0f89a146691..824386974f88902469f2d95713ae9e4bf6a2928f 100644 (file)
@@ -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,
index c944265955e203f9a11892f2283e3900aebcef11..77954ea77043796217b22f83e3ef0d9d3b8c7c14 100644 (file)
@@ -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,
index c41f75e4acb5a64d733af6534837026421f52037..108b7dafbd0e99a6d0cf9a9d82ca26ed6d1ac5f1 100644 (file)
@@ -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,
index 37232f908cd74e1c86e88874f68f41bb342fabcf..d247ef45c374c3cb620f6e741035c310f428d4d6 100644 (file)
@@ -280,7 +280,7 @@ static int hostmixer_release(struct inode *inode, struct file *file)
 
 /* kernel module operations */
 
-static struct file_operations hostaudio_fops = {
+static const struct file_operations hostaudio_fops = {
         .owner          = THIS_MODULE,
         .llseek         = no_llseek,
         .read           = hostaudio_read,
@@ -292,7 +292,7 @@ static struct file_operations hostaudio_fops = {
         .release        = hostaudio_release,
 };
 
-static struct file_operations hostmixer_fops = {
+static const struct file_operations hostmixer_fops = {
         .owner          = THIS_MODULE,
         .llseek         = no_llseek,
         .ioctl          = hostmixer_ioctl_mixdev,
index ebebaabb78ad75150ff818cd092f7c918b3fe7dd..563ce7690a1eb66ccf38376da5c68c591666a7ea 100644 (file)
@@ -251,7 +251,7 @@ void line_set_termios(struct tty_struct *tty, struct termios * old)
        /* nothing */
 }
 
-static struct {
+static const struct {
        int  cmd;
        char *level;
        char *name;
@@ -405,7 +405,7 @@ static irqreturn_t line_write_interrupt(int irq, void *data,
 
 int line_setup_irq(int fd, int input, int output, struct line *line, void *data)
 {
-       struct line_driver *driver = line->driver;
+       const struct line_driver *driver = line->driver;
        int err = 0, flags = IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM;
 
        if (input)
@@ -558,7 +558,7 @@ int line_setup(struct line *lines, unsigned int num, char *init)
 }
 
 int line_config(struct line *lines, unsigned int num, char *str,
-               struct chan_opts *opts)
+               const struct chan_opts *opts)
 {
        struct line *line;
        char *new;
index a2c6db243458972a7eb8dab4c244d29cb0f685b9..bc56af9d3e534a6d4fb874597d2a719564ad5f26 100644 (file)
@@ -13,7 +13,7 @@ struct mcast_data {
        void *dev;
 };
 
-extern struct net_user_info mcast_user_info;
+extern const struct net_user_info mcast_user_info;
 
 extern int mcast_user_write(int fd, void *buf, int len, 
                            struct mcast_data *pri);
index 3a7af18cf9442f1c890ea674d9a8f33784a825a4..c090fbd464e7c9c7713d0eb6456aa859d69eb831 100644 (file)
@@ -61,7 +61,7 @@ static int mcast_write(int fd, struct sk_buff **skb,
                                 (struct mcast_data *) &lp->user);
 }
 
-static struct net_kern_info mcast_kern_info = {
+static const struct net_kern_info mcast_kern_info = {
        .init                   = mcast_init,
        .protocol               = eth_protocol,
        .read                   = mcast_read,
index afe85bfa66e0872eabc55cd1e0b25dace52900bc..4d2bd39a85bc16ff7dc685b908dad366fa82cac0 100644 (file)
@@ -152,7 +152,7 @@ static int mcast_set_mtu(int mtu, void *data)
        return(mtu);
 }
 
-struct net_user_info mcast_user_info = {
+const struct net_user_info mcast_user_info = {
        .init           = mcast_user_init,
        .open           = mcast_open,
        .close          = mcast_close,
index 022f67bb687364f2934b388fca57f703f53c2bfe..9a3b5daf6250784c1359f8997e115eac3ab8f29b 100644 (file)
@@ -85,7 +85,7 @@ mmapper_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations mmapper_fops = {
+static const struct file_operations mmapper_fops = {
        .owner          = THIS_MODULE,
        .read           = mmapper_read,
        .write          = mmapper_write,
@@ -95,7 +95,7 @@ static struct file_operations mmapper_fops = {
        .release        = mmapper_release,
 };
 
-static struct miscdevice mmapper_dev = {
+static const struct miscdevice mmapper_dev = {
        .minor          = MISC_DYNAMIC_MINOR,
        .name           = "mmapper",
        .fops           = &mmapper_fops
index 14cc5f78398ad4363968278ba30e2dbe981e30e4..3683ed44315d6e2da21707c9293bf82eb22e326b 100644 (file)
@@ -10,7 +10,7 @@
 
 static int null_chan;
 
-static void *null_init(char *str, int device, struct chan_opts *opts)
+static void *null_init(char *str, int device, const struct chan_opts *opts)
 {
        return(&null_chan);
 }
@@ -31,7 +31,7 @@ static void null_free(void *data)
 {
 }
 
-struct chan_ops null_ops = {
+const struct chan_ops null_ops = {
        .type           = "null",
        .init           = null_init,
        .open           = null_open,
index 4c767c7adb964d5546383a4b20e57302334efc2a..6e1ef8558283254faf6c28f462cf71b90cb6626f 100644 (file)
@@ -46,7 +46,7 @@ static int pcap_write(int fd, struct sk_buff **skb, struct uml_net_private *lp)
        return(-EPERM);
 }
 
-static struct net_kern_info pcap_kern_info = {
+static const struct net_kern_info pcap_kern_info = {
        .init                   = pcap_init,
        .protocol               = eth_protocol,
        .read                   = pcap_read,
index edfcb29273e1abf19f601d523a4b125cdc35289f..2ef641ded960a96670456b5d2f1b56914a689c42 100644 (file)
@@ -120,7 +120,7 @@ int pcap_user_read(int fd, void *buffer, int len, struct pcap_data *pri)
        return(hdata.len);
 }
 
-struct net_user_info pcap_user_info = {
+const struct net_user_info pcap_user_info = {
        .init           = pcap_user_init,
        .open           = pcap_open,
        .close          = NULL,
index c43e8bb3250264940af52ea528fe6a378fe41f67..f2e8fc42ecc2df4a2ec7bfe247ab7ec12fe1659c 100644 (file)
@@ -27,7 +27,7 @@ struct port_chan {
        char dev[sizeof("32768\0")];
 };
 
-static void *port_init(char *str, int device, struct chan_opts *opts)
+static void *port_init(char *str, int device, const struct chan_opts *opts)
 {
        struct port_chan *data;
        void *kern_data;
@@ -100,7 +100,7 @@ static void port_close(int fd, void *d)
        os_close_file(fd);
 }
 
-struct chan_ops port_ops = {
+const struct chan_ops port_ops = {
        .type           = "port",
        .init           = port_init,
        .open           = port_open,
index 1c555c38de4d0184adb129755058b71a1449553f..abec620e838030d43e7a01626cb82c5c041ed63f 100644 (file)
@@ -22,7 +22,7 @@ struct pty_chan {
        char dev_name[sizeof("/dev/pts/0123456\0")];
 };
 
-static void *pty_chan_init(char *str, int device, struct chan_opts *opts)
+static void *pty_chan_init(char *str, int device, const struct chan_opts *opts)
 {
        struct pty_chan *data;
 
@@ -118,7 +118,7 @@ static int pty_open(int input, int output, int primary, void *d,
        return(fd);
 }
 
-struct chan_ops pty_ops = {
+const struct chan_ops pty_ops = {
        .type           = "pty",
        .init           = pty_chan_init,
        .open           = pty_open,
@@ -131,7 +131,7 @@ struct chan_ops pty_ops = {
        .winch          = 0,
 };
 
-struct chan_ops pts_ops = {
+const struct chan_ops pts_ops = {
        .type           = "pts",
        .init           = pty_chan_init,
        .open           = pts_open,
index ba471f5864a6d7d6815f3847a36aa78b4ed1a5e3..ae9909415b9cdb372c1f1f0c1602a21a4c2e86b3 100644 (file)
@@ -68,7 +68,7 @@ static ssize_t rng_dev_read (struct file *filp, char __user *buf, size_t size,
        return ret;
 }
 
-static struct file_operations rng_chrdev_ops = {
+static const struct file_operations rng_chrdev_ops = {
        .owner          = THIS_MODULE,
        .open           = rng_dev_open,
        .read           = rng_dev_read,
index bb0dab41c2e43a464f5e7dbfe15c28aca84a197c..c64f8c61d2743bc7a75cfea4712a40a3063eb128 100644 (file)
@@ -12,7 +12,7 @@ struct slip_data {
        struct slip_proto slip;
 };
 
-extern struct net_user_info slip_user_info;
+extern const struct net_user_info slip_user_info;
 
 extern int slip_user_read(int fd, void *buf, int len, struct slip_data *pri);
 extern int slip_user_write(int fd, void *buf, int len, struct slip_data *pri);
index 163ee0d5f75e4e165c312a47b02d2af8975f4be9..ccea2d7885e58d2937df864a30e61db69d3f7b77 100644 (file)
@@ -61,7 +61,7 @@ static int slip_write(int fd, struct sk_buff **skb,
                               (struct slip_data *) &lp->user));
 }
 
-struct net_kern_info slip_kern_info = {
+const struct net_kern_info slip_kern_info = {
        .init                   = slip_init,
        .protocol               = slip_protocol,
        .read                   = slip_read,
index 89fbec185cc16ec10d2d8df49410cf8bb32080a1..8460285c69a5cea3e0b842d0b5cd792d84c38aef 100644 (file)
@@ -241,7 +241,7 @@ static void slip_del_addr(unsigned char *addr, unsigned char *netmask,
        close_addr(addr, netmask, pri->name);
 }
 
-struct net_user_info slip_user_info = {
+const struct net_user_info slip_user_info = {
        .init           = slip_user_init,
        .open           = slip_open,
        .close          = slip_close,
index 6cf88ab580c99a7828fbf545fa8b427ec8b862b5..89ccf83b757718b7c4617df8d1e223138a5a2f39 100644 (file)
@@ -24,7 +24,7 @@ struct slirp_data {
        struct slip_proto slip;
 };
 
-extern struct net_user_info slirp_user_info;
+extern const struct net_user_info slirp_user_info;
 
 extern int slirp_user_read(int fd, void *buf, int len, struct slirp_data *pri);
 extern int slirp_user_write(int fd, void *buf, int len,
index 95e50c943e14f52c7770be2788d5f598cab64adf..ae322e1c8a8753e3794c18cafa20d5d3af6d9b2d 100644 (file)
@@ -64,7 +64,7 @@ static int slirp_write(int fd, struct sk_buff **skb,
                               (struct slirp_data *) &lp->user));
 }
 
-struct net_kern_info slirp_kern_info = {
+const struct net_kern_info slirp_kern_info = {
        .init                   = slirp_init,
        .protocol               = slirp_protocol,
        .read                   = slirp_read,
index 33c5f6e625e83eecc26a97b774dffa6fe1bbb750..ce5e85d1de3d8029ca968033d2d66117de66abcf 100644 (file)
@@ -126,7 +126,7 @@ static int slirp_set_mtu(int mtu, void *data)
        return(mtu);
 }
 
-struct net_user_info slirp_user_info = {
+const struct net_user_info slirp_user_info = {
        .init           = slirp_user_init,
        .open           = slirp_open,
        .close          = slirp_close,
index 6dafd6fbfdaed13be0f48424f1e811fd24955b89..6f13e7c71a82f3ecb00ccf44e24c0cfc8fafc9fd 100644 (file)
@@ -23,7 +23,7 @@
 #include "irq_user.h"
 #include "mconsole_kern.h"
 
-static int ssl_version = 1;
+static const int ssl_version = 1;
 
 /* Referenced only by tty_driver below - presumably it's locked correctly
  * by the tty driver.
@@ -123,7 +123,7 @@ void ssl_hangup(struct tty_struct *tty)
 }
 #endif
 
-static struct tty_operations ssl_ops = {
+static const struct tty_operations ssl_ops = {
        .open                   = ssl_open,
        .close                  = line_close,
        .write                  = line_write,
index 856f568c2687fd485a111d2f68843bb3918ac7dc..5e44adb07051723333236caa67d9358e2cb7aabc 100644 (file)
@@ -110,7 +110,7 @@ static int con_open(struct tty_struct *tty, struct file *filp)
 
 static int con_init_done = 0;
 
-static struct tty_operations console_ops = {
+static const struct tty_operations console_ops = {
        .open                   = con_open,
        .close                  = line_close,
        .write                  = line_write,
index 9f70edf5d8ef027c645de108ef9cd901f0f8cd27..11de3ac1eb5c787512b4c1a71f6ac1a16cd6725b 100644 (file)
@@ -18,7 +18,7 @@ struct tty_chan {
        struct termios tt;
 };
 
-static void *tty_chan_init(char *str, int device, struct chan_opts *opts)
+static void *tty_chan_init(char *str, int device, const struct chan_opts *opts)
 {
        struct tty_chan *data;
 
@@ -62,7 +62,7 @@ static int tty_open(int input, int output, int primary, void *d,
        return fd;
 }
 
-struct chan_ops tty_ops = {
+const struct chan_ops tty_ops = {
        .type           = "tty",
        .init           = tty_chan_init,
        .open           = tty_open,
index aaa63666104333f487d01521bb6792250cb40a14..386f8b952982e4317f5254e4016a2e7ba18597d1 100644 (file)
@@ -31,7 +31,7 @@ struct xterm_chan {
 };
 
 /* Not static because it's called directly by the tt mode gdb code */
-void *xterm_init(char *str, int device, struct chan_opts *opts)
+void *xterm_init(char *str, int device, const struct chan_opts *opts)
 {
        struct xterm_chan *data;
 
@@ -194,7 +194,7 @@ static void xterm_free(void *d)
        free(d);
 }
 
-struct chan_ops xterm_ops = {
+const struct chan_ops xterm_ops = {
        .type           = "xterm",
        .init           = xterm_init,
        .open           = xterm_open,
index 1bb5e9d94270493959ef0ffa7053a8cc6d6ce300..572d286ed2c666e21faa970fd2a88f5658056c9a 100644 (file)
@@ -23,21 +23,21 @@ struct chan {
        unsigned int opened:1;
        unsigned int enabled:1;
        int fd;
-       struct chan_ops *ops;
+       const struct chan_ops *ops;
        void *data;
 };
 
 extern void chan_interrupt(struct list_head *chans, struct work_struct *task,
                           struct tty_struct *tty, int irq);
 extern int parse_chan_pair(char *str, struct line *line, int device,
-                          struct chan_opts *opts);
+                          const struct chan_opts *opts);
 extern int open_chan(struct list_head *chans);
 extern int write_chan(struct list_head *chans, const char *buf, int len,
                             int write_irq);
 extern int console_write_chan(struct list_head *chans, const char *buf, 
                              int len);
 extern int console_open_chan(struct line *line, struct console *co,
-                            struct chan_opts *opts);
+                            const struct chan_opts *opts);
 extern void deactivate_chan(struct list_head *chans, int irq);
 extern void reactivate_chan(struct list_head *chans, int irq);
 extern void chan_enable_winch(struct list_head *chans, struct tty_struct *tty);
index 659bb3cac32f51f3e7f8017bd137270e068cabf6..a795547a1dbdb5217563457761bd0f13c2a557e4 100644 (file)
@@ -20,7 +20,7 @@ enum chan_init_pri { INIT_STATIC, INIT_ALL, INIT_ONE };
 
 struct chan_ops {
        char *type;
-       void *(*init)(char *, int, struct chan_opts *);
+       void *(*init)(char *, int, const struct chan_opts *);
        int (*open)(int, int, int, void *, char **);
        void (*close)(int, void *);
        int (*read)(int, char *, void *);
@@ -31,8 +31,8 @@ struct chan_ops {
        int winch;
 };
 
-extern struct chan_ops fd_ops, null_ops, port_ops, pts_ops, pty_ops, tty_ops,
-       xterm_ops;
+extern const struct chan_ops fd_ops, null_ops, port_ops, pts_ops, pty_ops,
+       tty_ops, xterm_ops;
 
 extern void generic_close(int fd, void *unused);
 extern int generic_read(int fd, char *c_out, void *unused);
index 89e1dc835a5bf0281a7fd38b156d7b4ffe72789d..59cfa9e0cad034739c3add89720269c01f0177c2 100644 (file)
@@ -21,7 +21,7 @@ struct kern_handlers {
        kern_hndl timer_handler;
 };
 
-extern struct kern_handlers handlinfo_kern;
+extern const struct kern_handlers handlinfo_kern;
 
 extern int ncpus;
 extern char *linux_prog;
index 27bf2f6fbc05a60d398cb9b2b8ef0a51605711b2..642c9a0320f9a111af988a8dead98a08ef107efb 100644 (file)
@@ -52,7 +52,7 @@ struct line {
 
        int sigio;
        struct work_struct task;
-       struct line_driver *driver;
+       const struct line_driver *driver;
        int have_irq;
 };
 
@@ -99,7 +99,7 @@ extern void lines_init(struct line *lines, int nlines, struct chan_opts *opts);
 extern void close_lines(struct line *lines, int nlines);
 
 extern int line_config(struct line *lines, unsigned int sizeof_lines,
-                      char *str, struct chan_opts *opts);
+                      char *str, const struct chan_opts *opts);
 extern int line_id(char **str, int *start_out, int *end_out);
 extern int line_remove(struct line *lines, unsigned int sizeof_lines, int n);
 extern int line_get_config(char *dev, struct line *lines,
index f7de6df60dd717f1ba2a16fc563ecee853a5fe7a..769fba43ee039a2bfb93fd33d32f23a49ba623cd 100644 (file)
@@ -54,8 +54,8 @@ struct transport {
        struct list_head list;
        char *name;
        int (*setup)(char *, char **, void *);
-       struct net_user_info *user;
-       struct net_kern_info *kern;
+       const struct net_user_info *user;
+       const struct net_kern_info *kern;
        int private_size;
        int setup_size;
 };
index e5eeaf2b6af118c33401528a0e03ff206af15ed9..e44ff6eca4962648bce6f711c2ddf4556603fdc7 100644 (file)
@@ -140,7 +140,7 @@ void segv_handler(int sig, union uml_pt_regs *regs)
        segv(*fi, UPT_IP(regs), UPT_IS_USER(regs), regs);
 }
 
-struct kern_handlers handlinfo_kern = {
+const struct kern_handlers handlinfo_kern = {
        .relay_signal = relay_signal,
        .winch = winch,
        .bus_handler = relay_signal,
index 7896cf98232df1a06c6593957e24597b8dbb7e04..55005710dcbbc8254fc3bbea46f3f3b6ad065ad1 100644 (file)
@@ -106,7 +106,7 @@ static void c_stop(struct seq_file *m, void *v)
 {
 }
 
-struct seq_operations cpuinfo_op = {
+const struct seq_operations cpuinfo_op = {
        .start  = c_start,
        .next   = c_next,
        .stop   = c_stop,
index b84f6c4740f74efc9389c2e042a0de3198649707..57ecdaf2f67e872f029da7a8b501f970e4950d1b 100644 (file)
@@ -13,7 +13,7 @@ struct ethertap_data {
        void *dev;
 };
 
-extern struct net_user_info ethertap_user_info;
+extern const struct net_user_info ethertap_user_info;
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
index 768606bec233222de64a8698b535a62e4a472157..16385e2ada854ebd1c965364a6d065f709294c3f 100644 (file)
@@ -65,7 +65,7 @@ static int etap_write(int fd, struct sk_buff **skb, struct uml_net_private *lp)
        return(net_send(fd, (*skb)->data, (*skb)->len));
 }
 
-struct net_kern_info ethertap_kern_info = {
+const struct net_kern_info ethertap_kern_info = {
        .init                   = etap_init,
        .protocol               = eth_protocol,
        .read                   = etap_read,
index 8f49507e64ef5ac0091fe22189bea6413e427469..f559bdf746e6099bfb7593215ded118626a899df 100644 (file)
@@ -216,7 +216,7 @@ static void etap_del_addr(unsigned char *addr, unsigned char *netmask,
        etap_close_addr(addr, netmask, &pri->control_fd);
 }
 
-struct net_user_info ethertap_user_info = {
+const struct net_user_info ethertap_user_info = {
        .init           = etap_user_init,
        .open           = etap_open,
        .close          = etap_close,
index 25d4a2868814bdd83ebd083448d1006a3e1962af..d3e8d3af62454af21338709d5dda4c80996ee62f 100644 (file)
@@ -16,7 +16,7 @@ struct tuntap_data {
        void *dev;
 };
 
-extern struct net_user_info tuntap_user_info;
+extern const struct net_user_info tuntap_user_info;
 
 #endif
 
index 190009a6f89cd2a713f8b6a44fc1b1b12bff6c0e..0edbac63c52708009ac792442fee6eb75dc2fbb5 100644 (file)
@@ -53,7 +53,7 @@ static int tuntap_write(int fd, struct sk_buff **skb,
        return(net_write(fd, (*skb)->data, (*skb)->len));
 }
 
-struct net_kern_info tuntap_kern_info = {
+const struct net_kern_info tuntap_kern_info = {
        .init                   = tuntap_init,
        .protocol               = eth_protocol,
        .read                   = tuntap_read,
index 87c3aa0252db5530190d0ac0837dfe8ec55d3aa6..e846b23f7558582e8bf51f09a18d91b698c25f65 100644 (file)
@@ -205,7 +205,7 @@ static int tuntap_set_mtu(int mtu, void *data)
        return(mtu);
 }
 
-struct net_user_info tuntap_user_info = {
+const struct net_user_info tuntap_user_info = {
        .init           = tuntap_user_init,
        .open           = tuntap_open,
        .close          = tuntap_close,