From nobody Thu Dec 18 13:40:51 2025 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B28A265CA6 for ; Mon, 15 Dec 2025 02:54:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765767294; cv=none; b=elKCDwp4DBgbkqWyz9afDEH78MXXB+sld2mWdnteHu7CRvBr5MmEjdgqDLuMrZ7nU8VYSDe8u68CYATR1XpCxKqUYxWjBDBkhWsNrcLOYto/Jm/iEnev4oWOix3o2epa6aDuso41SnzGEN9lyE8u0nJidTKkvreXv/YrFP0zPbk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765767294; c=relaxed/simple; bh=OZpQGwLdHBh8hnjQRhC78YEbdmHP4sP/KDISZGBHfLI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KrdXq4AD+8nD9vuCCVOOjR7WTwuIUQDanvFutsohL6DECQHe1vywNYKnTn7vI4UgjNcA8WQkpVX5HqiaoaKVCIaaJqCIEugryxkEJAFuVmFoYfAi97wTd4g2w6ORwCHglBTC1OeX5qOKtRXR9tpFrxLcxpMnE3DrhYS/ZmvttKg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UjGLRyi9; arc=none smtp.client-ip=209.85.222.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UjGLRyi9" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-8b2ea2b9631so305585885a.3 for ; Sun, 14 Dec 2025 18:54:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765767291; x=1766372091; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:feedback-id:from:to:cc:subject:date:message-id:reply-to; bh=B67shbMqTgY6v/9Tv+VflehYM/ScLwG61ilBqh+emag=; b=UjGLRyi9xPKXSTKzlhUw0Mp9fcnFDxu0/f2pvIoDlU7f9T7WmG0/9jiN3r1KshQ4Or kWDRXzh1gs1oTZ3yQM6EW5iVRx4Lo3EvEK54EMxo8EC3PExCErSNuLAjYAW8SgBXzirr +IGTOzy/xmiJSG0+NXEVbXYk2p+4kt6cc+INVpYVk5bnX2r9GnMCUJn36vW7VhXMb49d NgiWr0VEEUeVx+aybrKSg+zHtAqnrq1CCBXshZrA5sd8NI1oXrCeZPa+7h21U46XestR 1bgn8CxJggOO0raVtRTBJy03IarNgc5ZwiGmn/oA1pJ3Y38hTCngOi5pWSEi0FSJH9Hi Uu6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765767291; x=1766372091; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:feedback-id:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=B67shbMqTgY6v/9Tv+VflehYM/ScLwG61ilBqh+emag=; b=RLpmNa+TBpU+Zj9TsML6et/cM257CWIDh/N611qJptRsDUeCoKuNhdyJ/lm8FDrBQY UC3wcgB7O+YZVFErJ45UtDrWengRV6ad/mVzrvx2GaNUQs4maTp37OYZDeAmQbXpYIu9 ohblE6qCuuCXCmShKhHtRXGuBxpYXAs6ZqXDaDFI1Ef3lLIC884AfWXy2spoNKnKfiLl 5C6OjZzluIP2vU+noXsdvpLlh16pA8CT5yTha1UIBstQiJHc4jAoj8jEcqZTvnFbpefY t9gI0LWoxYhzM5a6RF4uLMOFwzRHv1ngDCYC8qjRzUcHysA7On7wyaDLXyPd+zZBcNHn gV4A== X-Forwarded-Encrypted: i=1; AJvYcCWGKerY9JW3KNIWo3xd4rCbV3fcsxK3wvTVXLPQm2c6+nMdMCEZfH3L72+cGemH3AclD6m57xPbhNUSWxo=@vger.kernel.org X-Gm-Message-State: AOJu0YzE49jyV53skaK4vK78IYNaJnRHnlI3fcJ3V8gFR4W388Vi2p3u HYn6w5HubBXLqkPLdH4pj3msz2Hqq6K2rpK/6zl5m5oWOtInKD/YxnNM X-Gm-Gg: AY/fxX5d5omg0dNNHDlGQuWVdYklAw4uekXgtUp40kmJDlaMEURkED/X3K60DU747vL RRnbDE5apicOLXS5tTxnjtV60esuVAV/Suw3T7pTq+w78s9VAJgAGAzAOW3YOntdx0FiwSo2Yio E6HMhMJrF+w6m9HD5fAHV/V9pc2wYiKpLCTkGvKR2bpYnCDQghiSM1uyd/+f/RwrpWAyetLh0Gv RXfkn+IBkAvzjRhn49mNwOvPcFmc+vrxxCOxt2MHIh4aS5zdSMfsmEJzNARhtrnXvqo8XpD6GA1 siBPC22oI6jcolsoB/jts4gmLILjrPoG4Y/DhxLzQ52zqnm6hjxHQlFIdPPr4ECoIC7XjRRWnN9 r2hXQZjJ5aKPcgBFwKCkfjpWwX2Ado5pQ6jF1Y/WOwfEeFJ0t+7OjTvPvNbPd8Bh3EY0W5KMNQ8 mXt/cfI9x50FbK7E1D6JEcgWyq7lAGDB8L8Y6Lq+psEZ/8v6i7DqGOa7afs3FY3dKKv8abVN3X/ SDursBgQGJ4f+Q= X-Google-Smtp-Source: AGHT+IEPrm3mJhjKN7UoHK/lnHsODtrzDz/crX3wXXtREUTn/MrMsUyJFJGuzZS4JmvRaUEjLfaVMQ== X-Received: by 2002:a05:620a:4714:b0:8b1:728f:952e with SMTP id af79cd13be357-8bb398e2713mr1555240985a.31.1765767291178; Sun, 14 Dec 2025 18:54:51 -0800 (PST) Received: from fauth-a1-smtp.messagingengine.com (fauth-a1-smtp.messagingengine.com. [103.168.172.200]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8899f5bbba8sm42165636d6.34.2025.12.14.18.54.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Dec 2025 18:54:50 -0800 (PST) Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfauth.phl.internal (Postfix) with ESMTP id 2F50FF40078; Sun, 14 Dec 2025 21:54:50 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Sun, 14 Dec 2025 21:54:50 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefheeiiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeeuohhquhhnucfhvghn ghcuoegsohhquhhnrdhfvghnghesghhmrghilhdrtghomheqnecuggftrfgrthhtvghrnh epgfetfffhheejgedtudeiffduteefhefggedujeduhfeifefgiefgveeuudeludffnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepsghoqhhunh domhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqieelvdeghedtieegqddujeej keehheehvddqsghoqhhunhdrfhgvnhhgpeepghhmrghilhdrtghomhesfhhigihmvgdrnh grmhgvpdhnsggprhgtphhtthhopedugedpmhhouggvpehsmhhtphhouhhtpdhrtghpthht ohepuggrkhhrsehkvghrnhgvlhdrohhrghdprhgtphhtthhopegshhgvlhhgrggrshesgh hoohhglhgvrdgtohhmpdhrtghpthhtohepohhjvggurgeskhgvrhhnvghlrdhorhhgpdhr tghpthhtohepsghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepgh grrhihsehgrghrhihguhhordhnvghtpdhrtghpthhtohepsghjohhrnhefpghghhesphhr ohhtohhnmhgrihhlrdgtohhmpdhrtghpthhtoheplhhoshhsihhnsehkvghrnhgvlhdroh hrghdprhgtphhtthhopegrrdhhihhnuggsohhrgheskhgvrhhnvghlrdhorhhgpdhrtghp thhtoheprghlihgtvghrhihhlhesghhoohhglhgvrdgtohhm X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 14 Dec 2025 21:54:49 -0500 (EST) From: Boqun Feng To: Danilo Krummrich , Bjorn Helgaas , Miguel Ojeda Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Joel Fernandes , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org Subject: [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n Date: Mon, 15 Dec 2025 11:54:44 +0900 Message-ID: <20251215025444.65544-1-boqun.feng@gmail.com> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Commit 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled") fixed a build error by providing rust helpers when CONFIG_PCI_MSI=3Dn. However the rust helpers rely on the pci_alloc_irq_vectors() function is defined, which is not true when CONFIG_PCI=3Dn. There are multiple ways to fix this, e.g. a possible fix could be just remove the calling of pci_alloc_irq_vectors() since it's empty when CONFIG_PCI_MSI=3Dn anyway. However, since PCI irq APIs, such as pci_alloc_irq_vectors(), are already defined even when CONFIG_PCI=3Dn, the more reasonable fix is to define pci_alloc_irq_vectors() when CONFIG_PCI=3Dn and this aligns with the situations of other primitives as well. Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is d= isabled") Signed-off-by: Boqun Feng Reviewed-by: Danilo Krummrich Reviewed-by: Drew Fustini --- I hit a build error without this: ../rust/helpers/pci.c:36:2: error: call to undeclared function 'pci_free_ir= q_vectors'; ISO C99 and later do not support implicit function declarations= [-Wimplicit-function-declaration] 36 | pci_free_irq_vectors(dev); | ^ ../rust/helpers/pci.c:36:2: note: did you mean 'pci_alloc_irq_vectors'? ../include/linux/pci.h:2208:1: note: 'pci_alloc_irq_vectors' declared here 2208 | pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs, | ^ 1 error generated. when ./tools/testing/kunit/kunit.py run --make_options LLVM=3D1 --arch arm6= 4 --kconfig_add CONFIG_RUST=3Dy rust_doctests_kernel include/linux/pci.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/pci.h b/include/linux/pci.h index 864775651c6f..b5cc0c2b9906 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2210,6 +2210,10 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned = int min_vecs, { return -ENOSPC; } + +static inline void pci_free_irq_vectors(struct pci_dev *dev) +{ +} #endif /* CONFIG_PCI */ =20 /* Include architecture-dependent settings and functions */ --=20 2.51.0