From patchwork Wed Aug 23 11:54:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9917183 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 17CFE602CB for ; Wed, 23 Aug 2017 11:55:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A26F2897C for ; Wed, 23 Aug 2017 11:55:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2D4228980; Wed, 23 Aug 2017 11:55:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E20162897C for ; Wed, 23 Aug 2017 11:55:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753846AbdHWLzH (ORCPT ); Wed, 23 Aug 2017 07:55:07 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:58271 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753768AbdHWLzG (ORCPT ); Wed, 23 Aug 2017 07:55:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Dw29mQOlkQA2WBkTx8NM14PwQLmjkTNbUM/JnajGCHk=; b=MCsLAGKpjzdCClYPFp5D6yQwb dGihIkWk0HPGCowBJurckhsd/yP7AjL66eU5QqBTC89b4MHD1+/9qIYIXqoM3fOuYNr2RJ6BOWoUM 79A1E9mwWGpdvvyEKS41DzsIi6Im0eZyTFm4fDi8h3NrcO5sf6kkN+0OCEmZcBK8ByygVhFYJRMGH 0zWsqaw4oGAAT2lmscxc3AenYE1+6IEFAD8jTcINEXIrqr7AY7xpYQWd8ww+2pWewHcjpXSl1bKB4 H26+MSPHJ3LKxGtj8jFJIuHbnBq86MvaunarTJeYPeRxoGyMtOpomqErtPJMzae3IVwdEpZn0xZ1c v6TTjRAmA==; Received: from 80-109-164-210.cable.dynamic.surfer.at ([80.109.164.210] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1dkUFS-0001x3-96; Wed, 23 Aug 2017 11:55:02 +0000 From: Christoph Hellwig To: helgaas@kernel.org Cc: davem@davemloft.net, mroos@linux.ee, linux-pci@vger.kernel.org Subject: [PATCH] PCI/msi: don't warn on irq_create_affinity_masks NULL return Date: Wed, 23 Aug 2017 13:54:59 +0200 Message-Id: <20170823115459.2058-1-hch@lst.de> X-Mailer: git-send-email 2.11.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP irq_create_affinity_masks can easily return NULL when there are not enough "free" vectors available to spread, while the memory allocation failure for the CPU masks not only is unlikely, but also relatively harmless as the system will work just fine except for non-optimally spread vectors. Thus remove the warnings. Signed-off-by: Christoph Hellwig Acked-by: David S. Miller --- drivers/pci/msi.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 253d92409bb3..2225afc1cbbb 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -538,12 +538,9 @@ msi_setup_entry(struct pci_dev *dev, int nvec, const struct irq_affinity *affd) struct msi_desc *entry; u16 control; - if (affd) { + if (affd) masks = irq_create_affinity_masks(nvec, affd); - if (!masks) - dev_err(&dev->dev, "can't allocate MSI affinity masks for %d vectors\n", - nvec); - } + /* MSI Entry Initialization */ entry = alloc_msi_entry(&dev->dev, nvec, masks); @@ -679,12 +676,8 @@ static int msix_setup_entries(struct pci_dev *dev, void __iomem *base, struct msi_desc *entry; int ret, i; - if (affd) { + if (affd) masks = irq_create_affinity_masks(nvec, affd); - if (!masks) - dev_err(&dev->dev, "can't allocate MSI-X affinity masks for %d vectors\n", - nvec); - } for (i = 0, curmsk = masks; i < nvec; i++) { entry = alloc_msi_entry(&dev->dev, 1, curmsk);