Commit 854e981c authored by Paolo 'Blaisorblade' Giarrusso's avatar Paolo 'Blaisorblade' Giarrusso Committed by Linus Torvalds

[PATCH] uml: fix hugest stack users

The C99 initialization, with GCC's bad handling, for 6K wide structs (which
_aren't_ on the stack), is causing GCC to use 12K for these silly procs with 3
vars.  Workaround this.

Note that .name = { '\0' } translates to memset(->name, 0, '->name' size) - I verified
this with GCC's docs and a testprogram.
Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 98105d47
...@@ -88,12 +88,13 @@ struct slip_proto { ...@@ -88,12 +88,13 @@ struct slip_proto {
int esc; int esc;
}; };
#define SLIP_PROTO_INIT { \ static inline void slip_proto_init(struct slip_proto * slip)
.ibuf = { '\0' }, \ {
.obuf = { '\0' }, \ memset(slip->ibuf, 0, sizeof(slip->ibuf));
.more = 0, \ memset(slip->obuf, 0, sizeof(slip->obuf));
.pos = 0, \ slip->more = 0;
.esc = 0 \ slip->pos = 0;
slip->esc = 0;
} }
extern int slip_proto_read(int fd, void *buf, int len, extern int slip_proto_read(int fd, void *buf, int len,
......
...@@ -21,13 +21,14 @@ void slip_init(struct net_device *dev, void *data) ...@@ -21,13 +21,14 @@ void slip_init(struct net_device *dev, void *data)
private = dev->priv; private = dev->priv;
spri = (struct slip_data *) private->user; spri = (struct slip_data *) private->user;
*spri = ((struct slip_data)
{ .name = { '\0' }, memset(spri->name, 0, sizeof(spri->name));
.addr = NULL, spri->addr = NULL;
.gate_addr = init->gate_addr, spri->gate_addr = init->gate_addr;
.slave = -1, spri->slave = -1;
.slip = SLIP_PROTO_INIT, spri->dev = dev;
.dev = dev });
slip_proto_init(&spri->slip);
dev->init = NULL; dev->init = NULL;
dev->header_cache_update = NULL; dev->header_cache_update = NULL;
......
...@@ -21,12 +21,13 @@ void slirp_init(struct net_device *dev, void *data) ...@@ -21,12 +21,13 @@ void slirp_init(struct net_device *dev, void *data)
private = dev->priv; private = dev->priv;
spri = (struct slirp_data *) private->user; spri = (struct slirp_data *) private->user;
*spri = ((struct slirp_data)
{ .argw = init->argw, spri->argw = init->argw;
.pid = -1, spri->pid = -1;
.slave = -1, spri->slave = -1;
.slip = SLIP_PROTO_INIT, spri->dev = dev;
.dev = dev });
slip_proto_init(&spri->slip);
dev->init = NULL; dev->init = NULL;
dev->hard_header_len = 0; dev->hard_header_len = 0;
......
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