From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oliver Neukum Subject: Re: [PATCH]use kzalloc in vfs where appropriate Date: Mon, 20 Mar 2006 14:14:19 +0100 Message-ID: <200603201414.19998.oliver@neukum.org> References: <84144f020603192325h54fd3212l1f4846fd40b9f074@mail.gmail.com> <200603201508.47960.vda@ilport.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "Pekka Enberg" , "Arjan van de Ven" , "Matthew Wilcox" , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Return-path: Received: from mail1.kontent.de ([81.88.34.36]:61077 "EHLO Mail1.KONTENT.De") by vger.kernel.org with ESMTP id S932286AbWCTNOn convert rfc822-to-8bit (ORCPT ); Mon, 20 Mar 2006 08:14:43 -0500 To: Denis Vlasenko In-Reply-To: <200603201508.47960.vda@ilport.com.ua> Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Am Montag, 20. M=E4rz 2006 14:08 schrieb Denis Vlasenko: > On Monday 20 March 2006 09:25, Pekka Enberg wrote: > > > Rewriting the test as: > > > n!=3D0 && n > INT_MAX / size > > > saves the division because size is much likelier to be a constant= , and indeed > > > the code is better: > > > > > > cmpq $268435455, %rax > > > movq $0, 40(%rsp) > > > ja .L313 > > > > > > Is there anything I am missing? >=20 > You may drop "n!=3D0" part, but you must check size!=3D0. > Since if size is 0, kcalloc returns NULL, then Why? size =3D=3D 0 is a bug. We want to oops here. Regards Oliver - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html