Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754780Ab2EAWSr (ORCPT ); Tue, 1 May 2012 18:18:47 -0400 Received: from mail-gy0-f174.google.com ([209.85.160.174]:61572 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689Ab2EAWSq convert rfc822-to-8bit (ORCPT ); Tue, 1 May 2012 18:18:46 -0400 MIME-Version: 1.0 In-Reply-To: <20120501113130.GE20224@sortiz-mobl> References: <1334647849-1773-1-git-send-email-linus.walleij@stericsson.com> <20120501113130.GE20224@sortiz-mobl> Date: Wed, 2 May 2012 00:18:45 +0200 Message-ID: Subject: Re: [PATCH 5/6] mfd/ab8500: support of hierachical interrupt From: Linus Walleij To: Samuel Ortiz , Michel JAOUEN Cc: Linus Walleij , linux-kernel@vger.kernel.org, Maxime Coquelin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1082 Lines: 32 On Tue, May 1, 2012 at 1:31 PM, Samuel Ortiz wrote: > On Tue, Apr 17, 2012 at 09:30:49AM +0200, Linus Walleij wrote: >> +static irqreturn_t ab8500_hierarchical_irq(int irq, void *dev) >> +{ >> + ? ? /* ?Hierarchical interrupt version */ >> + ? ? for (i = 0; i < AB8500_IT_LATCHHIER_NUM; i++) { >> + ? ? ? ? ? ? do { >> + ? ? ? ? ? ? ? ? ? ? int latch_bit = __ffs(hier_val); >> + ? ? ? ? ? ? ? ? ? ? do { >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? int int_bit = __ffs(latch_val); >> + ? ? ? ? ? ? ? ? ? ? } while (latch_val); >> + ? ? ? ? ? ? } while (hier_val); >> + ? ? } >> + ? ? return IRQ_HANDLED; >> +} > > With 4 nested loops, this one is getting difficult to read. Have you > considered splitting the loops into separate routines ? I get the point :-D Michel do you think this can be done? Yours, Linus Walleij -- 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/