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/device.c | |
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/device.c')
-rw-r--r-- | drivers/s390/cio/device.c | 19 |
1 files changed, 7 insertions, 12 deletions
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; |