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:21 +0000 |
commit | 4e8622838586911cdff80925a18f2899a7d743c7 (patch) | |
tree | b5c23de2d15115a5f146c4c281eb89c0727a9821 | |
parent | 20fe6fcd78523b98b19760936f5b28e4e4a27d69 (diff) | |
download | cuttlefish-modules-4e8622838586911cdff80925a18f2899a7d743c7.tar.gz |
Remove open-coded 64-bit divide
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++) { |