File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ impl AtaPassThru {
42
42
/// The [`AtaPassThruMode`] structure containing configuration details of the protocol.
43
43
#[ must_use]
44
44
pub fn mode ( & self ) -> AtaPassThruMode {
45
- unsafe { ( * self . 0 . mode ) . clone ( ) }
45
+ let mut mode = unsafe { ( * self . 0 . mode ) . clone ( ) } ;
46
+ mode. io_align = mode. io_align . max ( 1 ) ; // 0 and 1 is the same, says UEFI spec
47
+ mode
46
48
}
47
49
48
50
/// Retrieves the I/O buffer alignment required by this SCSI channel.
Original file line number Diff line number Diff line change @@ -49,7 +49,9 @@ impl NvmePassThru {
49
49
/// An instance of [`NvmePassThruMode`] describing the NVMe controller's capabilities.
50
50
#[ must_use]
51
51
pub fn mode ( & self ) -> NvmePassThruMode {
52
- unsafe { ( * self . 0 . mode ) . clone ( ) }
52
+ let mut mode = unsafe { ( * self . 0 . mode ) . clone ( ) } ;
53
+ mode. io_align = mode. io_align . max ( 1 ) ; // 0 and 1 is the same, says UEFI spec
54
+ mode
53
55
}
54
56
55
57
/// Retrieves the alignment requirements for I/O buffers.
You can’t perform that action at this time.
0 commit comments