style: no new #[allow] for the Windows enumeration helpers

Name STORAGE_DEVICE_NUMBER's fields in snake_case (repr(C) layout is
unchanged) and compile the 36-byte INQUIRY retry only on Windows, which keeps
lint_stop's #[allow] baseline.
This commit is contained in:
Matthew Jackson
2026-10-06 16:53:57 -07:00
parent 0672db23e7
commit 76ddaf5538
2 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -548,7 +548,7 @@ pub fn inquiry(scsi: &mut dyn ScsiTransport) -> Result<InquiryResult> {
}
/// INQUIRY with the standard 36-byte allocation, for bridges that reject longer ones.
#[cfg_attr(not(windows), allow(dead_code))]
#[cfg(windows)]
pub(crate) fn inquiry_standard(scsi: &mut dyn ScsiTransport) -> Result<InquiryResult> {
inquiry_alloc(scsi, INQUIRY_MIN_LEN)
}
+5 -6
View File
@@ -108,13 +108,12 @@ struct StorageAdapterDescriptor {
BusMinorVersion: u16,
}
/// `STORAGE_DEVICE_NUMBER` (winioctl.h).
/// `STORAGE_DEVICE_NUMBER` (winioctl.h): DeviceType, DeviceNumber, PartitionNumber.
#[repr(C)]
#[allow(non_snake_case)]
struct StorageDeviceNumber {
DeviceType: u32,
DeviceNumber: u32,
PartitionNumber: u32,
device_type: u32,
device_number: u32,
_partition_number: u32,
}
// ── Windows FFI ────────────────────────────────────────────────────────────
@@ -368,7 +367,7 @@ fn device_number(path: &str) -> Option<u32> {
)
};
unsafe { CloseHandle(handle) };
(ok != 0 && number.DeviceType == FILE_DEVICE_CD_ROM).then_some(number.DeviceNumber)
(ok != 0 && number.device_type == FILE_DEVICE_CD_ROM).then_some(number.device_number)
}
/// TEST UNIT READY probe on Windows. No in-library recovery: the answer is