Return-Path: Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.91] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1H1TCs-0005oG-Ge for user-mode-linux-devel@lists.sourceforge.net; Mon, 01 Jan 2007 11:52:26 -0800 Received: from saraswathi.solana.com ([198.99.130.12]) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1H1TCp-0004xl-Uv for user-mode-linux-devel@lists.sourceforge.net; Mon, 01 Jan 2007 11:52:26 -0800 Message-Id: <200701011947.l01Jl9QL020756@ccure.user-mode-linux.org> Mime-Version: 1.0 Date: Mon, 01 Jan 2007 14:47:09 -0500 From: Jeff Dike Subject: [uml-devel] [PATCH 3/8] UML - audio driver locking List-Id: The user-mode Linux development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: user-mode-linux-devel-bounces@lists.sourceforge.net Errors-To: user-mode-linux-devel-bounces@lists.sourceforge.net To: akpm@osdl.org Cc: linux-kernel@vger.kernel.org, user-mode-linux-devel@lists.sourceforge.net Comment the lack of locking and make a couple of variables static. Signed-off-by: Jeff Dike -- arch/um/drivers/hostaudio_kern.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) Index: linux-2.6.18-mm/arch/um/drivers/hostaudio_kern.c =================================================================== --- linux-2.6.18-mm.orig/arch/um/drivers/hostaudio_kern.c 2006-12-29 18:25:36.000000000 -0500 +++ linux-2.6.18-mm/arch/um/drivers/hostaudio_kern.c 2006-12-29 21:09:09.000000000 -0500 @@ -25,9 +25,12 @@ struct hostmixer_state { #define HOSTAUDIO_DEV_DSP "/dev/sound/dsp" #define HOSTAUDIO_DEV_MIXER "/dev/sound/mixer" -/* Only changed from linux_main at boot time */ -char *dsp = HOSTAUDIO_DEV_DSP; -char *mixer = HOSTAUDIO_DEV_MIXER; +/* Changed either at boot time or module load time. At boot, this is + * single-threaded; at module load, multiple modules would each have + * their own copy of these variables. + */ +static char *dsp = HOSTAUDIO_DEV_DSP; +static char *mixer = HOSTAUDIO_DEV_MIXER; #define DSP_HELP \ " This is used to specify the host dsp device to the hostaudio driver.\n" \ ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel