From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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 990B730CD84 for ; Mon, 22 Dec 2025 08:58:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766393911; cv=none; b=geHrGBwJ/ppxa4mXQp5tnY+SMomBUiBi2aANOFXioBst8dvvUwqNZanFok5toMIkB/f84NAWTyvnxIOYvHv/l2pPADqVFDqH0Yarlc8ZwP9HYmFrWkAOB/TyZ9NDqNYhnhwfni6M+axz1IQvIHlj9u/vZ2ku9X1cCA/XS4s+GGg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766393911; c=relaxed/simple; bh=7JbjUpfRtcJDQTbUr/o8/MBhec59OcUt6gwi4/rdI/Q=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LoyEFBoLqfWcEQwfbPbj+umwuIvgUv1+ts8hUOk07XDuIycBUUI+EU6C37Arxw6tbVHybVVJ6Y5vNR5xr1FRydqQTPWTKcJFllTwFv28SChxXOWuXsUBI20jcFqZQv6+aTtx60twe1J+eyARCamZuUX9lfB9GKRQS9oCvdXpUFE= 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=DycC5h2a; arc=none smtp.client-ip=209.85.208.47 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="DycC5h2a" Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-64b4b35c812so5008365a12.0 for ; Mon, 22 Dec 2025 00:58:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766393908; x=1766998708; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=pwRJY48dxTPs1oTrj8n5Xyh/tYuVrBXkK07zh9sBwxs=; b=DycC5h2a4dnRc61bo4EgULHYLUj9/njBcqTOkOcRRJQlkSVYm1aNrkrV9oOBg41nZD Z1x3EoBRZyKdjTRyWNl5hVr9B4bxJwFZ4RMLilzGJp6wqXBx3xol0i1ZFe72iIbrXmuR 4+5ed8097oQ4nrvDm9lYpeu0TxJRArAAdR0/B7shoSVwAU6RPxnnN83H/2anmuSR5Ib4 tOZmIusCiV7d0RY0N6CZ4ZsqwkWu9SRnjp0CPcsIh3JoHswQvdZWUvnND5RmSjhCV54a OU0z9BcxZjGA+1hD0Dli/cwUs2IaeTFTd3MEYT6u3l/em6ty9nKkHdxLEQQNNz3/mTO5 lgnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766393908; x=1766998708; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pwRJY48dxTPs1oTrj8n5Xyh/tYuVrBXkK07zh9sBwxs=; b=XPLHoV+nQpIf7SFUH6t0wuqyooSNlBXBgR9FJ8x5b5GUZfsv2lFu98agDaHQ4ht4Zr xOmc8FpM6ahDDv/RPBjBR99cToF6aOIC5A+O+2vNX7W2DuMAbVVybvoQbKA2UoBE9tqj sbtFCgrJ1s1auxwD29kUO6HS5XgpvyHdEzSst6KnbeyKJdXIrsHPwrV1UYkFfhEAit58 SaM6c1/xui1xrfC/j5u/5i2x0jal3HDG+2ctvnAZYMf6gNweR16y2Z720Nbvv1Mlu1G6 CDwZ7i8POd0e2dEiJXh6i2GS7rOA+68KEGVZLH/C/JvQJ4VQgoJIdmH3P+gsnI5ZqPou s6Dw== X-Forwarded-Encrypted: i=1; AJvYcCVDLju5BClzn1DsgxRndzU095djiVpMJbbsiam2aXmJeX+WvImhbran1GnEoAtVJIPMsqSmac0XTAzYuBk=@vger.kernel.org X-Gm-Message-State: AOJu0YxM2VjfiXwsOEvMW6/Zr793PPSnqxVEZpwb/7QkByOjLDGTvs4K zjAWlskCyfiDhyShIP2Pp2292lL0aLCFcymEL2PrnMHEZEhMa+bUyWb/XKTeD5GL X-Gm-Gg: AY/fxX5S27muVbCTCBOKCkqX8CcoXCSNDTJOMAtA1z9wtwUZgTQoKYqXzf7KqFwNZ69 kMnAyOlRXLliYxZGaJkZF8PiTfa7lDEse51CI2eZOncARk1PFIMmyunP6uQ6BzZXuvORWwH8kvt 8ViQW9pegITkNRiLIVQtS8NgL2087thncDU80kVfnhnKSVga9lCJoiA+8VN9lvit1cbFGmmKnay psJ+LgNC8GXFrm3kkWZ/FC+mtevikG/KmbLiQFEtNHXCZbpXAOycwYa9Lw1LAJeslYxsWHJdcqK VQw6HRCb/w1PbijSgOGSSU0Zp7I1LcaNkg8avG5tziiyMH1/FI3Lj18/mH0nhraJ1dPsZeK1zuZ x3v10JKgwLLnCjRp5iBVYvkqQWusMOFhzOK99Km2ioQ2FlYLPKoOgGCiIwcg3FotUo84co1lKNd QdnYRN/B5usSmXkWmhpyQDe0cND2ntgF6gP0+N8ED4s0Se1JBHNojxbu4reDPFXtoI0aq04+Xe2 bRYFyACQB80v9CJBWkExeFR6CWxATbLTQjldW6jB15LxZt46/OKUy0m X-Google-Smtp-Source: AGHT+IF7ALpzL1gY8Ty9xkngtZeIfTvDYqIusKSKXf4paJFRSQtinRQWNbOMeFi5eWxXfYNiL8nLvg== X-Received: by 2002:a05:600c:3b07:b0:47a:814c:eea1 with SMTP id 5b1f17b1804b1-47d195917d2mr96907475e9.35.1766386967128; Sun, 21 Dec 2025 23:02:47 -0800 (PST) Received: from ?IPV6:2003:df:bf2d:e300:c9b3:3e5c:bfa7:af26? (p200300dfbf2de300c9b33e5cbfa7af26.dip0.t-ipconnect.de. [2003:df:bf2d:e300:c9b3:3e5c:bfa7:af26]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4324ea82f6asm20819355f8f.27.2025.12.21.23.02.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 21 Dec 2025 23:02:46 -0800 (PST) Message-ID: <5521e98b-e12d-4af1-adcd-2dc56863f90b@gmail.com> Date: Mon, 22 Dec 2025 08:02:44 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] pci: provide pci_free_irq_vectors() stub when CONFIG_PCI is disabled To: Liang Jie , Bjorn Helgaas , Miguel Ojeda , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Joel Fernandes , "open list:PCI SUBSYSTEM" , open list , "open list:RUST:Keyword:b(?i:rust)b" , "open list:CLANG/LLVM BUILD SUPPORT:Keyword:b(?i:clang|llvm)b" Cc: liangjie@lixiang.com, kernel test robot References: <20251222034415.1384223-1-buaajxlj@163.com> Content-Language: de-AT-frami From: Dirk Behme In-Reply-To: <20251222034415.1384223-1-buaajxlj@163.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 22.12.25 04:44, Liang Jie wrote: > From: Liang Jie > > When building with CONFIG_PCI=n, clang reports: > > In file included from rust/helpers/helpers.c:40: > rust/helpers/pci.c:36:2: error: call to undeclared function 'pci_free_irq_vectors'; > ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] > pci_free_irq_vectors(dev); > ^ > rust/helpers/pci.c:36:2: note: did you mean 'pci_alloc_irq_vectors'? > include/linux/pci.h:2161:1: note: 'pci_alloc_irq_vectors' declared here > pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs, > ^ > 1 error generated. > > The root cause is that include/linux/pci.h provides inline stubs for > pci_alloc_irq_vectors() in the CONFIG_PCI=n fallback, but does not provide > any declaration for pci_free_irq_vectors(). As a result, callers that invoke > pci_free_irq_vectors() under CONFIG_PCI=n (e.g. Rust PCI helpers) hit an > implicit function declaration error with clang. > > Fix this by adding a no-op pci_free_irq_vectors() stub to the CONFIG_PCI=n > fallback section of include/linux/pci.h, keeping the alloc/free API pair > consistent and avoiding implicit declaration build failures. > > Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled") > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-kbuild-all/202512220740.4Kexm4dW-lkp@intel.com/ > Signed-off-by: Liang Jie > --- > 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 */ > > /* Include architecture-dependent settings and functions */ We have this from Boqun already https://lore.kernel.org/rust-for-linux/20251215025444.65544-1-boqun.feng@gmail.com/ ? Dirk