Skip to content

Commit d01a698

Browse files
petreeftimedianpopa
authored andcommitted
Fix inclusive range warnings
Signed-off-by: Petre Eftime <[email protected]>
1 parent f17a8b3 commit d01a698

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

devices/src/virtio/mmio.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ impl MmioDevice {
284284
impl BusDevice for MmioDevice {
285285
fn read(&mut self, offset: u64, data: &mut [u8]) {
286286
match offset {
287-
0x00...0xff if data.len() == 4 => {
287+
0x00..=0xff if data.len() == 4 => {
288288
let v = match offset {
289289
0x0 => MMIO_MAGIC_VALUE,
290290
0x04 => MMIO_VERSION,
@@ -309,7 +309,7 @@ impl BusDevice for MmioDevice {
309309
};
310310
LittleEndian::write_u32(data, v);
311311
}
312-
0x100...0xfff => self.device.read_config(offset - 0x100, data),
312+
0x100..=0xfff => self.device.read_config(offset - 0x100, data),
313313
_ => {
314314
warn!(
315315
"invalid virtio mmio read: 0x{:x}:0x{:x}",
@@ -330,7 +330,7 @@ impl BusDevice for MmioDevice {
330330
}
331331

332332
match offset {
333-
0x00...0xff if data.len() == 4 => {
333+
0x00..=0xff if data.len() == 4 => {
334334
let v = LittleEndian::read_u32(data);
335335
match offset {
336336
0x14 => self.features_select = v,
@@ -370,7 +370,7 @@ impl BusDevice for MmioDevice {
370370
}
371371
}
372372
}
373-
0x100...0xfff => {
373+
0x100..=0xfff => {
374374
if self.check_driver_status(DEVICE_DRIVER, DEVICE_FAILED) {
375375
self.device.write_config(offset - 0x100, data)
376376
} else {

kernel/src/cmdline/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub type Result<T> = result::Result<T, Error>;
5050

5151
fn valid_char(c: char) -> bool {
5252
match c {
53-
' '...'~' => true,
53+
' '..='~' => true,
5454
_ => false,
5555
}
5656
}

0 commit comments

Comments
 (0)