Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761083Ab2BNVbG (ORCPT ); Tue, 14 Feb 2012 16:31:06 -0500 Received: from mail-gx0-f174.google.com ([209.85.161.174]:59813 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755490Ab2BNVbD (ORCPT ); Tue, 14 Feb 2012 16:31:03 -0500 MIME-Version: 1.0 In-Reply-To: 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> Date: Tue, 14 Feb 2012 23:31:03 +0200 X-Google-Sender-Auth: 6VLTwp0qA6ZiGwYGllXOjRQDuW0 Message-ID: Subject: Re: Uninline kcalloc From: Pekka Enberg To: Christoph Lameter Cc: Andrew Morton , Xi Wang , Dan Carpenter , Jesper Juhl , Jens Axboe , linux-kernel@vger.kernel.org, Matt Mackall , David Rientjes Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1169 Lines: 23 On Tue, 14 Feb 2012, Pekka Enberg wrote: >> Me neither. I don't think Christoph's SAFE_ARRAY_SIZE() suggestion >> makes much sense, really. It's more verbose, less obvious API, and >> doesn't really deal with the overflow case cleanly. On Tue, Feb 14, 2012 at 11: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(). It's an ancient userspace function that everybody knows how to use. There really isn't big enough gains from SAFE_ARRAY_SIZE() to justify a new API. And it's not as if the macro is an elegant way to solve the problem at hand either. Pekka -- 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/