Skip to content

Commit

Permalink
Merge pull request #350 from stefano-garzarella/fix-vtpm-doc
Browse files Browse the repository at this point in the history
kernel/vtpm: fix safety documentation
  • Loading branch information
joergroedel authored May 22, 2024
2 parents fc98243 + 767e525 commit 6b4deb4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/src/protocols/vtpm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ impl TpmSendCommandRequest {
.get(..size_of::<Self>())
.ok_or_else(SvsmReqError::invalid_parameter)?;

// SAFETY: SnpReportRequest has no invalid representations, as it is
// comprised entirely of integer types. It is repr(packed), so its
// SAFETY: TpmSendCommandRequest has no invalid representations, as it
// is comprised entirely of integer types. It is repr(packed), so its
// required alignment is simply 1. We have checked the size, so this
// is entirely safe.
let request = unsafe { &*buffer.as_ptr().cast::<Self>() };
Expand Down Expand Up @@ -150,8 +150,8 @@ impl TpmSendCommandResponse {
.get_mut(..size_of::<Self>())
.ok_or_else(SvsmReqError::invalid_parameter)?;

// SAFETY: SnpReportRequest has no invalid representations, as it is
// comprised entirely of integer types. It is repr(packed), so its
// SAFETY: TpmSendCommandResponse has no invalid representations, as it
// is comprised entirely of integer types. It is repr(packed), so its
// required alignment is simply 1. We have checked the size, so this
// is entirely safe.
let response = unsafe { &mut *buffer.as_mut_ptr().cast::<Self>() };
Expand Down

0 comments on commit 6b4deb4

Please sign in to comment.