Commit 34b69bd4 authored by Jeff Dike's avatar Jeff Dike

Converted all initializers over to C99 syntax.

parent 6cc944b6
......@@ -75,15 +75,15 @@ static void not_configged_free(void *data)
}
static struct chan_ops not_configged_ops = {
init: not_configged_init,
open: not_configged_open,
close: not_configged_close,
read: not_configged_read,
write: not_configged_write,
console_write: not_configged_console_write,
window_size: not_configged_window_size,
free: not_configged_free,
winch: 0,
.init = not_configged_init,
.open = not_configged_open,
.close = not_configged_close,
.read = not_configged_read,
.write = not_configged_write,
.console_write = not_configged_console_write,
.window_size = not_configged_window_size,
.free = not_configged_free,
.winch = 0,
};
static void tty_receive_char(struct tty_struct *tty, char ch)
......@@ -395,15 +395,15 @@ static struct chan *parse_chan(char *str, int pri, int device,
chan = kmalloc(sizeof(*chan), GFP_KERNEL);
if(chan == NULL) return(NULL);
*chan = ((struct chan) { list : LIST_HEAD_INIT(chan->list),
primary : 1,
input : 0,
output : 0,
opened : 0,
fd : -1,
pri : pri,
ops : ops,
data : data });
*chan = ((struct chan) { .list = LIST_HEAD_INIT(chan->list),
.primary = 1,
.input = 0,
.output = 0,
.opened = 0,
.fd = -1,
.pri = pri,
.ops = ops,
.data = data });
return(chan);
}
......
......@@ -159,9 +159,9 @@ static int winch_tramp(int fd, void *device_data, int *fd_out)
return(err);
}
data = ((struct winch_data) { pty_fd : fd,
pipe_fd : fds[1],
close_me : fds[0] } );
data = ((struct winch_data) { .pty_fd = fd,
.pipe_fd = fds[1],
.close_me = fds[0] } );
pid = run_helper_thread(winch_thread, &data, 0, &stack, 0);
if(pid < 0){
printk("fork of winch_thread failed - errno = %d\n", errno);
......
......@@ -28,14 +28,14 @@ void daemon_init(struct net_device *dev, void *data)
pri = dev->priv;
dpri = (struct daemon_data *) pri->user;
*dpri = ((struct daemon_data)
{ sock_type : init->sock_type,
ctl_sock : init->ctl_sock,
ctl_addr : NULL,
data_addr : NULL,
local_addr : NULL,
fd : -1,
control : -1,
dev : dev });
{ .sock_type = init->sock_type,
.ctl_sock = init->ctl_sock,
.ctl_addr = NULL,
.data_addr = NULL,
.local_addr = NULL,
.fd = -1,
.control = -1,
.dev = dev });
printk("daemon backend (uml_switch version %d) - %s:%s",
SWITCH_VERSION, dpri->sock_type, dpri->ctl_sock);
......@@ -59,10 +59,10 @@ static int daemon_write(int fd, struct sk_buff **skb,
}
static struct net_kern_info daemon_kern_info = {
init: daemon_init,
protocol: eth_protocol,
read: daemon_read,
write: daemon_write,
.init = daemon_init,
.protocol = eth_protocol,
.read = daemon_read,
.write = daemon_write,
};
int daemon_setup(char *str, char **mac_out, void *data)
......@@ -71,8 +71,8 @@ int daemon_setup(char *str, char **mac_out, void *data)
char *remain;
*init = ((struct daemon_init)
{ sock_type : "unix",
ctl_sock : "/tmp/uml.ctl" });
{ .sock_type = "unix",
.ctl_sock = "/tmp/uml.ctl" });
remain = split_if_spec(str, mac_out, &init->sock_type, &init->ctl_sock,
NULL);
......@@ -84,13 +84,13 @@ int daemon_setup(char *str, char **mac_out, void *data)
}
static struct transport daemon_transport = {
list : LIST_HEAD_INIT(daemon_transport.list),
name : "daemon",
setup : daemon_setup,
user : &daemon_user_info,
kern : &daemon_kern_info,
private_size : sizeof(struct daemon_data),
setup_size : sizeof(struct daemon_init),
.list = LIST_HEAD_INIT(daemon_transport.list),
.name = "daemon",
.setup = daemon_setup,
.user = &daemon_user_info,
.kern = &daemon_kern_info,
.private_size = sizeof(struct daemon_data),
.setup_size = sizeof(struct daemon_init),
};
static int register_daemon(void)
......
......@@ -172,14 +172,14 @@ static int daemon_set_mtu(int mtu, void *data)
}
struct net_user_info daemon_user_info = {
init: daemon_user_init,
open: daemon_open,
close: NULL,
remove: daemon_remove,
set_mtu: daemon_set_mtu,
add_address: NULL,
delete_address: NULL,
max_packet: MAX_PACKET - ETH_HEADER_OTHER
.init = daemon_user_init,
.open = daemon_open,
.close = NULL,
.remove = daemon_remove,
.set_mtu = daemon_set_mtu,
.add_address = NULL,
.delete_address = NULL,
.max_packet = MAX_PACKET - ETH_HEADER_OTHER
};
/*
......
......@@ -36,8 +36,8 @@ void *fd_init(char *str, int device, struct chan_opts *opts)
return(NULL);
}
if((data = um_kmalloc(sizeof(*data))) == NULL) return(NULL);
*data = ((struct fd_chan) { fd : n,
raw : opts->raw });
*data = ((struct fd_chan) { .fd = n,
.raw = opts->raw });
return(data);
}
......@@ -72,16 +72,16 @@ int fd_console_write(int fd, const char *buf, int n, void *d)
}
struct chan_ops fd_ops = {
type: "fd",
init: fd_init,
open: fd_open,
close: fd_close,
read: generic_read,
write: generic_write,
console_write: fd_console_write,
window_size: generic_window_size,
free: generic_free,
winch: 1,
.type = "fd",
.init = fd_init,
.open = fd_open,
.close = fd_close,
.read = generic_read,
.write = generic_write,
.console_write = fd_console_write,
.window_size = generic_window_size,
.free = generic_free,
.winch = 1,
};
/*
......
......@@ -145,17 +145,17 @@ static int harddog_ioctl(struct inode *inode, struct file *file,
}
static struct file_operations harddog_fops = {
owner: THIS_MODULE,
write: harddog_write,
ioctl: harddog_ioctl,
open: harddog_open,
release: harddog_release,
.owner = THIS_MODULE,
.write = harddog_write,
.ioctl = harddog_ioctl,
.open = harddog_open,
.release = harddog_release,
};
static struct miscdevice harddog_miscdev = {
minor: WATCHDOG_MINOR,
name: "watchdog",
fops: &harddog_fops,
.minor = WATCHDOG_MINOR,
.name = "watchdog",
.fops = &harddog_fops,
};
static char banner[] __initdata = KERN_INFO "UML Watchdog Timer\n";
......
......@@ -195,23 +195,23 @@ static int hostmixer_release(struct inode *inode, struct file *file)
/* kernel module operations */
static struct file_operations hostaudio_fops = {
owner: THIS_MODULE,
llseek: no_llseek,
read: hostaudio_read,
write: hostaudio_write,
poll: hostaudio_poll,
ioctl: hostaudio_ioctl,
mmap: NULL,
open: hostaudio_open,
release: hostaudio_release,
.owner = THIS_MODULE,
.llseek = no_llseek,
.read = hostaudio_read,
.write = hostaudio_write,
.poll = hostaudio_poll,
.ioctl = hostaudio_ioctl,
.mmap = NULL,
.open = hostaudio_open,
.release = hostaudio_release,
};
static struct file_operations hostmixer_fops = {
owner: THIS_MODULE,
llseek: no_llseek,
ioctl: hostmixer_ioctl_mixdev,
open: hostmixer_open_mixdev,
release: hostmixer_release,
.owner = THIS_MODULE,
.llseek = no_llseek,
.ioctl = hostmixer_ioctl_mixdev,
.open = hostmixer_open_mixdev,
.release = hostmixer_release,
};
struct {
......
......@@ -511,11 +511,11 @@ void register_winch_irq(int fd, int tty_fd, int pid, void *line)
printk("register_winch_irq - kmalloc failed\n");
goto out;
}
*winch = ((struct winch) { list : LIST_HEAD_INIT(winch->list),
fd : fd,
tty_fd : tty_fd,
pid : pid,
line : line });
*winch = ((struct winch) { .list = LIST_HEAD_INIT(winch->list),
.fd = fd,
.tty_fd = tty_fd,
.pid = pid,
.line = line });
list_add(&winch->list, &winch_handlers);
if(um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt,
SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM,
......
......@@ -36,11 +36,11 @@ void mcast_init(struct net_device *dev, void *data)
pri = dev->priv;
dpri = (struct mcast_data *) pri->user;
*dpri = ((struct mcast_data)
{ addr : init->addr,
port : init->port,
ttl : init->ttl,
mcast_addr : NULL,
dev : dev });
{ .addr = init->addr,
.port = init->port,
.ttl = init->ttl,
.mcast_addr = NULL,
.dev = dev });
printk("mcast backend ");
printk("multicast adddress: %s:%u, TTL:%u ",
dpri->addr, dpri->port, dpri->ttl);
......@@ -64,10 +64,10 @@ static int mcast_write(int fd, struct sk_buff **skb,
}
static struct net_kern_info mcast_kern_info = {
init: mcast_init,
protocol: eth_protocol,
read: mcast_read,
write: mcast_write,
.init = mcast_init,
.protocol = eth_protocol,
.read = mcast_read,
.write = mcast_write,
};
int mcast_setup(char *str, char **mac_out, void *data)
......@@ -78,9 +78,9 @@ int mcast_setup(char *str, char **mac_out, void *data)
int n;
*init = ((struct mcast_init)
{ addr : "239.192.168.1",
port : 1102,
ttl : 1 });
{ .addr = "239.192.168.1",
.port = 1102,
.ttl = 1 });
remain = split_if_spec(str, mac_out, &init->addr, &port_str, &ttl_str,
NULL);
......@@ -116,13 +116,13 @@ int mcast_setup(char *str, char **mac_out, void *data)
}
static struct transport mcast_transport = {
list : LIST_HEAD_INIT(mcast_transport.list),
name : "mcast",
setup : mcast_setup,
user : &mcast_user_info,
kern : &mcast_kern_info,
private_size : sizeof(struct mcast_data),
setup_size : sizeof(struct mcast_init),
.list = LIST_HEAD_INIT(mcast_transport.list),
.name = "mcast",
.setup = mcast_setup,
.user = &mcast_user_info,
.kern = &mcast_kern_info,
.private_size = sizeof(struct mcast_data),
.setup_size = sizeof(struct mcast_init),
};
static int register_mcast(void)
......
......@@ -153,14 +153,14 @@ static int mcast_set_mtu(int mtu, void *data)
}
struct net_user_info mcast_user_info = {
init: mcast_user_init,
open: mcast_open,
close: mcast_close,
remove: NULL,
set_mtu: mcast_set_mtu,
add_address: NULL,
delete_address: NULL,
max_packet: MAX_PACKET - ETH_HEADER_OTHER
.init = mcast_user_init,
.open = mcast_open,
.close = mcast_close,
.remove = NULL,
.set_mtu = mcast_set_mtu,
.add_address = NULL,
.delete_address = NULL,
.max_packet = MAX_PACKET - ETH_HEADER_OTHER
};
/*
......
......@@ -36,8 +36,8 @@ static int do_unlink_socket(struct notifier_block *notifier,
static struct notifier_block reboot_notifier = {
notifier_call: do_unlink_socket,
priority: 0,
.notifier_call = do_unlink_socket,
.priority = 0,
};
/* Safe without explicit locking for now. Tasklets provide their own
......@@ -418,9 +418,9 @@ static int notify_panic(struct notifier_block *self, unsigned long unused1,
}
static struct notifier_block panic_exit_notifier = {
notifier_call : notify_panic,
next : NULL,
priority : 1
.notifier_call = notify_panic,
.next = NULL,
.priority = 1
};
static int add_notifier(void)
......
......@@ -106,13 +106,13 @@ mmapper_release(struct inode *inode, struct file *file)
}
static struct file_operations mmapper_fops = {
owner: THIS_MODULE,
read: mmapper_read,
write: mmapper_write,
ioctl: mmapper_ioctl,
mmap: mmapper_mmap,
open: mmapper_open,
release: mmapper_release,
.owner = THIS_MODULE,
.read = mmapper_read,
.write = mmapper_write,
.ioctl = mmapper_ioctl,
.mmap = mmapper_mmap,
.open = mmapper_open,
.release = mmapper_release,
};
static int __init mmapper_init(void)
......
......@@ -368,22 +368,22 @@ static int eth_configure(int n, void *init, char *mac,
*/
save = lp->user[0];
*lp = ((struct uml_net_private)
{ list : LIST_HEAD_INIT(lp->list),
lock : SPIN_LOCK_UNLOCKED,
dev : dev,
fd : -1,
mac : { 0xfe, 0xfd, 0x0, 0x0, 0x0, 0x0},
have_mac : device->have_mac,
protocol : transport->kern->protocol,
open : transport->user->open,
close : transport->user->close,
remove : transport->user->remove,
read : transport->kern->read,
write : transport->kern->write,
add_address : transport->user->add_address,
delete_address : transport->user->delete_address,
set_mtu : transport->user->set_mtu,
user : { save } });
{ .list = LIST_HEAD_INIT(lp->list),
.lock = SPIN_LOCK_UNLOCKED,
.dev = dev,
.fd = -1,
.mac = { 0xfe, 0xfd, 0x0, 0x0, 0x0, 0x0},
.have_mac = device->have_mac,
.protocol = transport->kern->protocol,
.open = transport->user->open,
.close = transport->user->close,
.remove = transport->user->remove,
.read = transport->kern->read,
.write = transport->kern->write,
.add_address = transport->user->add_address,
.delete_address = transport->user->delete_address,
.set_mtu = transport->user->set_mtu,
.user = { save } });
init_timer(&lp->tl);
lp->tl.function = uml_net_user_timer_expire;
memset(&lp->stats, 0, sizeof(lp->stats));
......@@ -542,9 +542,9 @@ static int eth_setup(char *str)
printk("eth_init : alloc_bootmem failed\n");
return(1);
}
*new = ((struct eth_init) { list : LIST_HEAD_INIT(new->list),
index : n,
init : str });
*new = ((struct eth_init) { .list = LIST_HEAD_INIT(new->list),
.index = n,
.init = str });
list_add_tail(&new->list, &eth_cmd_line);
return(1);
}
......@@ -618,9 +618,10 @@ static int net_remove(char *str)
}
static struct mc_device net_mc = {
name: "eth",
config: net_config,
remove: net_remove,
.name = "eth",
.config = net_config,
.get_config = NULL,
.remove = net_remove,
};
static int uml_inetaddr_event(struct notifier_block *this, unsigned long event,
......@@ -662,7 +663,7 @@ static int uml_inetaddr_event(struct notifier_block *this, unsigned long event,
}
struct notifier_block uml_inetaddr_notifier = {
notifier_call: uml_inetaddr_event,
.notifier_call = uml_inetaddr_event,
};
static int uml_net_init(void)
......
......@@ -27,9 +27,9 @@ void *pty_chan_init(char *str, int device, struct chan_opts *opts)
struct pty_chan *data;
if((data = um_kmalloc(sizeof(*data))) == NULL) return(NULL);
*data = ((struct pty_chan) { announce : opts->announce,
dev : device,
raw : opts->raw });
*data = ((struct pty_chan) { .announce = opts->announce,
.dev = device,
.raw = opts->raw });
return(data);
}
......@@ -130,29 +130,29 @@ int pty_console_write(int fd, const char *buf, int n, void *d)
}
struct chan_ops pty_ops = {
type: "pty",
init: pty_chan_init,
open: pty_open,
close: generic_close,
read: generic_read,
write: generic_write,
console_write: pty_console_write,
window_size: generic_window_size,
free: generic_free,
winch: 0,
.type = "pty",
.init = pty_chan_init,
.open = pty_open,
.close = generic_close,
.read = generic_read,
.write = generic_write,
.console_write = pty_console_write,
.window_size = generic_window_size,
.free = generic_free,
.winch = 0,
};
struct chan_ops pts_ops = {
type: "pts",
init: pty_chan_init,
open: pts_open,
close: generic_close,
read: generic_read,
write: generic_write,
console_write: pty_console_write,
window_size: generic_window_size,
free: generic_free,
winch: 0,
.type = "pts",
.init = pty_chan_init,
.open = pts_open,
.close = generic_close,
.read = generic_read,
.write = generic_write,
.console_write = pty_console_write,
.window_size = generic_window_size,
.free = generic_free,
.winch = 0,
};
/*
......
......@@ -22,15 +22,15 @@ void slip_init(struct net_device *dev, void *data)
private = dev->priv;
spri = (struct slip_data *) private->user;
*spri = ((struct slip_data)
{ name : { '\0' },
addr: NULL,
gate_addr : init->gate_addr,
slave : -1,
ibuf : { '\0' },
obuf : { '\0' },
pos : 0,
esc : 0,
dev : dev });
{ .name = { '\0' },
.addr = NULL,
.gate_addr = init->gate_addr,
.slave = -1,
.ibuf = { '\0' },
.obuf = { '\0' },
.pos = 0,
.esc = 0,
.dev = dev });
dev->init = NULL;
dev->hard_header_len = 0;
......@@ -61,10 +61,10 @@ static int slip_write(int fd, struct sk_buff **skb,
}
struct net_kern_info slip_kern_info = {
init: slip_init,
protocol: slip_protocol,
read: slip_read,
write: slip_write,
.init = slip_init,
.protocol = slip_protocol,
.read = slip_read,
.write = slip_write,
};
static int slip_setup(char *str, char **mac_out, void *data)
......@@ -72,7 +72,7 @@ static int slip_setup(char *str, char **mac_out, void *data)
struct slip_init *init = data;
*init = ((struct slip_init)
{ gate_addr : NULL });
{ .gate_addr = NULL });
if(str[0] != '\0')
init->gate_addr = str;
......@@ -80,13 +80,13 @@ static int slip_setup(char *str, char **mac_out, void *data)
}
static struct transport slip_transport = {
list : LIST_HEAD_INIT(slip_transport.list),
name : "slip",
setup : slip_setup,
user : &slip_user_info,
kern : &slip_kern_info,
private_size : sizeof(struct slip_data),
setup_size : sizeof(struct slip_init),
.list = LIST_HEAD_INIT(slip_transport.list),
.name = "slip",
.setup = slip_setup,
.user = &slip_user_info,
.kern = &slip_kern_info,
.private_size = sizeof(struct slip_data),
.setup_size = sizeof(struct slip_init),
};
static int register_slip(void)
......
......@@ -257,14 +257,14 @@ static void slip_del_addr(unsigned char *addr, unsigned char *netmask,
}
struct net_user_info slip_user_info = {
init: slip_user_init,
open: slip_open,
close: slip_close,
remove: NULL,
set_mtu: slip_set_mtu,
add_address: slip_add_addr,
delete_address: slip_del_addr,
max_packet: BUF_SIZE
.init = slip_user_init,
.open = slip_open,
.close = slip_close,
.remove = NULL,
.set_mtu = slip_set_mtu,
.add_address = slip_add_addr,
.delete_address = slip_del_addr,
.max_packet = BUF_SIZE
};
/*
......
......@@ -22,14 +22,14 @@ void slirp_init(struct net_device *dev, void *data)
private = dev->priv;
spri = (struct slirp_data *) private->user;
*spri = ((struct slirp_data)
{ argw : init->argw,
pid : -1,
slave : -1,
ibuf : { '\0' },
obuf : { '\0' },
pos : 0,
esc : 0,
dev : dev });
{ .argw = init->argw,
.pid = -1,
.slave = -1,
.ibuf = { '\0' },
.obuf = { '\0' },
.pos = 0,
.esc = 0,
.dev = dev });
dev->init = NULL;
dev->hard_header_len = 0;
......@@ -64,10 +64,10 @@ static int slirp_write(int fd, struct sk_buff **skb,
}
struct net_kern_info slirp_kern_info = {
init: slirp_init,
protocol: slirp_protocol,
read: slirp_read,
write: slirp_write,
.init = slirp_init,
.protocol = slirp_protocol,
.read = slirp_read,
.write = slirp_write,
};
static int slirp_setup(char *str, char **mac_out, void *data)
......@@ -103,13 +103,13 @@ static int slirp_setup(char *str, char **mac_out, void *data)
}
static struct transport slirp_transport = {
list : LIST_HEAD_INIT(slirp_transport.list),
name : "slirp",
setup : slirp_setup,
user : &slirp_user_info,
kern : &slirp_kern_info,
private_size : sizeof(struct slirp_data),
setup_size : sizeof(struct slirp_init),
.list = LIST_HEAD_INIT(slirp_transport.list),
.name = "slirp",
.setup = slirp_setup,
.user = &slirp_user_info,
.kern = &slirp_kern_info,
.private_size = sizeof(struct slirp_data),
.setup_size = sizeof(struct slirp_init),
};
static int register_slirp(void)
......
......@@ -180,14 +180,14 @@ static int slirp_set_mtu(int mtu, void *data)
}
struct net_user_info slirp_user_info = {
init: slirp_user_init,
open: slirp_open,
close: slirp_close,
remove: NULL,
set_mtu: slirp_set_mtu,
add_address: NULL,
delete_address: NULL,
max_packet: BUF_SIZE
.init = slirp_user_init,
.open = slirp_open,
.close = slirp_close,
.remove = NULL,
.set_mtu = slirp_set_mtu,
.add_address = NULL,
.delete_address = NULL,
.max_packet = BUF_SIZE
};
/*
......
......@@ -41,11 +41,11 @@ void ssl_announce(char *dev_name, int dev)
}
static struct chan_opts opts = {
announce: ssl_announce,
xterm_title: "Serial Line #%d",
raw: 1,
tramp_stack : 0,
in_kernel : 1,
.announce = ssl_announce,
.xterm_title = "Serial Line #%d",
.raw = 1,
.tramp_stack = 0,
.in_kernel = 1,
};
static int ssl_config(char *str);
......@@ -53,23 +53,23 @@ static int ssl_get_config(char *dev, char *str, int size, char **error_out);
static int ssl_remove(char *str);
static struct line_driver driver = {
name : "UML serial line",
devfs_name : "tts/%d",
major : TTYAUX_MAJOR,
minor_start : 64,
type : TTY_DRIVER_TYPE_SERIAL,
subtype : 0,
read_irq : SSL_IRQ,
read_irq_name : "ssl",
write_irq : SSL_WRITE_IRQ,
write_irq_name : "ssl-write",
symlink_from : "serial",
symlink_to : "tts",
mc : {
name : "ssl",
config : ssl_config,
get_config : ssl_get_config,
remove : ssl_remove,
.name = "UML serial line",
.devfs_name = "tts/%d",
.major = TTYAUX_MAJOR,
.minor_start = 64,
.type = TTY_DRIVER_TYPE_SERIAL,
.subtype = 0,
.read_irq = SSL_IRQ,
.read_irq_name = "ssl",
.write_irq = SSL_WRITE_IRQ,
.write_irq_name = "ssl-write",
.symlink_from = "serial",
.symlink_to = "tts",
.mc = {
.name = "ssl",
.config = ssl_config,
.get_config = ssl_get_config,
.remove = ssl_remove,
},
};
......@@ -191,21 +191,21 @@ void ssl_hangup(struct tty_struct *tty)
}
static struct tty_driver ssl_driver = {
refcount : &ssl_refcount,
open : ssl_open,
close : ssl_close,
write : ssl_write,
put_char : ssl_put_char,
flush_chars : ssl_flush_chars,
chars_in_buffer : ssl_chars_in_buffer,
flush_buffer : ssl_flush_buffer,
ioctl : ssl_ioctl,
throttle : ssl_throttle,
unthrottle : ssl_unthrottle,
set_termios : ssl_set_termios,
stop : ssl_stop,
start : ssl_start,
hangup : ssl_hangup
.refcount = &ssl_refcount,
.open = ssl_open,
.close = ssl_close,
.write = ssl_write,
.put_char = ssl_put_char,
.flush_chars = ssl_flush_chars,
.chars_in_buffer = ssl_chars_in_buffer,
.flush_buffer = ssl_flush_buffer,
.ioctl = ssl_ioctl,
.throttle = ssl_throttle,
.unthrottle = ssl_unthrottle,
.set_termios = ssl_set_termios,
.stop = ssl_stop,
.start = ssl_start,
.hangup = ssl_hangup
};
/* Changed by ssl_init and referenced by ssl_exit, which are both serialized
......
......@@ -42,28 +42,28 @@ static struct tty_driver console_driver;
static int console_refcount = 0;
static struct chan_ops init_console_ops = {
type: "you shouldn't see this",
init : NULL,
open : NULL,
close : NULL,
read : NULL,
write : NULL,
console_write : generic_write,
window_size : NULL,
free : NULL,
winch: 0,
.type = "you shouldn't see this",
.init = NULL,
.open = NULL,
.close = NULL,
.read = NULL,
.write = NULL,
.console_write = generic_write,
.window_size = NULL,
.free = NULL,
.winch = 0,
};
static struct chan init_console_chan = {
list : { },
primary : 1,
input : 0,
output : 1,
opened : 1,
fd : 1,
pri : INIT_STATIC,
ops : &init_console_ops,
data : NULL
.list = { },
.primary = 1,
.input = 0,
.output = 1,
.opened = 1,
.fd = 1,
.pri = INIT_STATIC,
.ops = &init_console_ops,
.data = NULL
};
void stdio_announce(char *dev_name, int dev)
......@@ -73,11 +73,11 @@ void stdio_announce(char *dev_name, int dev)
}
static struct chan_opts opts = {
announce: stdio_announce,
xterm_title: "Virtual Console #%d",
raw: 1,
tramp_stack : 0,
in_kernel : 1,
.announce = stdio_announce,
.xterm_title = "Virtual Console #%d",
.raw = 1,
.tramp_stack = 0,
.in_kernel = 1,
};
static int con_config(char *str);
......@@ -85,23 +85,23 @@ static int con_get_config(char *dev, char *str, int size, char **error_out);
static int con_remove(char *str);
static struct line_driver driver = {
name : "UML console",
devfs_name : "vc/%d",
major : TTY_MAJOR,
minor_start : 0,
type : TTY_DRIVER_TYPE_CONSOLE,
subtype : SYSTEM_TYPE_CONSOLE,
read_irq : CONSOLE_IRQ,
read_irq_name : "console",
write_irq : CONSOLE_WRITE_IRQ,
write_irq_name : "console-write",
symlink_from : "ttys",
symlink_to : "vc",
mc : {
name : "con",
config : con_config,
get_config : con_get_config,
remove : con_remove,
.name = "UML console",
.devfs_name = "vc/%d",
.major = TTY_MAJOR,
.minor_start = 0,
.type = TTY_DRIVER_TYPE_CONSOLE,
.subtype = SYSTEM_TYPE_CONSOLE,
.read_irq = CONSOLE_IRQ,
.read_irq_name = "console",
.write_irq = CONSOLE_WRITE_IRQ,
.write_irq_name = "console-write",
.symlink_from = "ttys",
.symlink_to = "vc",
.mc = {
.name = "con",
.config = con_config,
.get_config = con_get_config,
.remove = con_remove,
},
};
......@@ -192,12 +192,12 @@ static void console_write(struct console *console, const char *string,
}
static struct tty_driver console_driver = {
refcount : &console_refcount,
open : con_open,
close : con_close,
write : con_write,
chars_in_buffer : chars_in_buffer,
set_termios : set_termios
.refcount = &console_refcount,
.open = con_open,
.close = con_close,
.write = con_write,
.chars_in_buffer = chars_in_buffer,
.set_termios = set_termios
};
static kdev_t console_device(struct console *c)
......
......@@ -32,8 +32,8 @@ void *tty_chan_init(char *str, int device, struct chan_opts *opts)
if((data = um_kmalloc(sizeof(*data))) == NULL)
return(NULL);
*data = ((struct tty_chan) { dev : str,
raw : opts->raw });
*data = ((struct tty_chan) { .dev = str,
.raw = opts->raw });
return(data);
}
......@@ -62,16 +62,16 @@ int tty_console_write(int fd, const char *buf, int n, void *d)
}
struct chan_ops tty_ops = {
type: "tty",
init: tty_chan_init,
open: tty_open,
close: generic_close,
read: generic_read,
write: generic_write,
console_write: tty_console_write,
window_size: generic_window_size,
free: generic_free,
winch: 0,
.type = "tty",
.init = tty_chan_init,
.open = tty_open,
.close = generic_close,
.read = generic_read,
.write = generic_write,
.console_write = tty_console_write,
.window_size = generic_window_size,
.free = generic_free,
.winch = 0,
};
/*
......
......@@ -892,9 +892,9 @@ static int ubd_ioctl(struct inode * inode, struct file * file,
struct ubd *dev = inode->i_bdev->bd_disk->private_data;
int err;
struct hd_driveid ubd_id = {
.cyls = 0,
.heads = 128,
.sectors = 32,
.cyls = 0,
.heads = 128,
.sectors = 32,
};
switch (cmd) {
......
......@@ -37,13 +37,13 @@ void *xterm_init(char *str, int device, struct chan_opts *opts)
struct xterm_chan *data;
if((data = malloc(sizeof(*data))) == NULL) return(NULL);
*data = ((struct xterm_chan) { pid : -1,
helper_pid : -1,
device : device,
title : opts->xterm_title,
raw : opts->raw,
stack : opts->tramp_stack,
direct_rcv : !opts->in_kernel } );
*data = ((struct xterm_chan) { .pid = -1,
.helper_pid = -1,
.device = device,
.title = opts->xterm_title,
.raw = opts->raw,
.stack = opts->tramp_stack,
.direct_rcv = !opts->in_kernel } );
return(data);
}
......@@ -172,16 +172,16 @@ int xterm_console_write(int fd, const char *buf, int n, void *d)
}
struct chan_ops xterm_ops = {
type: "xterm",
init: xterm_init,
open: xterm_open,
close: xterm_close,
read: generic_read,
write: generic_write,
console_write: xterm_console_write,
window_size: generic_window_size,
free: xterm_free,
winch: 1,
.type = "xterm",
.init = xterm_init,
.open = xterm_open,
.close = xterm_close,
.read = generic_read,
.write = generic_write,
.console_write = xterm_console_write,
.window_size = generic_window_size,
.free = xterm_free,
.winch = 1,
};
/*
......
......@@ -39,21 +39,21 @@ int xterm_fd(int socket, int *pid_out)
data = kmalloc(sizeof(*data), GFP_KERNEL);
if(data == NULL){
printk(KERN_ERR "xterm_fd - failed to allocate semaphore\n");
printk(KERN_ERR "xterm_fd : failed to allocate xterm_wait\n");
return(-ENOMEM);
}
*data = ((struct xterm_wait)
{ sem : __SEMAPHORE_INITIALIZER(data->sem, 0),
fd : socket,
pid : -1,
new_fd : -1 });
{ .sem = __SEMAPHORE_INITIALIZER(data->sem, 0),
.fd = socket,
.pid = -1,
.new_fd = -1 });
err = um_request_irq(XTERM_IRQ, socket, IRQ_READ, xterm_interrupt,
SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM,
"xterm", data);
if(err){
printk(KERN_ERR "Failed to get IRQ for xterm, err = %d\n",
err);
printk(KERN_ERR "xterm_fd : failed to get IRQ for xterm, "
"err = %d\n", err);
return(err);
}
down(&data->sem);
......
......@@ -128,15 +128,15 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
if(type == IRQ_READ) events = POLLIN | POLLPRI;
else events = POLLOUT;
*new_fd = ((struct irq_fd) { next : NULL,
id : dev_id,
fd : fd,
type : type,
irq : irq,
pid : pid,
events : events,
current_events: 0,
freed : 0 } );
*new_fd = ((struct irq_fd) { .next = NULL,
.id = dev_id,
.fd = fd,
.type = type,
.irq = irq,
.pid = pid,
.events = events,
.current_events = 0,
.freed = 0 } );
/* Critical section - locked by a spinlock because this stuff can
* be changed from interrupt handlers. The stuff above is done
......@@ -191,9 +191,9 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
if(type == IRQ_WRITE)
fd = -1;
pollfds[pollfds_num] = ((struct pollfd) { fd : fd,
events : events,
revents : 0 });
pollfds[pollfds_num] = ((struct pollfd) { .fd = fd,
.events = events,
.revents = 0 });
pollfds_num++;
*last_irq_ptr = new_fd;
......@@ -265,8 +265,8 @@ static int same_irq_and_dev(struct irq_fd *irq, void *d)
void free_irq_by_irq_and_dev(int irq, void *dev)
{
struct irq_and_dev data = ((struct irq_and_dev) { irq : irq,
dev : dev });
struct irq_and_dev data = ((struct irq_and_dev) { .irq = irq,
.dev = dev });
free_irq_by_cb(same_irq_and_dev, &data);
}
......
......@@ -231,11 +231,11 @@ static int setup_one_range(int fd, char *driver, unsigned long start,
panic("Failed to allocating mem_region");
}
*region = ((struct mem_region) { driver : driver,
start_pfn : pfn,
start : start,
len : len,
fd : fd } );
*region = ((struct mem_region) { .driver = driver,
.start_pfn = pfn,
.start = start,
.len = len,
.fd = fd } );
regions[i] = region;
out:
up(&regions_sem);
......@@ -423,15 +423,15 @@ static struct list_head vm_reserved = LIST_HEAD_INIT(vm_reserved);
/* Static structures, linked in to the list in early boot */
static struct vm_reserved head = {
list : LIST_HEAD_INIT(head.list),
start : 0,
end : 0xffffffff
.list = LIST_HEAD_INIT(head.list),
.start = 0,
.end = 0xffffffff
};
static struct vm_reserved tail = {
list : LIST_HEAD_INIT(tail.list),
start : 0,
end : 0xffffffff
.list = LIST_HEAD_INIT(tail.list),
.start = 0,
.end = 0xffffffff
};
void set_usable_vm(unsigned long start, unsigned long end)
......@@ -467,9 +467,9 @@ int reserve_vm(unsigned long start, unsigned long end, void *e)
goto out;
}
*entry = ((struct vm_reserved)
{ list : LIST_HEAD_INIT(entry->list),
start : start,
end : end });
{ .list = LIST_HEAD_INIT(entry->list),
.start = start,
.end = end });
list_add(&entry->list, &prev->list);
err = 0;
out:
......@@ -539,9 +539,9 @@ struct iomem {
*/
struct iomem iomem_regions[NREGIONS] = { [ 0 ... NREGIONS - 1 ] =
{ name : NULL,
fd : -1,
size : 0 } };
{ .name = NULL,
.fd = -1,
.size = 0 } };
int num_iomem_regions = 0;
......@@ -551,9 +551,9 @@ void add_iomem(char *name, int fd, unsigned long size)
return;
size = (size + PAGE_SIZE - 1) & PAGE_MASK;
iomem_regions[num_iomem_regions++] =
((struct iomem) { name : name,
fd : fd,
size : size } );
((struct iomem) { .name = name,
.fd = fd,
.size = size } );
}
int setup_iomem(void)
......
......@@ -52,7 +52,7 @@ void __init check_one_sigio(void (*proc)(int, int))
{
struct sigaction old, new;
struct termios tt;
struct openpty_arg pty = { master : -1, slave : -1 };
struct openpty_arg pty = { .master = -1, .slave = -1 };
int master, slave, flags;
initial_thread_cb(openpty_cb, &pty);
......@@ -170,15 +170,15 @@ struct pollfds {
* synchronizes with it.
*/
struct pollfds current_poll = {
poll : NULL,
size : 0,
used : 0
.poll = NULL,
.size = 0,
.used = 0
};
struct pollfds next_poll = {
poll : NULL,
size : 0,
used : 0
.poll = NULL,
.size = 0,
.used = 0
};
static int write_sigio_thread(void *unused)
......@@ -298,9 +298,9 @@ int add_sigio_fd(int fd, int read)
if(read) events = POLLIN;
else events = POLLOUT;
next_poll.poll[n - 1] = ((struct pollfd) { fd : fd,
events : events,
revents : 0 });
next_poll.poll[n - 1] = ((struct pollfd) { .fd = fd,
.events = events,
.revents = 0 });
update_thread();
out:
sigio_unlock();
......@@ -348,12 +348,12 @@ static int setup_initial_poll(int fd)
printk("setup_initial_poll : failed to allocate poll\n");
return(-1);
}
*p = ((struct pollfd) { fd : fd,
events : POLLIN,
revents : 0 });
current_poll = ((struct pollfds) { poll : p,
used : 1,
size : 1 });
*p = ((struct pollfd) { .fd = fd,
.events = POLLIN,
.revents = 0 });
current_poll = ((struct pollfds) { .poll = p,
.used = 1,
.size = 1 });
return(0);
}
......
......@@ -85,10 +85,10 @@ static void c_stop(struct seq_file *m, void *v)
}
struct seq_operations cpuinfo_op = {
start: c_start,
next: c_next,
stop: c_stop,
show: show_cpuinfo,
.start = c_start,
.next = c_next,
.stop = c_stop,
.show = show_cpuinfo,
};
pte_t * __bad_pagetable(void)
......@@ -361,9 +361,9 @@ static int panic_exit(struct notifier_block *self, unsigned long unused1,
}
static struct notifier_block panic_exit_notifier = {
notifier_call : panic_exit,
next : NULL,
priority : 0
.notifier_call = panic_exit,
.next = NULL,
.priority = 0
};
void __init setup_arch(char **cmdline_p)
......
......@@ -28,11 +28,11 @@ static void etap_init(struct net_device *dev, void *data)
pri = dev->priv;
epri = (struct ethertap_data *) pri->user;
*epri = ((struct ethertap_data)
{ dev_name : init->dev_name,
gate_addr : init->gate_addr,
data_fd : -1,
control_fd : -1,
dev : dev });
{ .dev_name = init->dev_name,
.gate_addr = init->gate_addr,
.data_fd = -1,
.control_fd = -1,
.dev = dev });
printk("ethertap backend - %s", epri->dev_name);
if(epri->gate_addr != NULL)
......@@ -69,10 +69,10 @@ static int etap_write(int fd, struct sk_buff **skb, struct uml_net_private *lp)
}
struct net_kern_info ethertap_kern_info = {
init: etap_init,
protocol: eth_protocol,
read: etap_read,
write: etap_write,
.init = etap_init,
.protocol = eth_protocol,
.read = etap_read,
.write = etap_write,
};
int ethertap_setup(char *str, char **mac_out, void *data)
......@@ -80,8 +80,8 @@ int ethertap_setup(char *str, char **mac_out, void *data)
struct ethertap_init *init = data;
*init = ((struct ethertap_init)
{ dev_name : NULL,
gate_addr : NULL });
{ .dev_name = NULL,
.gate_addr = NULL });
if(tap_setup_common(str, "ethertap", &init->dev_name, mac_out,
&init->gate_addr))
return(0);
......@@ -94,12 +94,12 @@ int ethertap_setup(char *str, char **mac_out, void *data)
}
static struct transport ethertap_transport = {
list : LIST_HEAD_INIT(ethertap_transport.list),
name : "ethertap",
setup : ethertap_setup,
user : &ethertap_user_info,
kern : &ethertap_kern_info,
private_size : sizeof(struct ethertap_data),
.list = LIST_HEAD_INIT(ethertap_transport.list),
.name = "ethertap",
.setup = ethertap_setup,
.user = &ethertap_user_info,
.kern = &ethertap_kern_info,
.private_size = sizeof(struct ethertap_data),
};
static int register_ethertap(void)
......
......@@ -28,11 +28,11 @@ static void tuntap_init(struct net_device *dev, void *data)
pri = dev->priv;
tpri = (struct tuntap_data *) pri->user;
*tpri = ((struct tuntap_data)
{ dev_name : init->dev_name,
fixed_config : (init->dev_name != NULL),
gate_addr : init->gate_addr,
fd : -1,
dev : dev });
{ .dev_name = init->dev_name,
.fixed_config = (init->dev_name != NULL),
.gate_addr = init->gate_addr,
.fd = -1,
.dev = dev });
printk("TUN/TAP backend - ");
if(tpri->gate_addr != NULL)
printk("IP = %s", tpri->gate_addr);
......@@ -55,10 +55,10 @@ static int tuntap_write(int fd, struct sk_buff **skb,
}
struct net_kern_info tuntap_kern_info = {
init: tuntap_init,
protocol: eth_protocol,
read: tuntap_read,
write: tuntap_write,
.init = tuntap_init,
.protocol = eth_protocol,
.read = tuntap_read,
.write = tuntap_write,
};
int tuntap_setup(char *str, char **mac_out, void *data)
......@@ -66,8 +66,8 @@ int tuntap_setup(char *str, char **mac_out, void *data)
struct tuntap_init *init = data;
*init = ((struct tuntap_init)
{ dev_name : NULL,
gate_addr : NULL });
{ .dev_name = NULL,
.gate_addr = NULL });
if(tap_setup_common(str, "tuntap", &init->dev_name, mac_out,
&init->gate_addr))
return(0);
......@@ -76,13 +76,13 @@ int tuntap_setup(char *str, char **mac_out, void *data)
}
static struct transport tuntap_transport = {
list : LIST_HEAD_INIT(tuntap_transport.list),
name : "tuntap",
setup : tuntap_setup,
user : &tuntap_user_info,
kern : &tuntap_kern_info,
private_size : sizeof(struct tuntap_data),
setup_size : sizeof(struct tuntap_init),
.list = LIST_HEAD_INIT(tuntap_transport.list),
.name = "tuntap",
.setup = tuntap_setup,
.user = &tuntap_user_info,
.kern = &tuntap_kern_info,
.private_size = sizeof(struct tuntap_data),
.setup_size = sizeof(struct tuntap_init),
};
static int register_tuntap(void)
......
......@@ -201,14 +201,14 @@ static int tuntap_set_mtu(int mtu, void *data)
}
struct net_user_info tuntap_user_info = {
init: tuntap_user_init,
open: tuntap_open,
close: tuntap_close,
remove: NULL,
set_mtu: tuntap_set_mtu,
add_address: tuntap_add_addr,
delete_address: tuntap_del_addr,
max_packet: MAX_PACKET
.init = tuntap_user_init,
.open = tuntap_open,
.close = tuntap_close,
.remove = NULL,
.set_mtu = tuntap_set_mtu,
.add_address = tuntap_add_addr,
.delete_address = tuntap_del_addr,
.max_packet = MAX_PACKET
};
/*
......
......@@ -276,8 +276,8 @@ int os_rcv_fd(int fd, int *helper_pid_out)
msg.msg_name = NULL;
msg.msg_namelen = 0;
iov = ((struct iovec) { iov_base : helper_pid_out,
iov_len : sizeof(*helper_pid_out) });
iov = ((struct iovec) { .iov_base = helper_pid_out,
.iov_len = sizeof(*helper_pid_out) });
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = buf;
......
......@@ -14,8 +14,8 @@ struct arch_thread {
int debugregs_seq;
};
#define INIT_ARCH_THREAD { debugregs : { [ 0 ... 7 ] = 0 }, \
debugregs_seq : 0 }
#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
.debugregs_seq = 0 }
#include "asm/arch/user.h"
......
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