From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 23 Jan 2003 09:34:51 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 23 Jan 2003 09:34:51 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.31.123]:36880 "EHLO atrey.karlin.mff.cuni.cz") by vger.kernel.org with ESMTP id ; Thu, 23 Jan 2003 09:34:51 -0500 Date: Thu, 23 Jan 2003 15:44:00 +0100 From: Pavel Machek To: Martin Mares Cc: Rusty Russell , linux-kernel@vger.kernel.org, torvalds@transmeta.com, trivial@rustcorp.com.au, Neil Brown , dwmw2@redhat.com Subject: Re: [PATCH] [TRIVIAL] kstrdup Message-ID: <20030123144400.GC1229@atrey.karlin.mff.cuni.cz> References: <20030119233750.GA674@elf.ucw.cz> <20030123063701.1F7172C2E0@lists.samba.org> <20030123140215.GA1229@atrey.karlin.mff.cuni.cz> <20030123142138.GA2031@atrey.karlin.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030123142138.GA2031@atrey.karlin.mff.cuni.cz> User-Agent: Mutt/1.3.28i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hi! > > Ehm?! What's confusing on strdup? Or you want to also introduce > > kmemcpy, kmemcmp, ksprintf etc? > > No, as long as they don't allocate any memory. > > "kstrdup" makes it clear that the string is allocated by kmalloc() > and should be freed by kfree(). As we do not have any free(), there's no possibility for confusion. As I said, if kstrdup took GFP_XXX argument, I'd agree, but as it hardcodes GFP_KERNEL... Pavel -- Casualities in World Trade Center: ~3k dead inside the building, cryptography in U.S.A. and free speech in Czech Republic.