Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UefiHidDxeV2: Remove mutable static shared reference #593

Merged
merged 1 commit into from
Dec 20, 2024
Merged
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
5 changes: 3 additions & 2 deletions HidPkg/UefiHidDxeV2/src/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ extern "efiapi" fn on_layout_update(_event: efi::Event, context: *mut c_void) {
#[cfg(test)]
mod test {

use core::{ffi::c_void, mem::MaybeUninit, slice::from_raw_parts_mut};
use core::{ffi::c_void, mem::MaybeUninit, ptr, slice::from_raw_parts_mut};

use hii_keyboard_layout::HiiKeyboardLayout;
use r_efi::{efi, hii, protocols};
Expand Down Expand Up @@ -1012,7 +1012,8 @@ mod test {
keyboard_layout_ptr: *mut protocols::hii_database::KeyboardLayout,
) -> efi::Status {
let mut keyboard_layout_buffer = vec![0u8; 4096];
let buffer_size = keyboard_layout_buffer.pwrite(unsafe { &TEST_KEYBOARD_LAYOUT }, 0).unwrap();
let buffer_size =
keyboard_layout_buffer.pwrite(&unsafe { (*ptr::addr_of!(TEST_KEYBOARD_LAYOUT)).clone() }, 0).unwrap();
keyboard_layout_buffer.resize(buffer_size, 0);
unsafe {
if keyboard_layout_length.read() < buffer_size as u16 {
Expand Down
Loading