diff options
author | Alistair Delva <adelva@google.com> | 2020-07-29 09:26:23 -0700 |
---|---|---|
committer | Alistair Delva <adelva@google.com> | 2020-07-30 16:00:47 +0000 |
commit | dc9b064cfdf23f217e3a810b518d34ae3b0da2ca (patch) | |
tree | f5b715ac069a5b22754f45df52f399d28c0246b3 | |
parent | a2d85d3045f9921badaf432c3ddb034332a98116 (diff) | |
download | cuttlefish-modules-deprecated/android-5.4-stable.tar.gz |
Remove open-coded 64-bit dividedeprecated/android-5.4-stableandroid-5.4-stable
64-bit divides aren't atomic on 32-bit architectures, which in kernel
mode matters as the divide may be preempted. Ensure we only use the
kernel's helper functions to do this divide.
Bug: 154934534
Change-Id: Ib42ae56acac2cfa1b085b614efd6bc9ef462bd18
-rw-r--r-- | wlan_simulation/virt_wifi_simulation.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wlan_simulation/virt_wifi_simulation.c b/wlan_simulation/virt_wifi_simulation.c index 42b8b50..171b403 100644 --- a/wlan_simulation/virt_wifi_simulation.c +++ b/wlan_simulation/virt_wifi_simulation.c @@ -122,8 +122,8 @@ error: static int select_scan_config(void) { int index; - u64 delta_time = (current_scan_trigger_time - wifi_enable_tsf) / - 1000000000; + u64 delta_time = div_u64(current_scan_trigger_time - wifi_enable_tsf, + 1000000000); for (index = last_scan_config_index; index < total_configured_scan_result; index++) { |