Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932489AbVJMUMQ (ORCPT ); Thu, 13 Oct 2005 16:12:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932469AbVJMUMP (ORCPT ); Thu, 13 Oct 2005 16:12:15 -0400 Received: from ams-iport-1.cisco.com ([144.254.224.140]:42907 "EHLO ams-iport-1.cisco.com") by vger.kernel.org with ESMTP id S932489AbVJMUMM (ORCPT ); Thu, 13 Oct 2005 16:12:12 -0400 To: "Miller, Mike (OS Dev)" Cc: "Jesper Juhl" , "linux-kernel" , "Andrew Morton" , "Len Brown" , "ISS StorageDev" , "Jakub Jelinek" , "Frodo Looijaard" , "Jean Delvare" , "Bartlomiej Zolnierkiewicz" , "Jens Axboe" , "Roland Dreier" , "Sergio Rozanski Filho" , "Benjamin Herrenschmidt" , "Pierre Ossman" , "Carsten Gross" , "Greg Kroah-Hartman" , "David Hinds" , "Vinh Truong" , "Mark Douglas Corner" , "Michael Downey" , "Antonino Daplas" , "Ben Gardner" Subject: Re: [PATCH 09/14] Big kfree NULL check cleanup - misc remaining drivers X-Message-Flag: Warning: May contain useful information References: From: Roland Dreier Date: Thu, 13 Oct 2005 13:12:03 -0700 In-Reply-To: (Mike Miller's message of "Thu, 13 Oct 2005 15:01:42 -0500") Message-ID: <52slv518j0.fsf@cisco.com> User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.17 (Jumbo Shrimp, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-OriginalArrivalTime: 13 Oct 2005 20:12:05.0588 (UTC) FILETIME=[61B15140:01C5D032] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 753 Lines: 16 Mike> I'm not sure I agree that these are pointless Mike> checks. They're not in the main code path so nothing is lost Mike> by checking first. What if the pointer is NULL???? Read the source to kfree(). The first thing it does is check if the pointer it is passed is NULL, so the only thing that checking in the caller does is save a function call. However I agree with Jesper that saving .text and cutting down on source code size far outweighs the cost of these extra function calls. - R. - 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/