|
21 | 21 |
|
22 | 22 | use core::{arch::asm, panic::PanicInfo, ptr::read_volatile}; |
23 | 23 |
|
24 | | -use likely_stable::likely; |
25 | 24 | use max78000::{FLC, GCR, ICC0}; |
26 | 25 |
|
27 | 26 | /// A macro for ensuring that code never exits, even in cases of fault-injection attacks. |
@@ -132,7 +131,7 @@ impl FlashController<'_, '_> { |
132 | 131 | /// - The FLC must be in its ready state after [`Self::wait_until_ready`] |
133 | 132 | #[inline(always)] |
134 | 133 | unsafe fn set_clock_divisor(&self, sys_clk_freq: u32) { |
135 | | - if likely(sys_clk_freq % 1_000_000 != 0) { |
| 134 | + if sys_clk_freq % 1_000_000 != 0 { |
136 | 135 | panic() |
137 | 136 | } |
138 | 137 |
|
@@ -275,14 +274,14 @@ impl FlashController<'_, '_> { |
275 | 274 | /// - `address` must be aligned to 128 bits |
276 | 275 | #[inline(always)] |
277 | 276 | unsafe fn write128(&self, address: u32, data: &[u32; 4], sys_clk_freq: u32) { |
278 | | - if likely(!check_address_bounds(address..address + 16)) { |
| 277 | + if !check_address_bounds(address..address + 16) { |
279 | 278 | panic(); |
280 | 279 | } |
281 | 280 | #[allow( |
282 | 281 | clippy::cast_possible_truncation, |
283 | 282 | reason = "the target pointer width is 32, so this will not truncate" |
284 | 283 | )] |
285 | | - if likely(address % size_of::<[u32; 4]>() as u32 != 0) { |
| 284 | + if address % size_of::<[u32; 4]>() as u32 != 0 { |
286 | 285 | panic(); |
287 | 286 | } |
288 | 287 |
|
@@ -324,7 +323,7 @@ impl FlashController<'_, '_> { |
324 | 323 | clippy::range_plus_one, |
325 | 324 | reason = "the caller takes a Range struct, not an `impl RangeBounds`" |
326 | 325 | )] |
327 | | - if likely(!check_address_bounds(address..address + 1)) { |
| 326 | + if !check_address_bounds(address..address + 1) { |
328 | 327 | panic() |
329 | 328 | } |
330 | 329 | // SAFETY: the caller must guarantee that `sys_clk_freq` is valid per this function's |
@@ -353,10 +352,10 @@ impl FlashController<'_, '_> { |
353 | 352 | #[export_name = "flc_read32_primitive"] |
354 | 353 | #[link_section = ".analogsucks"] |
355 | 354 | pub unsafe extern "C" fn read32(address: *const u32) -> u32 { |
356 | | - if likely(!address.is_aligned()) { |
| 355 | + if !address.is_aligned() { |
357 | 356 | panic(); |
358 | 357 | } |
359 | | - if likely(!check_address_bounds(address as u32..(address as u32 + 4))) { |
| 358 | + if !check_address_bounds(address as u32..(address as u32 + 4)) { |
360 | 359 | panic(); |
361 | 360 | } |
362 | 361 | // SAFETY: the caller must guarantee that `address` is aligned and is within |
|
0 commit comments