From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752624AbaIVEbx (ORCPT ); Mon, 22 Sep 2014 00:31:53 -0400 Received: from ozlabs.org ([103.22.144.67]:57553 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750763AbaIVEbw convert rfc822-to-8bit (ORCPT ); Mon, 22 Sep 2014 00:31:52 -0400 Message-ID: <1411360310.984.7.camel@ale.ozlabs.ibm.com> Subject: Re: [PATCH 05/15] powerpc/powernv: Split out set MSI IRQ chip code From: Michael Neuling To: Gavin Shan Cc: greg@kroah.com, arnd@arndb.de, mpe@ellerman.id.au, benh@kernel.crashing.org, cbe-oss-dev@lists.ozlabs.org, imunsie@au1.ibm.com, linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org, jk@ozlabs.org, anton@samba.org Date: Mon, 22 Sep 2014 14:31:50 +1000 In-Reply-To: <20140919065412.GA27190@shangw> References: <1411028820-29933-1-git-send-email-mikey@neuling.org> <1411028820-29933-6-git-send-email-mikey@neuling.org> <20140919065412.GA27190@shangw> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > >+static void set_msi_irq_chip(struct pnv_phb *phb, unsigned int virq) > >+{ > >+ struct irq_data *idata; > >+ struct irq_chip *ichip; > >+ > >+ /* > >+ * Change the IRQ chip for the MSI interrupts on PHB3. > >+ * The corresponding IRQ chip should be populated for > >+ * the first time. > >+ */ > >+ if (phb->type == PNV_PHB_IODA2) { > >+ if (!phb->ioda.irq_chip_init) { > >+ idata = irq_get_irq_data(virq); > >+ ichip = irq_data_get_irq_chip(idata); > >+ phb->ioda.irq_chip_init = 1; > >+ phb->ioda.irq_chip = *ichip; > >+ phb->ioda.irq_chip.irq_eoi = pnv_ioda2_msi_eoi; > >+ } > >+ > >+ irq_set_chip(virq, &phb->ioda.irq_chip); > >+ } > >+} > >+ > > Nitpick: to check PHB type and bail early could avoid nested code :) > > if (phb->type != PNV_PHB_IODA2) > return; OK, will do in repost. Thanks, Mikey From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 53FF91A070A for ; Mon, 22 Sep 2014 14:31:51 +1000 (EST) Message-ID: <1411360310.984.7.camel@ale.ozlabs.ibm.com> Subject: Re: [PATCH 05/15] powerpc/powernv: Split out set MSI IRQ chip code From: Michael Neuling To: Gavin Shan Date: Mon, 22 Sep 2014 14:31:50 +1000 In-Reply-To: <20140919065412.GA27190@shangw> References: <1411028820-29933-1-git-send-email-mikey@neuling.org> <1411028820-29933-6-git-send-email-mikey@neuling.org> <20140919065412.GA27190@shangw> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Cc: cbe-oss-dev@lists.ozlabs.org, arnd@arndb.de, greg@kroah.com, linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org, imunsie@au1.ibm.com, anton@samba.org, jk@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , > >+static void set_msi_irq_chip(struct pnv_phb *phb, unsigned int virq) > >+{ > >+ struct irq_data *idata; > >+ struct irq_chip *ichip; > >+ > >+ /* > >+ * Change the IRQ chip for the MSI interrupts on PHB3. > >+ * The corresponding IRQ chip should be populated for > >+ * the first time. > >+ */ > >+ if (phb->type =3D=3D PNV_PHB_IODA2) { > >+ if (!phb->ioda.irq_chip_init) { > >+ idata =3D irq_get_irq_data(virq); > >+ ichip =3D irq_data_get_irq_chip(idata); > >+ phb->ioda.irq_chip_init =3D 1; > >+ phb->ioda.irq_chip =3D *ichip; > >+ phb->ioda.irq_chip.irq_eoi =3D pnv_ioda2_msi_eoi; > >+ } > >+ > >+ irq_set_chip(virq, &phb->ioda.irq_chip); > >+ } > >+} > >+ >=20 > Nitpick: to check PHB type and bail early could avoid nested code :) >=20 > if (phb->type !=3D PNV_PHB_IODA2) > return; OK, will do in repost. Thanks, Mikey