Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965846AbZLHT2q (ORCPT ); Tue, 8 Dec 2009 14:28:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756184AbZLHT2l (ORCPT ); Tue, 8 Dec 2009 14:28:41 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:42794 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756123AbZLHT2k (ORCPT ); Tue, 8 Dec 2009 14:28:40 -0500 Date: Tue, 8 Dec 2009 11:28:13 -0800 From: Stephen Hemminger To: Mathieu Desnoyers Cc: "David S. Miller" , Robert Olsson , Jens Laas , Hans Liss , "Paul E. McKenney" , Patrick McHardy , linux-kernel@vger.kernel.org Subject: Re: [PATCH] fib-trie: code cleanup (v2) Message-ID: <20091208112813.42ca3cca@nehalam> In-Reply-To: <20091208192509.GD1653@Krystal> References: <20091208184839.GA31383@Krystal> <20091208110916.386d8367@nehalam> <20091208192509.GD1653@Krystal> Organization: Linux Foundation X-Mailer: Claws Mail 3.7.2 (GTK+ 2.18.3; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1008 Lines: 31 On Tue, 8 Dec 2009 14:25:09 -0500 Mathieu Desnoyers wrote: > * Stephen Hemminger (shemminger@linux-foundation.org) wrote: > > On Tue, 8 Dec 2009 13:48:39 -0500 > > Mathieu Desnoyers wrote: > > > > > /* use cache location of last found key */ > > > - if (iter->pos > 0 && pos >= iter->pos && (l = fib_find_node(t, iter->key))) > > > - pos -= iter->pos; > > > + if (iter->pos > 0 && pos >= iter->pos) > > > + l = fib_find_node(t, iter->key); > > > + if (l) > > > + pos -= iter->pos; > > > else { > > > > Missing bracket's here change the semantics. > > Ouch, yes. thanks. > > The original code works and was clean enough, to split the assignment out would require duplicate code. -- -- 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/