Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755008AbbEUKvN (ORCPT ); Thu, 21 May 2015 06:51:13 -0400 Received: from www.linutronix.de ([62.245.132.108]:37938 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754716AbbEUKvJ (ORCPT ); Thu, 21 May 2015 06:51:09 -0400 Date: Thu, 21 May 2015 12:51:13 +0200 (CEST) From: Thomas Gleixner To: Feng Wu cc: joro@8bytes.org, dwmw2@infradead.org, jiang.liu@linux.intel.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [v6 6/8] iommu, x86: Setup Posted-Interrupts capability for Intel iommu In-Reply-To: <1432191555-3516-7-git-send-email-feng.wu@intel.com> Message-ID: References: <1432191555-3516-1-git-send-email-feng.wu@intel.com> <1432191555-3516-7-git-send-email-feng.wu@intel.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1176 Lines: 43 On Thu, 21 May 2015, Feng Wu wrote: > @@ -647,6 +647,20 @@ static int __init intel_enable_irq_remapping(void) > + /* > + * Set Posted-Interrupts capability. > + */ > + if (!disable_irq_post) { > + intel_irq_remap_ops.capability |= 1 << IRQ_POSTING_CAP; > + > + for_each_iommu(iommu, drhd) > + if (!cap_pi_support(iommu->cap)) { > + intel_irq_remap_ops.capability &= > + ~(1 << IRQ_POSTING_CAP); > + break; > + } > + } > + > @@ -874,6 +894,20 @@ static int reenable_irq_remapping(int eim) > + /* > + * Set Posted-Interrupts capability. > + */ > + if (!disable_irq_post) { > + intel_irq_remap_ops.capability |= 1 << IRQ_POSTING_CAP; > + > + for_each_iommu(iommu, drhd) > + if (!cap_pi_support(iommu->cap)) { > + intel_irq_remap_ops.capability &= > + ~(1 << IRQ_POSTING_CAP); > + break; > + } > + } > + Verbatim copy and paste. Ever heard about the concept of helper functions? Thanks, tglx -- 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/