Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932462Ab2BNVJX (ORCPT ); Tue, 14 Feb 2012 16:09:23 -0500 Received: from smtp107.prem.mail.ac4.yahoo.com ([76.13.13.46]:37800 "HELO smtp107.prem.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S932294Ab2BNVJW (ORCPT ); Tue, 14 Feb 2012 16:09:22 -0500 X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: sjpeL0QVM1n0ffTFM9RzI8uQJWNT0Vkj9kOya8ViOvkz6I1 A8wwducoEn8GBSQKj0WAvhAmdl6u31kboGMAt91ZrTSlcI_WXuDL_CIDFila 9fhQ4SBDXxP68oamR1bj_6vhelj.foqOIDkLaP6WxmRoQw2VQ9uDMEHP4rtE 3TLOzWAKgn9zclCTCp7eZK3txkWAYUEkd9eQPJvlXPsbfo8xJdi8NuGLyrMN qHAn.K6RUEe4n3q0WiEIirpzpVM1.U9u5XAyVSwT5afA2iIcy6VLtsklV65J CqF9nk3Agohf3ElJ4p_Gji78EdVitLEgsN9_kzxHRLqnkNPwfnuyHBoaD5Wc KIoOQwwQSWP1g4OKbTZteOhrv7uksklbNcaisIQ0C9E5yP14rujYXsrsG1JB c X-Yahoo-SMTP: _Dag8S.swBC1p4FJKLCXbs8NQzyse1SYSgnAbY0- Date: Tue, 14 Feb 2012 15:09:18 -0600 (CST) From: Christoph Lameter X-X-Sender: cl@router.home To: Pekka Enberg cc: Andrew Morton , Xi Wang , Dan Carpenter , Jesper Juhl , Jens Axboe , linux-kernel@vger.kernel.org, Matt Mackall , David Rientjes Subject: Re: Uninline kcalloc In-Reply-To: Message-ID: 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> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 812 Lines: 19 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. 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(). -- 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/