Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion uefi/src/proto/ata/pass_thru.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ impl AtaPassThru {
/// The [`AtaPassThruMode`] structure containing configuration details of the protocol.
#[must_use]
pub fn mode(&self) -> AtaPassThruMode {
unsafe { (*self.0.mode).clone() }
let mut mode = unsafe { (*self.0.mode).clone() };
mode.io_align = mode.io_align.max(1); // 0 and 1 is the same, says UEFI spec
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mode
}

/// Retrieves the I/O buffer alignment required by this SCSI channel.
Expand Down
4 changes: 3 additions & 1 deletion uefi/src/proto/nvme/pass_thru.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ impl NvmePassThru {
/// An instance of [`NvmePassThruMode`] describing the NVMe controller's capabilities.
#[must_use]
pub fn mode(&self) -> NvmePassThruMode {
unsafe { (*self.0.mode).clone() }
let mut mode = unsafe { (*self.0.mode).clone() };
mode.io_align = mode.io_align.max(1); // 0 and 1 is the same, says UEFI spec
mode
}

/// Retrieves the alignment requirements for I/O buffers.
Expand Down