Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932525Ab2BNVqn (ORCPT ); Tue, 14 Feb 2012 16:46:43 -0500 Received: from mail-qw0-f53.google.com ([209.85.216.53]:60207 "EHLO mail-qw0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932388Ab2BNVqk (ORCPT ); Tue, 14 Feb 2012 16:46:40 -0500 Subject: Re: Uninline kcalloc Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Xi Wang In-Reply-To: Date: Tue, 14 Feb 2012 16:46:38 -0500 Cc: Pekka Enberg , Andrew Morton , Dan Carpenter , Jesper Juhl , Jens Axboe , linux-kernel@vger.kernel.org, Matt Mackall , David Rientjes Content-Transfer-Encoding: 7bit Message-Id: <59F64CB9-832E-4F7C-8A6C-E2CD18563795@gmail.com> References: <4F33C7D7.1060801@kernel.dk> <32FA0BD0-7C0D-4ED4-B375-4736FC70AC05@gmail.com> <4F33CEAE.60400@gmail.com> <20120209150652.5b1d19dc.akpm@linux-foundation.org> <20120213194446.GD26353@mwanda> <20120214072017.GF26353@mwanda> <8F83835C-366C-46AC-A50A-3F680B7D2D83@gmail.com> <20120214124518.f42bc03e.akpm@linux-foundation.org> To: Christoph Lameter X-Mailer: Apple Mail (2.1084) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 938 Lines: 20 On Feb 14, 2012, at 4:09 PM, Christoph Lameter wrote: > IMHO Having a function to deal with the overflow of a multiplication and > then do an allocation based on the result is a conflation of two different > things that need to be separate. kcalloc only exists because there is > an ancient user space function that somehow got a second parameter instead > of just using the same as malloc(). I don't understand why these kcalloc patches have anything to do with kmalloc(SAFE_ARRAY_SIZE(...), ...) you proposed. It also doesn't make much sense to force the caller to check the result of SAFE_ARRAY_SIZE() or calculate_array_size() before passing it to kmalloc(). This is too verbose. - xi -- 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/