Skip to content

Commit d41756a

Browse files
author
Tom Dohrmann
committed
use u8 instead of usize
1 parent 8695b39 commit d41756a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/structures/idt.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ macro_rules! set_general_handler {
11661166
{
11671167
fn set_general_handler(
11681168
idt: &mut $crate::structures::idt::InterruptDescriptorTable,
1169-
range: impl ::core::ops::RangeBounds<usize>,
1169+
range: impl ::core::ops::RangeBounds<u8>,
11701170
) {
11711171
$crate::set_general_handler_recursive_bits!(idt, GENERAL_HANDLER, range);
11721172
}
@@ -1183,10 +1183,9 @@ macro_rules! set_general_handler_recursive_bits {
11831183
// 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
11841184
($idt:expr, $handler:ident, $range:expr, $bit7:tt, $bit6:tt, $bit5:tt, $bit4:tt, $bit3:tt, $bit2:tt, $bit1:tt, $bit0:tt) => {{
11851185
const IDX: u8 = $bit0 | ($bit1 << 1) | ($bit2 << 2) | ($bit3 << 3) | ($bit4 << 4) | ($bit5 << 5) | ($bit6 << 6) | ($bit7 << 7);
1186-
let idx = IDX as usize;
11871186

11881187
#[allow(unreachable_code)]
1189-
if $range.contains(&idx) {
1188+
if $range.contains(&IDX) {
11901189
$crate::set_general_handler_entry!($idt, $handler, IDX, $bit7, $bit6, $bit5, $bit4, $bit3, $bit2, $bit1, $bit0);
11911190
}
11921191
}};

0 commit comments

Comments
 (0)