From patchwork Mon Apr 22 23:10:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 2474801 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 4D1BF3FD40 for ; Mon, 22 Apr 2013 23:10:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753499Ab3DVXKm (ORCPT ); Mon, 22 Apr 2013 19:10:42 -0400 Received: from mail-ie0-f172.google.com ([209.85.223.172]:36921 "EHLO mail-ie0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753039Ab3DVXKm (ORCPT ); Mon, 22 Apr 2013 19:10:42 -0400 Received: by mail-ie0-f172.google.com with SMTP id c12so12287ieb.31 for ; Mon, 22 Apr 2013 16:10:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=dps+dhXxgvkBBnpCi9Rvcv9idgS6ea1z2GCFgl+X5CM=; b=Tmv2LrrshxXwyptBJ1OJF3BCzGNetlYbLo5jpj+UDdQNJY/tIKQ4TFAo1dT0ATGHrY s+Brf5fEZvK0At89Cy+EAcAvR4fotuQFjEm+njz2tnDUZx0HsLkWjbEEGa+b95O5IbMO 22ht8Unb47Ai63KcmonvqhqXL2nnKbv5lyNAi/02JiYpQyBHyT8W4LX9f5k0ZP0PSUgw ZuKVixg78WSw1nci+9C1XNNWl4FQSS2V3/6QjJO2gso9U17ocOEM8UEQ40M6nBdizoM3 Nptaxbquy1PyaptkitGGo4emBgjPQmUsAGHb9Cy3aILAjLc9hSndszvBUltrEcj4vfns u9Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=dps+dhXxgvkBBnpCi9Rvcv9idgS6ea1z2GCFgl+X5CM=; b=Mh9d6YDcKpdzRDexBgVJ73P2M4y8dOCIGdoIrhZ/9BwfumbBRBL++W0itEh7gUbLXG NSr5yj7PsLEQG2qJiOlfXxuODYqZylcCOSOvrWTguGOGF9/zKXaUepIQzbngAjPUCZ0h MtQ/9PRxXKVOenC59FhxZQPBUqX6iLJIX4n05ye4vME4MQXiPAwS0kpqSqpY/q5/xD0G /c/9qzu04oB/n4eAGm0GNWbr3FeRpiUVuBOABXlnOt33FwWwc2Ak6QgPai2x+J/FsmdD JRWmdfc8oz/a7YcyL1ef7dJekGD1+T7fxu3+8Q3N30s5pIMeL2h535TDeLnwPUEHN66w QXpA== X-Received: by 10.50.56.4 with SMTP id w4mr8472628igp.50.1366672241817; Mon, 22 Apr 2013 16:10:41 -0700 (PDT) Received: from localhost ([172.29.120.215]) by mx.google.com with ESMTPS id qs4sm19647785igb.10.2013.04.22.16.10.41 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 22 Apr 2013 16:10:41 -0700 (PDT) Subject: [PATCH v4 04/22] PCI: Remove MSI/MSI-X cap check in pci_msi_check_device() To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Gavin Shan Date: Mon, 22 Apr 2013 17:10:40 -0600 Message-ID: <20130422231039.32621.1576.stgit@bhelgaas-glaptop> In-Reply-To: <20130422230012.32621.15224.stgit@bhelgaas-glaptop> References: <20130422230012.32621.15224.stgit@bhelgaas-glaptop> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlv1vw0iSDV0t92nygfLE78EmAlJ8yhuZHCVna/3FvgJJylDvIoyKgmiA4FmxKqnP9lbnPwBE2IKH+QdQhJzW4I120dffGR/7Fr66u1kz2OZHFSC/d3J4evnNB1O5nPytOYhnh0bLO6xnOFNNr38GcLIMUmjek0JasubybEytKAeenJQTQlKYnOeF1wvsRq0FUg+NYjLBlwo8gnNMt4/bLasfb3oGSdDajnTgPqNzcson1wcP8= Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Gavin Shan The function pci_msi_check_device() is called while enabling MSI or MSI-X interrupts to make sure the PCI device can support MSI or MSI-X capability. This patch removes the check on MSI or MSI-X capability in the function and lets the caller do the check. Signed-off-by: Gavin Shan Signed-off-by: Bjorn Helgaas --- drivers/pci/msi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 99befbd..60a4b10 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -789,9 +789,6 @@ static int pci_msi_check_device(struct pci_dev *dev, int nvec, int type) if (ret) return ret; - if (!pci_find_capability(dev, type)) - return -EINVAL; - return 0; } @@ -942,7 +939,7 @@ int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec) int status, nr_entries; int i, j; - if (!entries) + if (!entries || !dev->msix_cap) return -EINVAL; status = pci_msi_check_device(dev, nvec, PCI_CAP_ID_MSIX);