From: viro@parcelfarce.linux.theplanet.co.uk Equivalent transformation: do_pd_reqeust1() calls lambda-expanded, function killed. resulting call of ps_set_intr() in next_request() has been moved past dropping pd_lock. --- 25-akpm/drivers/block/paride/pd.c | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) diff -puN drivers/block/paride/pd.c~PI8-do_pd_request1-RC1 drivers/block/paride/pd.c --- 25/drivers/block/paride/pd.c~PI8-do_pd_request1-RC1 Wed Jan 14 13:46:18 2004 +++ 25-akpm/drivers/block/paride/pd.c Wed Jan 14 13:46:18 2004 @@ -742,8 +742,10 @@ static int pd_ready(void) return !(status_reg(pd_current) & STAT_BUSY); } -static void do_pd_request1(request_queue_t * q) +static void do_pd_request(request_queue_t * q) { + if (pd_req) + return; pd_req = elv_next_request(q); if (!pd_req) return; @@ -752,13 +754,6 @@ static void do_pd_request1(request_queue ps_set_intr(); } -static void do_pd_request(request_queue_t * q) -{ - if (pd_req) - return; - do_pd_request1(q); -} - static int pd_next_buf(void) { unsigned long saved_flags; @@ -785,8 +780,15 @@ static inline void next_request(int succ spin_lock_irqsave(&pd_lock, saved_flags); end_request(pd_req, success); - do_pd_request1(pd_queue); + pd_req = elv_next_request(pd_queue); + if (!pd_req) { + spin_unlock_irqrestore(&pd_lock, saved_flags); + return; + } spin_unlock_irqrestore(&pd_lock, saved_flags); + + ps_continuation = do_pd_io; + ps_set_intr(); } static void do_pd_io(void) _