Skip to content

Commit 174e57c

Browse files
committed
drm/asahi: mem: Clippy fixes
Signed-off-by: Asahi Lina <[email protected]>
1 parent 351d94e commit 174e57c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/gpu/drm/asahi/mem.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type Asid = u8;
1919
/// Invalidate the entire GPU TLB.
2020
#[inline(always)]
2121
pub(crate) fn tlbi_all() {
22+
// SAFETY: tlbi is always safe by definition
2223
unsafe {
2324
asm!(".arch armv8.4-a", "tlbi vmalle1os",);
2425
}
@@ -33,6 +34,7 @@ pub(crate) fn tlbi_asid(asid: Asid) {
3334
return;
3435
}
3536

37+
// SAFETY: tlbi is always safe by definition
3638
unsafe {
3739
asm!(
3840
".arch armv8.4-a",
@@ -52,6 +54,7 @@ pub(crate) fn tlbi_page(asid: Asid, va: usize) {
5254
}
5355

5456
let val: u64 = ((asid as u64) << 48) | ((va as u64 >> 12) & 0xffffffffffc);
57+
// SAFETY: tlbi is always safe by definition
5558
unsafe {
5659
asm!(
5760
".arch armv8.4-a",
@@ -110,6 +113,7 @@ pub(crate) fn tlbi_range(asid: Asid, va: usize, len: usize) {
110113
val |= (exp as u64) << 44;
111114

112115
while base > 32 {
116+
// SAFETY: tlbi is always safe by definition
113117
unsafe {
114118
asm!(
115119
".arch armv8.4-a",
@@ -120,6 +124,7 @@ pub(crate) fn tlbi_range(asid: Asid, va: usize, len: usize) {
120124
base -= 32;
121125
}
122126

127+
// SAFETY: tlbi is always safe by definition
123128
unsafe {
124129
asm!(
125130
".arch armv8.4-a",
@@ -132,6 +137,7 @@ pub(crate) fn tlbi_range(asid: Asid, va: usize, len: usize) {
132137
/// Issue a memory barrier (`dsb sy`).
133138
#[inline(always)]
134139
pub(crate) fn sync() {
140+
// SAFETY: Barriers are always safe
135141
unsafe {
136142
asm!("dsb sy");
137143
}

0 commit comments

Comments
 (0)