Skip to content

Commit d96595a

Browse files
committed
Fix windows lint errors
Signed-off-by: Simon Davies <[email protected]>
1 parent f8986db commit d96595a

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/hyperlight_host/src/hypervisor/hyperv_windows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ impl Hypervisor for HypervWindowsDriver {
895895
}
896896

897897
#[cfg(crashdump)]
898-
fn crashdump_context(&self) -> Result<Option<crashdump::CrashDumpContext>> {
898+
fn crashdump_context(&self) -> Result<Option<crashdump::CrashDumpContext<'_>>> {
899899
if self.rt_cfg.guest_core_dump {
900900
let mut regs = [0; 27];
901901

src/hyperlight_host/src/hypervisor/surrogate_process_manager.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,11 +531,11 @@ mod tests {
531531
while result {
532532
if let Ok(process_name) =
533533
unsafe { CStr::from_ptr(process_entry.szExeFile.as_ptr()).to_str() }
534+
&& process_name == SURROGATE_PROCESS_BINARY_NAME
534535
{
535-
if process_name == SURROGATE_PROCESS_BINARY_NAME {
536-
count += 1;
537-
}
536+
count += 1;
538537
}
538+
539539
unsafe {
540540
result = Process32Next(snapshot_handle, &mut process_entry).is_ok();
541541
}

src/hyperlight_host/src/hypervisor/windows_hypervisor_platform.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl VMPartition {
213213
// with an error about a missing entrypoint
214214
// This function should always succeed since before we get here we have already checked that the hypervisor is present and
215215
// that we are on a supported version of windows.
216-
type WHvMapGpaRange2Func = unsafe extern "cdecl" fn(
216+
type WHvMapGpaRange2Func = unsafe extern "system" fn(
217217
WHV_PARTITION_HANDLE,
218218
HANDLE,
219219
*const c_void,
@@ -523,10 +523,10 @@ impl VMProcessor {
523523
);
524524

525525
// If it failed for reasons other than insufficient buffer, return error
526-
if let Err(e) = result {
527-
if e.code() != windows::Win32::Foundation::WHV_E_INSUFFICIENT_BUFFER {
528-
return Err(HyperlightError::WindowsAPIError(e));
529-
}
526+
if let Err(e) = result
527+
&& e.code() != windows::Win32::Foundation::WHV_E_INSUFFICIENT_BUFFER
528+
{
529+
return Err(HyperlightError::WindowsAPIError(e));
530530
}
531531
}
532532

0 commit comments

Comments
 (0)