Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754299AbbKGSSi (ORCPT ); Sat, 7 Nov 2015 13:18:38 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:59596 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754111AbbKGSSh (ORCPT ); Sat, 7 Nov 2015 13:18:37 -0500 Date: Sat, 07 Nov 2015 13:18:34 -0500 (EST) Message-Id: <20151107.131834.2152455608881468661.davem@davemloft.net> To: julia.lawall@lip6.fr Cc: kernel-janitors@vger.kernel.org, linux-decnet-user@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lkp@intel.com, roopa@cumulusnetworks.com, rshearma@brocade.com, ebiederm@xmission.com Subject: Re: [PATCH] decnet: remove macro-local declarations From: David Miller In-Reply-To: References: <20151105.151320.1646543343654766675.davem@davemloft.net> X-Mailer: Mew version 6.6 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sat, 07 Nov 2015 10:18:36 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 888 Lines: 20 From: Julia Lawall Date: Fri, 6 Nov 2015 11:57:34 +0100 (CET) >> > Would it be preferable to remove the macro entirely and inline the for >> > loop header? >> >> Could you show me an example of how this would look exactly? > > One possible solution is below. I moved the initialization of the nh > pointer inside the loop to reduce the size of the loop header. One could > also inline fi->fib_nh[nhsel] where it occurs, but it seemed that that > would make quite long expressions. Personally I like the explicit named iterator. It is descriptive and tells that we are walking over all of the nexthops for a route. -- 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/