aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2008-03-04 17:28:41 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-03-04 19:35:12 -0500
commit05680d86d21bdbe56db80c66c24c686590815f1f (patch)
tree79b8e9b0eef38b93b68b57d54dc9fb44a36cebd6 /drivers/block
parent735c4fb916e9f83a9350aeb2680d77d01ea75094 (diff)
pktcdvd: reduce stack consumption
On my system, pkt_open() consumes 584 bytes because the compiler decides to inline lots of functions that would not normally be part of long call chains. The following patch fixes that problem on my system. Signed-off-by: Peter Osterlund <petero2@telia.com> Cc: Nix <nix@esperi.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/pktcdvd.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 674cd66dcaba..18feb1c7c33b 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -849,7 +849,8 @@ static int pkt_flush_cache(struct pktcdvd_device *pd)
849/* 849/*
850 * speed is given as the normal factor, e.g. 4 for 4x 850 * speed is given as the normal factor, e.g. 4 for 4x
851 */ 851 */
852static int pkt_set_speed(struct pktcdvd_device *pd, unsigned write_speed, unsigned read_speed) 852static noinline_for_stack int pkt_set_speed(struct pktcdvd_device *pd,
853 unsigned write_speed, unsigned read_speed)
853{ 854{
854 struct packet_command cgc; 855 struct packet_command cgc;
855 struct request_sense sense; 856 struct request_sense sense;
@@ -1776,7 +1777,8 @@ static int pkt_get_track_info(struct pktcdvd_device *pd, __u16 track, __u8 type,
1776 return pkt_generic_packet(pd, &cgc); 1777 return pkt_generic_packet(pd, &cgc);
1777} 1778}
1778 1779
1779static int pkt_get_last_written(struct pktcdvd_device *pd, long *last_written) 1780static noinline_for_stack int pkt_get_last_written(struct pktcdvd_device *pd,
1781 long *last_written)
1780{ 1782{
1781 disc_information di; 1783 disc_information di;
1782 track_information ti; 1784 track_information ti;
@@ -1813,7 +1815,7 @@ static int pkt_get_last_written(struct pktcdvd_device *pd, long *last_written)
1813/* 1815/*
1814 * write mode select package based on pd->settings 1816 * write mode select package based on pd->settings
1815 */ 1817 */
1816static int pkt_set_write_settings(struct pktcdvd_device *pd) 1818static noinline_for_stack int pkt_set_write_settings(struct pktcdvd_device *pd)
1817{ 1819{
1818 struct packet_command cgc; 1820 struct packet_command cgc;
1819 struct request_sense sense; 1821 struct request_sense sense;
@@ -1972,7 +1974,7 @@ static int pkt_writable_disc(struct pktcdvd_device *pd, disc_information *di)
1972 return 1; 1974 return 1;
1973} 1975}
1974 1976
1975static int pkt_probe_settings(struct pktcdvd_device *pd) 1977static noinline_for_stack int pkt_probe_settings(struct pktcdvd_device *pd)
1976{ 1978{
1977 struct packet_command cgc; 1979 struct packet_command cgc;
1978 unsigned char buf[12]; 1980 unsigned char buf[12];
@@ -2071,7 +2073,8 @@ static int pkt_probe_settings(struct pktcdvd_device *pd)
2071/* 2073/*
2072 * enable/disable write caching on drive 2074 * enable/disable write caching on drive
2073 */ 2075 */
2074static int pkt_write_caching(struct pktcdvd_device *pd, int set) 2076static noinline_for_stack int pkt_write_caching(struct pktcdvd_device *pd,
2077 int set)
2075{ 2078{
2076 struct packet_command cgc; 2079 struct packet_command cgc;
2077 struct request_sense sense; 2080 struct request_sense sense;
@@ -2116,7 +2119,8 @@ static int pkt_lock_door(struct pktcdvd_device *pd, int lockflag)
2116/* 2119/*
2117 * Returns drive maximum write speed 2120 * Returns drive maximum write speed
2118 */ 2121 */
2119static int pkt_get_max_speed(struct pktcdvd_device *pd, unsigned *write_speed) 2122static noinline_for_stack int pkt_get_max_speed(struct pktcdvd_device *pd,
2123 unsigned *write_speed)
2120{ 2124{
2121 struct packet_command cgc; 2125 struct packet_command cgc;
2122 struct request_sense sense; 2126 struct request_sense sense;
@@ -2177,7 +2181,8 @@ static char us_clv_to_speed[16] = {
2177/* 2181/*
2178 * reads the maximum media speed from ATIP 2182 * reads the maximum media speed from ATIP
2179 */ 2183 */
2180static int pkt_media_speed(struct pktcdvd_device *pd, unsigned *speed) 2184static noinline_for_stack int pkt_media_speed(struct pktcdvd_device *pd,
2185 unsigned *speed)
2181{ 2186{
2182 struct packet_command cgc; 2187 struct packet_command cgc;
2183 struct request_sense sense; 2188 struct request_sense sense;
@@ -2249,7 +2254,7 @@ static int pkt_media_speed(struct pktcdvd_device *pd, unsigned *speed)
2249 } 2254 }
2250} 2255}
2251 2256
2252static int pkt_perform_opc(struct pktcdvd_device *pd) 2257static noinline_for_stack int pkt_perform_opc(struct pktcdvd_device *pd)
2253{ 2258{
2254 struct packet_command cgc; 2259 struct packet_command cgc;
2255 struct request_sense sense; 2260 struct request_sense sense;