Skip to content

Commit d654ade

Browse files
author
Tom Dohrmann
committed
use u8 instead of usize
1 parent 5e06ff3 commit d654ade

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/structures/idt.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ macro_rules! set_general_handler {
935935
{
936936
fn set_general_handler(
937937
idt: &mut $crate::structures::idt::InterruptDescriptorTable,
938-
range: impl ::core::ops::RangeBounds<usize>,
938+
range: impl ::core::ops::RangeBounds<u8>,
939939
) {
940940
$crate::set_general_handler_recursive_bits!(idt, GENERAL_HANDLER, range);
941941
}
@@ -952,10 +952,9 @@ macro_rules! set_general_handler_recursive_bits {
952952
// if we have 8 all bits, construct the index from the bits, check if the entry is in range and invoke the macro that sets the handler
953953
($idt:expr, $handler:ident, $range:expr, $bit7:tt, $bit6:tt, $bit5:tt, $bit4:tt, $bit3:tt, $bit2:tt, $bit1:tt, $bit0:tt) => {{
954954
const IDX: u8 = $bit0 | ($bit1 << 1) | ($bit2 << 2) | ($bit3 << 3) | ($bit4 << 4) | ($bit5 << 5) | ($bit6 << 6) | ($bit7 << 7);
955-
let idx = IDX as usize;
956955

957956
#[allow(unreachable_code)]
958-
if $range.contains(&idx) {
957+
if $range.contains(&IDX) {
959958
$crate::set_general_handler_entry!($idt, $handler, IDX, $bit7, $bit6, $bit5, $bit4, $bit3, $bit2, $bit1, $bit0);
960959
}
961960
}};

0 commit comments

Comments
 (0)