WARNING: line length of 94 exceeds 80 columns #142: FILE: rust/kernel/net/netdevice.rs:101: + /// The device is temporarily busy; ownership of the skb goes back to the networking core. WARNING: line length of 96 exceeds 80 columns #148: FILE: rust/kernel/net/netdevice.rs:107: +/// The callback trampolines live in this abstraction layer so that driver code does not have to WARNING: line length of 93 exceeds 80 columns #153: FILE: rust/kernel/net/netdevice.rs:112: + /// The RTNL/netdevice allocation path zero-initializes private storage before any driver WARNING: line length of 86 exceeds 80 columns #154: FILE: rust/kernel/net/netdevice.rs:113: + /// callback observes it, so implementations must accept the all-zero bit pattern. WARNING: line length of 89 exceeds 80 columns #165: FILE: rust/kernel/net/netdevice.rs:124: + /// This only exposes a shared device view: TX callbacks may run concurrently, so the WARNING: line length of 93 exceeds 80 columns #166: FILE: rust/kernel/net/netdevice.rs:125: + /// abstraction must not synthesize an exclusive borrow of either `net_device` or private WARNING: line length of 96 exceeds 80 columns #176: FILE: rust/kernel/net/netdevice.rs:135: +/// - The caller is responsible for only creating references in contexts where the kernel allows WARNING: line length of 94 exceeds 80 columns #186: FILE: rust/kernel/net/netdevice.rs:145: + /// The pointer must point to a valid `struct net_device` for the lifetime of the returned WARNING: line length of 83 exceeds 80 columns #187: FILE: rust/kernel/net/netdevice.rs:146: + /// reference, and the caller must ensure that it is safe to mutate through it. WARNING: line length of 87 exceeds 80 columns #188: FILE: rust/kernel/net/netdevice.rs:147: + pub(crate) unsafe fn from_raw<'a>(ptr: *mut bindings::net_device) -> &'a mut Self { WARNING: line length of 88 exceeds 80 columns #190: FILE: rust/kernel/net/netdevice.rs:149: + // SAFETY: The caller guarantees the pointer is valid for the returned lifetime. WARNING: line length of 94 exceeds 80 columns #198: FILE: rust/kernel/net/netdevice.rs:157: + /// The pointer must point to a valid `struct net_device` for the lifetime of the returned WARNING: line length of 87 exceeds 80 columns #200: FILE: rust/kernel/net/netdevice.rs:159: + pub(crate) unsafe fn from_raw_ref<'a>(ptr: *mut bindings::net_device) -> &'a Self { WARNING: line length of 88 exceeds 80 columns #202: FILE: rust/kernel/net/netdevice.rs:161: + // SAFETY: The caller guarantees the pointer is valid for the returned lifetime. WARNING: line length of 91 exceeds 80 columns #214: FILE: rust/kernel/net/netdevice.rs:173: + // SAFETY: The type invariant guarantees that `dev` points to a valid `net_device`. WARNING: line length of 99 exceeds 80 columns #221: FILE: rust/kernel/net/netdevice.rs:180: + // SAFETY: The type invariant guarantees that `dev` points to a valid `net_device`, and the WARNING: line length of 90 exceeds 80 columns #222: FILE: rust/kernel/net/netdevice.rs:181: + // bindgen-generated accessors preserve the layout of the `priv_flags/lltx` union. WARNING: line length of 99 exceeds 80 columns #234: FILE: rust/kernel/net/netdevice.rs:193: + // SAFETY: The type invariant guarantees that `dev` points to a valid `net_device`, and the WARNING: line length of 90 exceeds 80 columns #235: FILE: rust/kernel/net/netdevice.rs:194: + // bindgen-generated accessors preserve the layout of the `priv_flags/lltx` union. WARNING: line length of 91 exceeds 80 columns #245: FILE: rust/kernel/net/netdevice.rs:204: + // SAFETY: The type invariant guarantees that `dev` points to a valid `net_device`. WARNING: line length of 91 exceeds 80 columns #252: FILE: rust/kernel/net/netdevice.rs:211: + // SAFETY: The type invariant guarantees that `dev` points to a valid `net_device`. WARNING: line length of 91 exceeds 80 columns #259: FILE: rust/kernel/net/netdevice.rs:218: + // SAFETY: The type invariant guarantees that `dev` points to a valid `net_device`. WARNING: line length of 91 exceeds 80 columns #266: FILE: rust/kernel/net/netdevice.rs:225: + // SAFETY: The type invariant guarantees that `dev` points to a valid `net_device`. WARNING: line length of 91 exceeds 80 columns #273: FILE: rust/kernel/net/netdevice.rs:232: + // SAFETY: The type invariant guarantees that `dev` points to a valid `net_device`. WARNING: line length of 91 exceeds 80 columns #280: FILE: rust/kernel/net/netdevice.rs:239: + // SAFETY: The type invariant guarantees that `dev` points to a valid `net_device`. WARNING: line length of 81 exceeds 80 columns #285: FILE: rust/kernel/net/netdevice.rs:244: + pub fn set_pcpu_stat_type(&mut self, stat_type: bindings::netdev_stat_type) { WARNING: line length of 91 exceeds 80 columns #287: FILE: rust/kernel/net/netdevice.rs:246: + // SAFETY: The type invariant guarantees that `dev` points to a valid `net_device`. WARNING: line length of 99 exceeds 80 columns #295: FILE: rust/kernel/net/netdevice.rs:254: + /// The caller must ensure that the current `net_device` was allocated with private storage for WARNING: line length of 94 exceeds 80 columns #296: FILE: rust/kernel/net/netdevice.rs:255: + /// `T`. Dereferencing the returned pointer additionally requires exclusive access to that WARNING: line length of 96 exceeds 80 columns #299: FILE: rust/kernel/net/netdevice.rs:258: + // SAFETY: The caller guarantees that the private storage really contains a `T`, and the WARNING: line length of 98 exceeds 80 columns #301: FILE: rust/kernel/net/netdevice.rs:260: + unsafe { bindings::netdev_priv(self.as_ptr() as *const bindings::net_device).cast::() } WARNING: line length of 94 exceeds 80 columns #310: FILE: rust/kernel/net/netdevice.rs:269: + // SAFETY: The networking core only calls this callback with a valid `net_device`. WARNING: line length of 96 exceeds 80 columns #312: FILE: rust/kernel/net/netdevice.rs:271: + // SAFETY: The `rtnl::Registration` abstraction ties `priv_size` to `T::Private`. WARNING: line length of 95 exceeds 80 columns #313: FILE: rust/kernel/net/netdevice.rs:272: + let private = unsafe { Pin::new_unchecked(&mut *dev.private_ptr::()) }; WARNING: line length of 94 exceeds 80 columns #321: FILE: rust/kernel/net/netdevice.rs:280: + // SAFETY: The networking core only calls this callback with a valid `net_device`. WARNING: line length of 96 exceeds 80 columns #323: FILE: rust/kernel/net/netdevice.rs:282: + // SAFETY: The `rtnl::Registration` abstraction ties `priv_size` to `T::Private`. WARNING: line length of 95 exceeds 80 columns #324: FILE: rust/kernel/net/netdevice.rs:283: + let private = unsafe { Pin::new_unchecked(&mut *dev.private_ptr::()) }; WARNING: line length of 90 exceeds 80 columns #334: FILE: rust/kernel/net/netdevice.rs:293: + // SAFETY: The networking core only calls this callback with a valid `net_device`. WARNING: line length of 93 exceeds 80 columns #336: FILE: rust/kernel/net/netdevice.rs:295: + // SAFETY: The networking core transfers ownership of the callback skb to the driver. WARNING: line length of 98 exceeds 80 columns #352: FILE: rust/kernel/net/netdevice.rs:311: + // SAFETY: A zeroed `net_device_ops` is valid because omitted callbacks are represented by WARNING: line length of 97 exceeds 80 columns #381: FILE: rust/kernel/net/skbuff.rs:15: +/// - `ptr` is either `None` after ownership was handed back to the networking core, or it points WARNING: line length of 97 exceeds 80 columns #393: FILE: rust/kernel/net/skbuff.rs:27: + /// `ptr` must be a valid non-null skb pointer whose ownership is transferred to Rust for the WARNING: line length of 87 exceeds 80 columns #397: FILE: rust/kernel/net/skbuff.rs:31: + // SAFETY: The caller guarantees ownership of a valid non-null skb pointer. WARNING: line length of 98 exceeds 80 columns #410: FILE: rust/kernel/net/skbuff.rs:44: + // SAFETY: `Self` owns a valid skb until ownership is explicitly returned with `into_raw`. WARNING: line length of 97 exceeds 80 columns #429: FILE: rust/kernel/net/skbuff.rs:63: + // SAFETY: `Self` owns the skb exactly once unless ownership has been transferred back to WARNING: line length of 92 exceeds 80 columns #453: FILE: rust/kernel/net/stats.rs:14: + // SAFETY: The helper expects a valid `net_device *`; `netdevice::Device` maintains that WARNING: line length of 88 exceeds 80 columns #454: FILE: rust/kernel/net/stats.rs:15: + // invariant and the helper handles the required per-cpu synchronization internally. total: 0 errors, 47 warnings, 0 checks, 409 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. Commit 2d003f161854 ("rust: net: add minimal skbuff, netdevice, and stats abstractions") has style problems, please review. NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT BAD_REPORTED_BY_LINK CAMELCASE COMMIT_LOG_LONG_LINE FILE_PATH_CHANGES GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 47 warnings, 0 checks, 409 lines checked