Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932138AbWBRUQc (ORCPT ); Sat, 18 Feb 2006 15:16:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932144AbWBRUQb (ORCPT ); Sat, 18 Feb 2006 15:16:31 -0500 Received: from mx1.rowland.org ([192.131.102.7]:21252 "HELO mx1.rowland.org") by vger.kernel.org with SMTP id S932138AbWBRUQa (ORCPT ); Sat, 18 Feb 2006 15:16:30 -0500 Date: Sat, 18 Feb 2006 15:16:29 -0500 (EST) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: James Bottomley cc: Jens Axboe , Russell King , Greg KH , Andrew Morton , Linus Torvalds , , "Brown, Len" , "David S. Miller" , , , "Yu, Luming" , Ben Castricum , , Helge Hafting , "Carlo E. Prelz" , Gerrit Bruchh?user , , Jaroslav Kysela , Takashi Iwai , Patrizio Bassi , Bj?rn Nilsson , Andrey Borzenkov , "P. Christeas" , ghrt , jinhong hu , Andrew Vasquez , , Benjamin LaHaise Subject: Re: [linux-usb-devel] Re: Linux 2.6.16-rc3 In-Reply-To: <1140223363.3231.9.camel@mulgrave.il.steeleye.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 941 Lines: 30 On Fri, 17 Feb 2006, James Bottomley wrote: > +/** > + * execute_in_process_context - reliably execute the routine with user context > + * @fn: the function to execute > + * @data: data to pass to the function > + * > + * Executes the function immediately if process context is available, > + * otherwise schedules the function for delayed execution. > + * > + * Returns: 0 - function was executed > + * 1 - function was scheduled for execution > + */ > +int execute_in_process_context(void (*fn)(void *data), void *data, > + struct execute_work *ew) > +{ > + if (!in_interrupt()) { > + fn(data); > + return 0; > + } The test should be in_atomic(), not in_interrupt(). Alan Stern - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/