Skip to content

Commit

Permalink
Fixes suggested in PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush1325 committed Dec 19, 2022
1 parent d48d07d commit 824f067
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 5 additions & 5 deletions library/std/src/sys/uefi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ pub mod memchr {
pub use core::slice::memchr::{memchr, memrchr};
}

// SAFETY: must be called only once during runtime initialization.
// SAFETY: argc must be 2.
// SAFETY: argv must be &[Handle, *mut SystemTable].
pub unsafe fn init(argc: isize, argv: *const *const u8, _sigpipe: u8) {
assert_eq!(argc, 2);
let image_handle = unsafe { NonNull::new(*argv as *mut crate::ffi::c_void).unwrap() };
Expand All @@ -66,10 +69,7 @@ pub const fn unsupported<T>() -> std_io::Result<T> {

#[inline]
pub const fn unsupported_err() -> std_io::Error {
std_io::const_io_error!(
std_io::ErrorKind::Unsupported,
"operation not supported on this platform",
)
std_io::const_io_error!(std_io::ErrorKind::Unsupported, "operation not supported on UEFI",)
}

pub fn decode_error_kind(code: i32) -> crate::io::ErrorKind {
Expand Down Expand Up @@ -114,7 +114,7 @@ pub fn hashmap_random_keys() -> (u64, u64) {
unsafe { (get_random().unwrap_or(1), get_random().unwrap_or(2)) }
}

unsafe fn get_random() -> Option<u64> {
fn get_random() -> Option<u64> {
use r_efi::protocols::rng;

let mut buf = [0u8; 8];
Expand Down
1 change: 0 additions & 1 deletion library/std/src/sys/uefi/net/tcp4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use crate::sys::uefi::{
use r_efi::efi::Status;
use r_efi::protocols::{ip4, managed_network, simple_network, tcp4};

// FIXME: Discuss what the values these constants should have
const TYPE_OF_SERVICE: u8 = 8;
const TIME_TO_LIVE: u8 = 255;

Expand Down

0 comments on commit 824f067

Please sign in to comment.