Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262062AbVBAQjy (ORCPT ); Tue, 1 Feb 2005 11:39:54 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262063AbVBAQjy (ORCPT ); Tue, 1 Feb 2005 11:39:54 -0500 Received: from mail-ex.suse.de ([195.135.220.2]:42138 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S262062AbVBAQju (ORCPT ); Tue, 1 Feb 2005 11:39:50 -0500 Date: Tue, 01 Feb 2005 17:39:49 +0100 Message-ID: From: Takashi Iwai To: Paulo Marques Cc: Andrew Morton , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: Re: [PATCH 2.6] 7/7 replace snd_kmalloc_strdup by kstrdup In-Reply-To: <41FFA2AD.9020006@grupopie.com> References: <1107228526.41fef76e4c9be@webmail.grupopie.com> <41FF75C0.6040602@grupopie.com> <41FF7F0D.5080800@grupopie.com> <41FFA2AD.9020006@grupopie.com> User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 MULE XEmacs/21.4 (patch 15) (Security Through Obscurity) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2165 Lines: 62 At Tue, 01 Feb 2005 15:39:25 +0000, Paulo Marques wrote: > > [1 ] > Takashi Iwai wrote: > > At Tue, 01 Feb 2005 13:07:25 +0000, > > Paulo Marques wrote: > > > >>I thought of going all the way and changing the callers of kstrdup in > >>sound to use kfree, so that it would work without debugging memory > >>allocated for strdup'ed strings. > >> > >>However the code there already uses kfree, just not the standard kfree > >>because it might have been defined to something else in core.h if > >>CONFIG_SND_DEBUG_MEMORY is set. > >> > >>We could still go all the way and carry on with this approach: use the > >>standard kstrdup / kfree when not CONFIG_SND_DEBUG_MEMORY, and define > >>kstrdup to be an internal sound function in sound/core/memory.c when > >>CONFIG_SND_DEBUG_MEMORY is set. > > > > > > This sounds good. We can do just like normal kmalloc: > > > > #ifdef CONFIG_SND_DEBUG_MEMORY > > ... > > #define kstrdup(s) my_kstrdup_wrapper(s) > > #endif > > > > > >>Do you prefer that I do another patch to do this, or that I just drop > >>the patch and leave snd_kmalloc_strdup alone? > > > > > > Heh, it's up to you ;) Using kstrdup() in normal cases would be > > better, of course. > > Ok, how about this patch, then? Thanks, that looks almost fine except: > diff -uprN -X dontdiff vanilla-2.6.11-rc2-bk9/sound/core/sound.c linux-2.6.11-rc2-bk9/sound/core/sound.c > --- vanilla-2.6.11-rc2-bk9/sound/core/sound.c 2005-01-31 20:05:34.000000000 +0000 > +++ linux-2.6.11-rc2-bk9/sound/core/sound.c 2005-02-01 15:02:04.000000000 +0000 > @@ -401,7 +401,6 @@ EXPORT_SYMBOL(snd_hidden_kfree); > EXPORT_SYMBOL(snd_hidden_vmalloc); > EXPORT_SYMBOL(snd_hidden_vfree); > #endif > -EXPORT_SYMBOL(snd_kmalloc_strdup); > EXPORT_SYMBOL(copy_to_user_fromio); > EXPORT_SYMBOL(copy_from_user_toio); > /* init.c */ I guess here missing EXPORT(snd_hidden_kstrdup)? Takashi - 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/