diff --git a/rust/kernel/security.rs b/rust/kernel/security.rs index 7e50b375df26..4bb41a8f07b7 100644 --- a/rust/kernel/security.rs +++ b/rust/kernel/security.rs @@ -58,6 +58,7 @@ pub struct SecurityCtx { impl SecurityCtx { /// Get the security context given its id. + #[inline] pub fn from_secid(secid: u32) -> Result { let mut secdata = core::ptr::null_mut(); let mut seclen = 0u32; @@ -72,16 +73,19 @@ impl SecurityCtx { } /// Returns whether the security context is empty. + #[inline] pub fn is_empty(&self) -> bool { self.seclen == 0 } /// Returns the length of this security context. + #[inline] pub fn len(&self) -> usize { self.seclen } /// Returns the bytes for this security context. + #[inline] pub fn as_bytes(&self) -> &[u8] { let ptr = self.secdata; if ptr.is_null() { @@ -98,6 +102,7 @@ impl SecurityCtx { } impl Drop for SecurityCtx { + #[inline] fn drop(&mut self) { // SAFETY: By the invariant of `Self`, this frees a pointer that came from a successful // call to `security_secid_to_secctx` and has not yet been destroyed by