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: fix typos in Bar struct's comments

Fix a typo in the doc-comment of the Bar structure: 'inststance ->
instance'.

Add also 'is' to the comment inside Bar's `new()` function (suggested
by Dirk):
// `pdev` is valid by the invariants of `Device`.

Fixes: bf9651f84b4e ("rust: pci: implement I/O mappable `pci::Bar`")
Suggested-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Marko Turk <mt@markoturk.info>
Reviewed-by: Dirk Behme <dirk.behme@de.bosch.com>
Link: https://patch.msgid.link/20260105213726.73000-2-mt@markoturk.info
Signed-off-by: Danilo Krummrich <dakr@kernel.org>

authored by

Marko Turk and committed by
Danilo Krummrich
9f92d7d1 a9a42f07

+2 -2
+2 -2
rust/kernel/pci/io.rs
··· 20 20 /// 21 21 /// # Invariants 22 22 /// 23 - /// `Bar` always holds an `IoRaw` inststance that holds a valid pointer to the start of the I/O 23 + /// `Bar` always holds an `IoRaw` instance that holds a valid pointer to the start of the I/O 24 24 /// memory mapped PCI BAR and its size. 25 25 pub struct Bar<const SIZE: usize = 0> { 26 26 pdev: ARef<Device>, ··· 54 54 let ioptr: usize = unsafe { bindings::pci_iomap(pdev.as_raw(), num, 0) } as usize; 55 55 if ioptr == 0 { 56 56 // SAFETY: 57 - // `pdev` valid by the invariants of `Device`. 57 + // `pdev` is valid by the invariants of `Device`. 58 58 // `num` is checked for validity by a previous call to `Device::resource_len`. 59 59 unsafe { bindings::pci_release_region(pdev.as_raw(), num) }; 60 60 return Err(ENOMEM);