Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261409AbUKBVWJ (ORCPT ); Tue, 2 Nov 2004 16:22:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261413AbUKBVWI (ORCPT ); Tue, 2 Nov 2004 16:22:08 -0500 Received: from mail1.kontent.de ([81.88.34.36]:6330 "EHLO Mail1.KONTENT.De") by vger.kernel.org with ESMTP id S261409AbUKBVV7 (ORCPT ); Tue, 2 Nov 2004 16:21:59 -0500 From: Oliver Neukum To: Jesper Juhl Subject: Re: question on common error-handling idiom Date: Tue, 2 Nov 2004 22:21:55 +0100 User-Agent: KMail/1.6.2 Cc: Chris Friesen , Linux kernel References: <4187E920.1070302@nortelnetworks.com> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <200411022221.55857.oliver@neukum.org> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 679 Lines: 25 > but for the places that do > > err = -SOMEERROR; > if (condition) > goto out; > > err = -OTHERERROR; > if (condition) > goto out; > > I would tend to agree with you that moving the setting of the error inside > the if() would make sense. The intention is to allow the compiler to turn the if into a simple conditional branch on the assumption that gcc is not smart enough to put the if's body out of line. Regards Oliver - 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/