mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-28 12:32:05 -06:00
rust: fix a couple style issues from clippy
These are reported as clippy::semicolon_inside_block and clippy::as_ptr_cast_mut. clippy::semicolon_inside_block can be configured not to lint single-line blocks; just go with the default. Reviewed-by: Junjie Mao <junjie.mao@hotmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
de98c17593
commit
7a35e2fb80
3 changed files with 9 additions and 5 deletions
|
@ -2,7 +2,7 @@
|
|||
// Author(s): Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
use core::ptr::{addr_of, addr_of_mut, NonNull};
|
||||
use core::ptr::{addr_of_mut, NonNull};
|
||||
use std::{
|
||||
ffi::CStr,
|
||||
os::raw::{c_int, c_uchar, c_uint, c_void},
|
||||
|
@ -499,7 +499,9 @@ impl PL011State {
|
|||
let flags = self.int_level & self.int_enabled;
|
||||
for (irq, i) in self.interrupts.iter().zip(IRQMASK) {
|
||||
// SAFETY: self.interrupts have been initialized in init().
|
||||
unsafe { qemu_set_irq(*irq, i32::from(flags & i != 0)) };
|
||||
unsafe {
|
||||
qemu_set_irq(*irq, i32::from(flags & i != 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -601,7 +603,7 @@ pub unsafe extern "C" fn pl011_create(
|
|||
let sysbus: *mut SysBusDevice = dev.cast::<SysBusDevice>();
|
||||
|
||||
qdev_prop_set_chr(dev, c_str!("chardev").as_ptr(), chr);
|
||||
sysbus_realize_and_unref(sysbus, addr_of!(error_fatal) as *mut *mut Error);
|
||||
sysbus_realize_and_unref(sysbus, addr_of_mut!(error_fatal));
|
||||
sysbus_mmio_map(sysbus, 0, addr);
|
||||
sysbus_connect_irq(sysbus, 0, irq);
|
||||
dev
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue