From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-gx0-f227.google.com ([209.85.217.227]:33091 "EHLO mail-gx0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750965Ab0CaBOR convert rfc822-to-8bit (ORCPT ); Tue, 30 Mar 2010 21:14:17 -0400 Received: by gxk27 with SMTP id 27so5231622gxk.1 for ; Tue, 30 Mar 2010 18:14:16 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <0D753D10438DA54287A00B027084269763691C346E@AUSP01VMBX24.collaborationhost.net> References: <1269990717-2969-1-git-send-email-dwalker@codeaurora.org> <0D753D10438DA54287A00B027084269763691C346E@AUSP01VMBX24.collaborationhost.net> Date: Tue, 30 Mar 2010 18:14:12 -0700 Message-ID: Subject: Re: [PATCH 1/4] arm: msm: gpio support From: =?ISO-8859-1?Q?Arve_Hj=F8nnev=E5g?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-arm-msm-owner@vger.kernel.org List-ID: To: H Hartley Sweeten Cc: Daniel Walker , "linux-arm-kernel@lists.infradead.org" , "linux-arm-msm@vger.kernel.org" , Daniel Walker On Tue, Mar 30, 2010 at 4:58 PM, H Hartley Sweeten wrote: > On Tuesday, March 30, 2010 4:12 PM, Daniel Walker wrote: >> From: Daniel Walker ... >> + >> +static void msm_gpio_irq_ack(unsigned int irq) >> +{ >> +     unsigned long irq_flags; >> +     struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); >> +     unsigned b; >> + >> +     spin_lock_irqsave(&msm_chip->lock, irq_flags); >> + >> +     b = 1U << (irq - FIRST_GPIO_IRQ - msm_chip->chip.base); > > Urk... That's a bit confusing... > > You might want to make this a macro or an inline function with some kind > of comment. > On a related note, why did you inline msm_gpio_clear_detect_status? It is used from two other functions. >> + >> +#if MSM_GPIO_BROKEN_INT_CLEAR >> +     /* Save interrupts that already triggered before we loose them. */ >> +     /* Any interrupt that triggers between the read of int_status */ >> +     /* and the write to int_clear will still be lost though. */ >> +     msm_chip->int_status_copy |= readl(msm_chip->regs.int_status); >> +     msm_chip->int_status_copy &= ~b; >> +#endif >> +     writel(b, msm_chip->regs.int_clear); >> + >> +     msm_gpio_update_both_edge_detect(msm_chip); >> +     spin_unlock_irqrestore(&msm_chip->lock, irq_flags); >> +} >> + ... -- Arve Hjønnevåg