Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 618b5fa5 authored by Yi Kong's avatar Yi Kong
Browse files

Remove unreachable code

The conditionals can never be true, as they are outside of the bounds of
their data types. Fixes tautological-constant-compare warning.

Bug: 72331526
Test: m
Change-Id: I74063fe19b319ee32e4c1c8b3a5fc7ed612586e3
parent 5b0cac46
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -1060,11 +1060,6 @@ bool bta_gattc_cache_load(tBTA_GATTC_CLCB* p_clcb) {
    goto done;
  }

  if (num_attr > 0xFFFF) {
    LOG(ERROR) << __func__ << ": more than 0xFFFF GATT attributes: " << fname;
    goto done;
  }

  attr = (tBTA_GATTC_NV_ATTR*)osi_malloc(sizeof(tBTA_GATTC_NV_ATTR) * num_attr);

  if (fread(attr, sizeof(tBTA_GATTC_NV_ATTR), num_attr, fd) != num_attr) {
+2 −2
Original line number Diff line number Diff line
@@ -496,8 +496,8 @@ void BTM_BleReadScanReports(tBTM_BLE_BATCH_SCAN_MODE scan_mode,

  /* Check only for modes, as scan reports can be called after disabling batch
   * scan */
  if (read_scan_mode < 0 || (scan_mode != BTM_BLE_BATCH_SCAN_MODE_PASS &&
                             scan_mode != BTM_BLE_BATCH_SCAN_MODE_ACTI)) {
  if (scan_mode != BTM_BLE_BATCH_SCAN_MODE_PASS &&
      scan_mode != BTM_BLE_BATCH_SCAN_MODE_ACTI) {
    BTM_TRACE_ERROR("Illegal read scan params: %d, %d, %d", read_scan_mode,
                    scan_mode, ble_batchscan_cb.cur_state);
    cb.Run(BTM_ILLEGAL_VALUE, 0, 0, {});