diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2006-08-30 08:33:35 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2006-08-30 08:33:35 -0400 |
commit | 292888c81e74115db5e5a4a838f730a7c3662982 (patch) | |
tree | 16f7b7bf39cd8a72fa8d3aa5b71c8dc890b57c96 /drivers/s390/cio | |
parent | 8f61701bdf536c7a80f0f614bac91c7883804c4c (diff) |
[S390] cio: kernel stack overflow.
Use different kind of assignment to make sure gcc doesn't create code
that creates temp variables on the stack, assigns values to it and
copies the content of the whole temp variable to the destination.
This reduces stack usage of e.g. ccwgroup_driver_register from 976
to 48 bytes instead.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r-- | drivers/s390/cio/ccwgroup.c | 14 | ||||
-rw-r--r-- | drivers/s390/cio/chsc.c | 6 | ||||
-rw-r--r-- | drivers/s390/cio/device.c | 19 | ||||
-rw-r--r-- | drivers/s390/cio/device_fsm.c | 20 |
4 files changed, 22 insertions, 37 deletions
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index 3cba6c9fab11..38954f5cd14c 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c | |||
@@ -183,11 +183,9 @@ ccwgroup_create(struct device *root, | |||
183 | 183 | ||
184 | gdev->creator_id = creator_id; | 184 | gdev->creator_id = creator_id; |
185 | gdev->count = argc; | 185 | gdev->count = argc; |
186 | gdev->dev = (struct device ) { | 186 | gdev->dev.bus = &ccwgroup_bus_type; |
187 | .bus = &ccwgroup_bus_type, | 187 | gdev->dev.parent = root; |
188 | .parent = root, | 188 | gdev->dev.release = ccwgroup_release; |
189 | .release = ccwgroup_release, | ||
190 | }; | ||
191 | 189 | ||
192 | snprintf (gdev->dev.bus_id, BUS_ID_SIZE, "%s", | 190 | snprintf (gdev->dev.bus_id, BUS_ID_SIZE, "%s", |
193 | gdev->cdev[0]->dev.bus_id); | 191 | gdev->cdev[0]->dev.bus_id); |
@@ -391,10 +389,8 @@ int | |||
391 | ccwgroup_driver_register (struct ccwgroup_driver *cdriver) | 389 | ccwgroup_driver_register (struct ccwgroup_driver *cdriver) |
392 | { | 390 | { |
393 | /* register our new driver with the core */ | 391 | /* register our new driver with the core */ |
394 | cdriver->driver = (struct device_driver) { | 392 | cdriver->driver.bus = &ccwgroup_bus_type; |
395 | .bus = &ccwgroup_bus_type, | 393 | cdriver->driver.name = cdriver->name; |
396 | .name = cdriver->name, | ||
397 | }; | ||
398 | 394 | ||
399 | return driver_register(&cdriver->driver); | 395 | return driver_register(&cdriver->driver); |
400 | } | 396 | } |
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index 61ce3f1d5228..6405e9bd6eb3 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c | |||
@@ -1391,10 +1391,8 @@ new_channel_path(int chpid) | |||
1391 | /* fill in status, etc. */ | 1391 | /* fill in status, etc. */ |
1392 | chp->id = chpid; | 1392 | chp->id = chpid; |
1393 | chp->state = 1; | 1393 | chp->state = 1; |
1394 | chp->dev = (struct device) { | 1394 | chp->dev.parent = &css[0]->device; |
1395 | .parent = &css[0]->device, | 1395 | chp->dev.release = chp_release; |
1396 | .release = chp_release, | ||
1397 | }; | ||
1398 | snprintf(chp->dev.bus_id, BUS_ID_SIZE, "chp0.%x", chpid); | 1396 | snprintf(chp->dev.bus_id, BUS_ID_SIZE, "chp0.%x", chpid); |
1399 | 1397 | ||
1400 | /* Obtain channel path description and fill it in. */ | 1398 | /* Obtain channel path description and fill it in. */ |
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 585fa04233c3..646da5640401 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -556,12 +556,11 @@ get_disc_ccwdev_by_devno(unsigned int devno, unsigned int ssid, | |||
556 | struct ccw_device *sibling) | 556 | struct ccw_device *sibling) |
557 | { | 557 | { |
558 | struct device *dev; | 558 | struct device *dev; |
559 | struct match_data data = { | 559 | struct match_data data; |
560 | .devno = devno, | ||
561 | .ssid = ssid, | ||
562 | .sibling = sibling, | ||
563 | }; | ||
564 | 560 | ||
561 | data.devno = devno; | ||
562 | data.ssid = ssid; | ||
563 | data.sibling = sibling; | ||
565 | dev = bus_find_device(&ccw_bus_type, NULL, &data, match_devno); | 564 | dev = bus_find_device(&ccw_bus_type, NULL, &data, match_devno); |
566 | 565 | ||
567 | return dev ? to_ccwdev(dev) : NULL; | 566 | return dev ? to_ccwdev(dev) : NULL; |
@@ -835,10 +834,8 @@ io_subchannel_probe (struct subchannel *sch) | |||
835 | return -ENOMEM; | 834 | return -ENOMEM; |
836 | } | 835 | } |
837 | atomic_set(&cdev->private->onoff, 0); | 836 | atomic_set(&cdev->private->onoff, 0); |
838 | cdev->dev = (struct device) { | 837 | cdev->dev.parent = &sch->dev; |
839 | .parent = &sch->dev, | 838 | cdev->dev.release = ccw_device_release; |
840 | .release = ccw_device_release, | ||
841 | }; | ||
842 | INIT_LIST_HEAD(&cdev->private->kick_work.entry); | 839 | INIT_LIST_HEAD(&cdev->private->kick_work.entry); |
843 | /* Do first half of device_register. */ | 840 | /* Do first half of device_register. */ |
844 | device_initialize(&cdev->dev); | 841 | device_initialize(&cdev->dev); |
@@ -977,9 +974,7 @@ ccw_device_console_enable (struct ccw_device *cdev, struct subchannel *sch) | |||
977 | int rc; | 974 | int rc; |
978 | 975 | ||
979 | /* Initialize the ccw_device structure. */ | 976 | /* Initialize the ccw_device structure. */ |
980 | cdev->dev = (struct device) { | 977 | cdev->dev.parent= &sch->dev; |
981 | .parent = &sch->dev, | ||
982 | }; | ||
983 | rc = io_subchannel_recog(cdev, sch); | 978 | rc = io_subchannel_recog(cdev, sch); |
984 | if (rc) | 979 | if (rc) |
985 | return rc; | 980 | return rc; |
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index 6d91c2eb205b..35e162ba6d54 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c | |||
@@ -267,12 +267,10 @@ ccw_device_recog_done(struct ccw_device *cdev, int state) | |||
267 | notify = 1; | 267 | notify = 1; |
268 | } | 268 | } |
269 | /* fill out sense information */ | 269 | /* fill out sense information */ |
270 | cdev->id = (struct ccw_device_id) { | 270 | cdev->id.cu_type = cdev->private->senseid.cu_type; |
271 | .cu_type = cdev->private->senseid.cu_type, | 271 | cdev->id.cu_model = cdev->private->senseid.cu_model; |
272 | .cu_model = cdev->private->senseid.cu_model, | 272 | cdev->id.dev_type = cdev->private->senseid.dev_type; |
273 | .dev_type = cdev->private->senseid.dev_type, | 273 | cdev->id.dev_model = cdev->private->senseid.dev_model; |
274 | .dev_model = cdev->private->senseid.dev_model, | ||
275 | }; | ||
276 | if (notify) { | 274 | if (notify) { |
277 | cdev->private->state = DEV_STATE_OFFLINE; | 275 | cdev->private->state = DEV_STATE_OFFLINE; |
278 | if (same_dev) { | 276 | if (same_dev) { |
@@ -566,12 +564,10 @@ ccw_device_verify_done(struct ccw_device *cdev, int err) | |||
566 | /* Deliver fake irb to device driver, if needed. */ | 564 | /* Deliver fake irb to device driver, if needed. */ |
567 | if (cdev->private->flags.fake_irb) { | 565 | if (cdev->private->flags.fake_irb) { |
568 | memset(&cdev->private->irb, 0, sizeof(struct irb)); | 566 | memset(&cdev->private->irb, 0, sizeof(struct irb)); |
569 | cdev->private->irb.scsw = (struct scsw) { | 567 | cdev->private->irb.scsw.cc = 1; |
570 | .cc = 1, | 568 | cdev->private->irb.scsw.fctl = SCSW_FCTL_START_FUNC; |
571 | .fctl = SCSW_FCTL_START_FUNC, | 569 | cdev->private->irb.scsw.actl = SCSW_ACTL_START_PEND; |
572 | .actl = SCSW_ACTL_START_PEND, | 570 | cdev->private->irb.scsw.stctl = SCSW_STCTL_STATUS_PEND; |
573 | .stctl = SCSW_STCTL_STATUS_PEND, | ||
574 | }; | ||
575 | cdev->private->flags.fake_irb = 0; | 571 | cdev->private->flags.fake_irb = 0; |
576 | if (cdev->handler) | 572 | if (cdev->handler) |
577 | cdev->handler(cdev, cdev->private->intparm, | 573 | cdev->handler(cdev, cdev->private->intparm, |