summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/um/drivers/slip_common.h13
-rw-r--r--arch/um/drivers/slip_kern.c15
-rw-r--r--arch/um/drivers/slirp_kern.c13
3 files changed, 22 insertions, 19 deletions
diff --git a/arch/um/drivers/slip_common.h b/arch/um/drivers/slip_common.h
index 2ae76d8f1be1..d574e0a9dc13 100644
--- a/arch/um/drivers/slip_common.h
+++ b/arch/um/drivers/slip_common.h
@@ -88,12 +88,13 @@ struct slip_proto {
int esc;
};
-#define SLIP_PROTO_INIT { \
- .ibuf = { '\0' }, \
- .obuf = { '\0' }, \
- .more = 0, \
- .pos = 0, \
- .esc = 0 \
+static inline void slip_proto_init(struct slip_proto * slip)
+{
+ memset(slip->ibuf, 0, sizeof(slip->ibuf));
+ memset(slip->obuf, 0, sizeof(slip->obuf));
+ slip->more = 0;
+ slip->pos = 0;
+ slip->esc = 0;
}
extern int slip_proto_read(int fd, void *buf, int len,
diff --git a/arch/um/drivers/slip_kern.c b/arch/um/drivers/slip_kern.c
index 9a6f5c85f902..a62f5ef445cf 100644
--- a/arch/um/drivers/slip_kern.c
+++ b/arch/um/drivers/slip_kern.c
@@ -21,13 +21,14 @@ 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,
- .slip = SLIP_PROTO_INIT,
- .dev = dev });
+
+ memset(spri->name, 0, sizeof(spri->name));
+ spri->addr = NULL;
+ spri->gate_addr = init->gate_addr;
+ spri->slave = -1;
+ spri->dev = dev;
+
+ slip_proto_init(&spri->slip);
dev->init = NULL;
dev->header_cache_update = NULL;
diff --git a/arch/um/drivers/slirp_kern.c b/arch/um/drivers/slirp_kern.c
index 9864d27afdbe..33d7982be5d3 100644
--- a/arch/um/drivers/slirp_kern.c
+++ b/arch/um/drivers/slirp_kern.c
@@ -21,12 +21,13 @@ 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,
- .slip = SLIP_PROTO_INIT,
- .dev = dev });
+
+ spri->argw = init->argw;
+ spri->pid = -1;
+ spri->slave = -1;
+ spri->dev = dev;
+
+ slip_proto_init(&spri->slip);
dev->init = NULL;
dev->hard_header_len = 0;
OpenPOWER on IntegriCloud