Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: pci: add __rust_helper to helpers

This is needed to inline these helpers into Rust code.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20251202-define-rust-helper-v1-26-a2e13cbc17a6@google.com
[ Consider latest helper additions. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>

authored by

Alice Ryhl and committed by
Danilo Krummrich
593e0b22 c7ff9563

+13 -10
+13 -10
rust/helpers/pci.c
··· 2 2 3 3 #include <linux/pci.h> 4 4 5 - u16 rust_helper_pci_dev_id(struct pci_dev *dev) 5 + __rust_helper u16 rust_helper_pci_dev_id(struct pci_dev *dev) 6 6 { 7 7 return PCI_DEVID(dev->bus->number, dev->devfn); 8 8 } 9 9 10 - resource_size_t rust_helper_pci_resource_start(struct pci_dev *pdev, int bar) 10 + __rust_helper resource_size_t 11 + rust_helper_pci_resource_start(struct pci_dev *pdev, int bar) 11 12 { 12 13 return pci_resource_start(pdev, bar); 13 14 } 14 15 15 - resource_size_t rust_helper_pci_resource_len(struct pci_dev *pdev, int bar) 16 + __rust_helper resource_size_t rust_helper_pci_resource_len(struct pci_dev *pdev, 17 + int bar) 16 18 { 17 19 return pci_resource_len(pdev, bar); 18 20 } 19 21 20 - bool rust_helper_dev_is_pci(const struct device *dev) 22 + __rust_helper bool rust_helper_dev_is_pci(const struct device *dev) 21 23 { 22 24 return dev_is_pci(dev); 23 25 } 24 26 25 27 #ifndef CONFIG_PCI_MSI 26 - int rust_helper_pci_alloc_irq_vectors(struct pci_dev *dev, 27 - unsigned int min_vecs, 28 - unsigned int max_vecs, 29 - unsigned int flags) 28 + __rust_helper int rust_helper_pci_alloc_irq_vectors(struct pci_dev *dev, 29 + unsigned int min_vecs, 30 + unsigned int max_vecs, 31 + unsigned int flags) 30 32 { 31 33 return pci_alloc_irq_vectors(dev, min_vecs, max_vecs, flags); 32 34 } 33 35 34 - void rust_helper_pci_free_irq_vectors(struct pci_dev *dev) 36 + __rust_helper void rust_helper_pci_free_irq_vectors(struct pci_dev *dev) 35 37 { 36 38 pci_free_irq_vectors(dev); 37 39 } 38 40 39 - int rust_helper_pci_irq_vector(struct pci_dev *pdev, unsigned int nvec) 41 + __rust_helper int rust_helper_pci_irq_vector(struct pci_dev *pdev, 42 + unsigned int nvec) 40 43 { 41 44 return pci_irq_vector(pdev, nvec); 42 45 }