From patchwork Fri Mar 31 07:55:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 1763640 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=d8pzU7fa; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4PnszY337bz1yZ4 for ; Fri, 31 Mar 2023 18:55:53 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230381AbjCaHzw (ORCPT ); Fri, 31 Mar 2023 03:55:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230355AbjCaHzi (ORCPT ); Fri, 31 Mar 2023 03:55:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9E0F210D; Fri, 31 Mar 2023 00:55:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4F347B82C86; Fri, 31 Mar 2023 07:55:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48275C433EF; Fri, 31 Mar 2023 07:55:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680249335; bh=56tCHTmfZ4Dl+rN8BVNsQISShX6kyMqKc5AH+7Uj+7g=; h=From:To:Cc:Subject:Date:From; b=d8pzU7fa4a0MPZNqdYvhn1SagoTH0CwCH7N8LJtri3bFQikdL7Vvu9xx2rrXkUE8K vU0x4c3bYnhwVYAYv83Mof1cNZnA06zAQDz5Em2fw6YWEX/nrWWIDgdRNUNEsWoLsV 9vZWuM0OQf8J7YOEk76ygBfPhdg28jf1uIVMWKrWqLDGLw6dGf8e/dQfU1g4MxVoyI 3vqWXTp9oOXcCnf36dprPxkCSO/EnKpfgxqdbns6EDqx1ix2qubNpUI/IxnDmhh2S9 NejpCa24KedXER0ZZ8uKhdwK7kV00+Tqa3MKAUzhdxqs4jri4QTBBNG2bqMJPHRBQq PPDj4R1NemEDg== From: Arnd Bergmann To: Bjorn Helgaas , Saeed Mahameed Cc: Arnd Bergmann , Thomas Gleixner , Dan Williams , Marc Zyngier , Kevin Tian , Ira Weiny , Shay Drory , Jacob Keller , Eli Cohen , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PCI/MSI: provide dummy pci_msix_can_alloc_dyn() helper Date: Fri, 31 Mar 2023 09:55:04 +0200 Message-Id: <20230331075528.1300270-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Arnd Bergmann A change in mlx5 caused a build failure when PCI_MSI is disabled: drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c: In function 'irq_release': drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c:148:31: error: implicit declaration of function 'pci_msix_can_alloc_dyn' [-Werror=implicit-function-declaration] 148 | if (irq->map.index && pci_msix_can_alloc_dyn(pool->dev->pdev)) | ^~~~~~~~~~~~~~~~~~~~~~ All the related functions already have a dummy version that does nothing in this configuration, but pci_msix_can_alloc_dyn() does not, so add one. Fixes: fb0a6a268dcd ("net/mlx5: Provide external API for allocating vectors") Fixes: 34026364df8e ("PCI/MSI: Provide post-enable dynamic allocation interfaces for MSI-X") Signed-off-by: Arnd Bergmann --- include/linux/pci.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/pci.h b/include/linux/pci.h index b50e5c79f7e3..f69f7939331e 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1624,6 +1624,11 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs, flags, NULL); } +static inline bool pci_msix_can_alloc_dyn(struct pci_dev *dev) +{ + return false; +} + static inline struct msi_map pci_msix_alloc_irq_at(struct pci_dev *dev, unsigned int index, const struct irq_affinity_desc *affdesc) {