Convert entry count to u64, remove unnecessary parentheses

This commit is contained in:
Robert Węcławski
2017-12-17 17:19:06 +01:00
parent a48ec82f20
commit ab687852d3
2 changed files with 2 additions and 2 deletions

View File

@@ -67,6 +67,6 @@ impl Entry {
/// Set bits 52-61 in entry, used as counter for page table
pub fn set_counter_bits(&mut self, count: u64) {
self.0 = ((self.0 & 0xc00fffff_ffffffff) | (count << 52));
self.0 = (self.0 & 0xc00fffff_ffffffff) | (count << 52);
}
}

View File

@@ -61,7 +61,7 @@ impl<L> Table<L> where L: TableLevel {
/// Set number of entries in first table entry
fn set_entry_count(&mut self, count: u64) {
assert!(count <= ENTRY_COUNT, "count can't be greater than ENTRY_COUNT");
assert!(count <= ENTRY_COUNT as u64, "count can't be greater than ENTRY_COUNT");
self.entries[0].set_counter_bits(count);
}