Skip to content

Commit 6b61c12

Browse files
committed
drm/asahi: Fix Clippy complaints
Signed-off-by: Asahi Lina <[email protected]>
1 parent 29e263f commit 6b61c12

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/gpu/drm/asahi/alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ impl Allocator for SimpleAllocator {
575575
true,
576576
)?;
577577

578-
let ptr = unsafe { p.add(offset) } as *mut u8;
578+
let ptr = unsafe { p.add(offset) };
579579
let gpu_ptr = (iova + offset) as u64;
580580

581581
mod_dev_dbg!(

drivers/gpu/drm/asahi/object.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ macro_rules! inner_ptr {
112112
($gpuva:expr, $($f:tt)*) => ({
113113
// This mirrors kernel::offset_of(), except we use type inference to avoid having to know
114114
// the type of the pointer explicitly.
115-
fn uninit_from<'a, T: GpuStruct>(_: GpuPointer<'a, T>) -> core::mem::MaybeUninit<T::Raw<'static>> {
115+
fn uninit_from<T: GpuStruct>(_: GpuPointer<'_, T>) -> core::mem::MaybeUninit<T::Raw<'static>> {
116116
core::mem::MaybeUninit::uninit()
117117
}
118118
let tmp = uninit_from($gpuva);
@@ -635,7 +635,7 @@ impl<T: Copy, U: Allocation<T>> GpuArray<T, U> {
635635
impl<T: Default, U: Allocation<T>> GpuArray<T, U> {
636636
/// Allocate a new GPU array, initializing each element to its default.
637637
pub(crate) fn empty(alloc: U, count: usize) -> Result<GpuArray<T, U>> {
638-
let p = alloc.ptr().ok_or(EINVAL)?.as_ptr() as *mut T;
638+
let p = alloc.ptr().ok_or(EINVAL)?.as_ptr();
639639
let inner = GpuOnlyArray::new(alloc, count)?;
640640
let mut pi = p;
641641
for _i in 0..count {

0 commit comments

Comments
 (0)