Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751021AbWC0NmZ (ORCPT ); Mon, 27 Mar 2006 08:42:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751023AbWC0NmZ (ORCPT ); Mon, 27 Mar 2006 08:42:25 -0500 Received: from mail-in-08.arcor-online.net ([151.189.21.48]:18051 "EHLO mail-in-08.arcor-online.net") by vger.kernel.org with ESMTP id S1751020AbWC0NmY (ORCPT ); Mon, 27 Mar 2006 08:42:24 -0500 From: Bodo Eggert Subject: Re: bus_add_device() losing an error return from the probe() method To: Rene Herman , Andrew Morton , gregkh@suse.de, tiwai@suse.de, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Reply-To: 7eggert@gmx.de Date: Mon, 27 Mar 2006 15:41:37 +0200 References: <5TNbU-7Xn-17@gated-at.bofh.it> <5UsI5-Wf-9@gated-at.bofh.it> <5UM40-3Dy-9@gated-at.bofh.it> User-Agent: KNode/0.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8Bit Message-Id: X-be10.7eggert.dyndns.org-MailScanner-Information: See www.mailscanner.info for information X-be10.7eggert.dyndns.org-MailScanner: Found to be clean X-be10.7eggert.dyndns.org-MailScanner-From: harvested.in.lkml@posting.7eggert.dyndns.org Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 948 Lines: 17 Rene Herman wrote: > Andrew Morton wrote: >> Looks sane, but please don't sprinkle `return' statements all over a >> function in this manner. > > I actually prefer the multiple returns. You then don't have to "visually > scroll down" to the label to see what would happen when reading the > code. Even when there's common code before the return, I've never seen > GCC not optimise that to the goto form itself. You obviously the boss > though. I tried both, and I found out that having multiple non-trivial points of return enables you to easily create a lot of bugs. -- Ich danke GMX daf?r, die Verwendung meiner Adressen mittels per SPF verbreiteten L?gen zu sabotieren. - 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/