Skip to content

255 fix issues exposed by codechecker - #256

Open
Ruben-Lohberg wants to merge 11 commits into
mainfrom
255-fix-issues-exposed-by-codechecker
Open

255 fix issues exposed by codechecker#256
Ruben-Lohberg wants to merge 11 commits into
mainfrom
255-fix-issues-exposed-by-codechecker

Conversation

@Ruben-Lohberg

@Ruben-Lohberg Ruben-Lohberg commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

WIP, do not merge

@Ruben-Lohberg Ruben-Lohberg linked an issue Jul 27, 2026 that may be closed by this pull request
@github-actions

Copy link
Copy Markdown

Build output available:
openearable_v2_firmware.elf.zip
openearable_v2_fota.zip

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

CodeChecker static analysis (advisory)

Note

This report is informational. It does not block merging and does not change code.

At a glance

Scope Result
Findings on lines changed by this PR 0
Findings in the complete codebase 81
Analyzer invocations completed 152
Analyzer invocations failed 0

Findings on changed lines

No non-style findings were reported on lines changed by this PR.

Analyzer coverage

Analyzer Completed Failed
clangsa 76 0
cppcheck 76 0

Complete-codebase summary

Severity: 5 high, 76 low
Reported by analyzer: clangsa: 81

Complete-codebase findings

Each finding includes source context. The > line and carets identify the expression reported by the analyzer.

Show detailed findings with source context (81 of 81)
HIGHsrc/audio/audio_datapath.c:844 — Null pointer passed as 1st argument to memory set function
  843 | 
> 844 |                 memset(tx_buf, 0, BLK_STEREO_SIZE_OCTETS);
      |                        ^^^^^^
  845 |             }
HIGHsrc/audio/streamctrl.c:599 — The left operand of '<<' is a garbage value
  598 | 
> 599 |         uint32_t hash_ref = (csis_rsi[2] << 16) | (csis_rsi[1] << 8) | csis_rsi[0];
      |                              ^^^^^^^^^^^
  600 |         uint32_t hash;
HIGHsrc/audio/streamctrl.c:602 — The left operand of '^' is a garbage value
  601 | 
> 602 |         uint32_t new_sirk = *((uint32_t *) chip_id) ^ oe_boot_state.device_id;
      |                             ^^^^^^^^^^^^^^^^^^^^^^^
  603 | 
HIGHsrc/audio/sw_codec_select.c:180 — 2nd function call argument is an uninitialized value
  179 | 
> 180 |             ret = sw_codec_lc3_enc_run(pcm_data_mono_ptrs[AUDIO_CH_L],
      |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 181 |                            pcm_block_size_mono, LC3_USE_BITRATE_FROM_INIT,
  182 |                            AUDIO_CH_L, sizeof(m_encoded_data),
HIGHsrc/audio/sw_codec_select.c:324 — 1st function call argument is an uninitialized value
  323 | 
> 324 |             ret = pscm_combine(pcm_in_data_ptrs[AUDIO_CH_L],
      |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  325 |                        pcm_in_data_ptrs[AUDIO_CH_R], pcm_size_mono,
LOWsrc/Battery/BQ25120a.cpp:156 — Value stored to 'ret' during its initialization is never read
  155 |         uint8_t status = 0;
> 156 |         bool ret = readReg(registers::CTRL, (uint8_t *) &status, sizeof(status));
      |              ^^^
  157 | 
LOWsrc/Battery/BQ25120a.cpp:163 — Value stored to 'ret' during its initialization is never read
  162 |         uint8_t status = 0;
> 163 |         bool ret = readReg(registers::FAULT, (uint8_t *) &status, sizeof(status));
      |              ^^^
  164 | 
LOWsrc/Battery/BQ25120a.cpp:170 — Value stored to 'ret' during its initialization is never read
  169 |         uint8_t status = 0;
> 170 |         bool ret = readReg(registers::TS_FAULT, (uint8_t *) &status, sizeof(status));
      |              ^^^
  171 | 
LOWsrc/Battery/BQ25120a.cpp:177 — Value stored to 'ret' during its initialization is never read
  176 |         uint8_t status = 0;
> 177 |         bool ret = readReg(registers::CHARGE_CTRL, (uint8_t *) &status, sizeof(status));
      |              ^^^
  178 | 
LOWsrc/Battery/BQ25120a.cpp:203 — Value stored to 'ret' during its initialization is never read
  202 |         uint8_t status = 0;
> 203 |         bool ret = readReg(registers::CHARGE_CTRL, &status, sizeof(status));
      |              ^^^
  204 | 
LOWsrc/Battery/BQ25120a.cpp:258 — Value stored to 'ret' during its initialization is never read
  257 |         uint8_t status = 0;
> 258 |         bool ret = readReg(registers::LS_LDO_CTRL, (uint8_t *) &status, sizeof(status));
      |              ^^^
  259 | 
LOWsrc/Battery/BQ25120a.cpp:267 — Value stored to 'ret' during its initialization is never read
  266 |         uint8_t status = 0;
> 267 |         bool ret = readReg(registers::BAT_VOL_CTRL, (uint8_t *) &status, sizeof(status));
      |              ^^^
  268 | 
LOWsrc/Battery/BQ25120a.cpp:291 — Value stored to 'ret' during its initialization is never read
  290 |         uint8_t status = 0;
> 291 |         bool ret = readReg(registers::TERM_CTRL, (uint8_t *) &status, sizeof(status));
      |              ^^^
  292 | 
LOWsrc/Battery/BQ25120a.cpp:344 — Value stored to 'ret' during its initialization is never read
  343 | 
> 344 |         bool ret = readReg(registers::ILIM_UVLO, (uint8_t *) &status, sizeof(status));
      |              ^^^
  345 | 
LOWsrc/Battery/BQ25120a.cpp:411 — Value stored to 'ret' during its initialization is never read
  410 |         uint8_t status = 0;
> 411 |         bool ret = readReg(registers::BTN_CTRL, (uint8_t *) &status, sizeof(status));
      |              ^^^
  412 | 
LOWsrc/Battery/BQ27220.cpp:99 — Value stored to 'ret' during its initialization is never read
   98 |         uint16_t val = 0;
>  99 |         bool ret = readReg(registers::FLAGS, (uint8_t *) &val, sizeof(val));
      |              ^^^
  100 | 
LOWsrc/Battery/BQ27220.cpp:138 — Value stored to 'ret' during its initialization is never read
  137 |         uint16_t temp_K = 0;
> 138 |         bool ret = readReg(registers::TEMP, (uint8_t *) &temp_K, sizeof(temp_K));
      |              ^^^
  139 | 
LOWsrc/Battery/BQ27220.cpp:146 — Value stored to 'ret' during its initialization is never read
  145 |         uint16_t mV = 0;
> 146 |         bool ret = readReg(registers::VOLT, (uint8_t *) &mV, sizeof(mV));
      |              ^^^
  147 | 
LOWsrc/Battery/BQ27220.cpp:154 — Value stored to 'ret' during its initialization is never read
  153 |         uint16_t mAh = 0;
> 154 |         bool ret = readReg(registers::FCC, (uint8_t *) &mAh, sizeof(mAh));
      |              ^^^
  155 |         return mAh;
LOWsrc/Battery/BQ27220.cpp:160 — Value stored to 'ret' during its initialization is never read
  159 |         uint16_t minutes = 0;
> 160 |         bool ret = readReg(registers::TTF, (uint8_t *) &minutes, sizeof(minutes));
      |              ^^^
  161 |         return minutes;
LOWsrc/Battery/BQ27220.cpp:167 — Value stored to 'ret' during its initialization is never read
  166 |         uint16_t minutes = 0;
> 167 |         bool ret = readReg(registers::TTE, (uint8_t *) &minutes, sizeof(minutes));
      |              ^^^
  168 |         return minutes;
LOWsrc/Battery/BQ27220.cpp:173 — Value stored to 'ret' during its initialization is never read
  172 |         uint16_t soc = 0;
> 173 |         bool ret = readReg(registers::SOC, (uint8_t *) &soc, sizeof(soc));
      |              ^^^
  174 |         return soc;
LOWsrc/Battery/BQ27220.cpp:179 — Value stored to 'ret' during its initialization is never read
  178 |         uint16_t soc = 0;
> 179 |         bool ret = readReg(registers::SOH, (uint8_t *) &soc, sizeof(soc));
      |              ^^^
  180 |         return soc;
LOWsrc/Battery/BQ27220.cpp:185 — Value stored to 'ret' during its initialization is never read
  184 |         int16_t mA = 0;
> 185 |         bool ret = readReg(registers::NAC, (uint8_t *) &mA, sizeof(mA));
      |              ^^^
  186 |         return mA;
LOWsrc/Battery/BQ27220.cpp:191 — Value stored to 'ret' during its initialization is never read
  190 |         int16_t mA = 0;
> 191 |         bool ret = readReg(registers::AI, (uint8_t *) &mA, sizeof(mA));
      |              ^^^
  192 |         return mA;
LOWsrc/Battery/BQ27220.cpp:197 — Value stored to 'ret' during its initialization is never read
  196 |         uint16_t mAh = 0;
> 197 |         bool ret = readReg(registers::DCAP, (uint8_t *) &mAh, sizeof(mAh));
      |              ^^^
  198 |         return mAh;
LOWsrc/Battery/BQ27220.cpp:203 — Value stored to 'ret' during its initialization is never read
  202 |         uint16_t mAh = 0;
> 203 |         bool ret = readReg(registers::RM, (uint8_t *) &mAh, sizeof(mAh));
      |              ^^^
  204 |         return mAh;
LOWsrc/Battery/BQ27220.cpp:209 — Value stored to 'ret' during its initialization is never read
  208 |         int16_t mA = 0;
> 209 |         bool ret = readReg(registers::CC, (uint8_t *) &mA, sizeof(mA));
      |              ^^^
  210 |         return mA;
LOWsrc/Battery/BQ27220.cpp:215 — Value stored to 'ret' during its initialization is never read
  214 |         uint16_t n_cycles = 0;
> 215 |         bool ret = readReg(registers::CYCT, (uint8_t *) &n_cycles, sizeof(n_cycles));
      |              ^^^
  216 |         return n_cycles;
LOWsrc/Battery/BQ27220.cpp:221 — Value stored to 'ret' during its initialization is never read
  220 |         int16_t mA = 0;
> 221 |         bool ret = readReg(registers::SI, (uint8_t *) &mA, sizeof(mA));
      |              ^^^
  222 | 
LOWsrc/Battery/BQ27220.cpp:229 — Value stored to 'ret' during its initialization is never read
  228 |         uint16_t status = 0;
> 229 |         bool ret = readReg(registers::OP_STAT, (uint8_t *) &status, sizeof(status));
      |              ^^^
  230 |         
LOWsrc/Battery/BQ27220.cpp:309 — Value stored to 'ret' is never read
  308 |         k_usleep(BQ27220_RAM_TIMEOUT_US);
> 309 |         ret = readReg(0x40, data, len);
      |               ^^^^^^^^^^^^^^^^^^^^^^^^
  310 | }
LOWsrc/Battery/BQ27220.cpp:323 — Value stored to 'ret' is never read
  322 | 
> 323 |         ret = readReg(0x61, (uint8_t *) &data_len, sizeof(data_len));
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  324 |         ret = readReg(0x40, buf, len);
LOWsrc/Battery/BQ27220.cpp:324 — Value stored to 'ret' is never read
  323 |         ret = readReg(0x61, (uint8_t *) &data_len, sizeof(data_len));
> 324 |         ret = readReg(0x40, buf, len);
      |               ^^^^^^^^^^^^^^^^^^^^^^^
  325 |         ret = readReg(0x60, (uint8_t *) &check_sum, sizeof(check_sum));
LOWsrc/Battery/BQ27220.cpp:325 — Value stored to 'ret' is never read
  324 |         ret = readReg(0x40, buf, len);
> 325 |         ret = readReg(0x60, (uint8_t *) &check_sum, sizeof(check_sum));
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  326 | 
LOWsrc/Battery/BQ27220.cpp:388 — Value stored to 'ret' is never read
  387 |         // design and full charge capacity
> 388 |         ret = write_RAM(0x929F, _battery_settings.capacity);
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  389 |         ret = write_RAM(0x929D, _battery_settings.capacity); //130
LOWsrc/Battery/BQ27220.cpp:389 — Value stored to 'ret' is never read
  388 |         ret = write_RAM(0x929F, _battery_settings.capacity);
> 389 |         ret = write_RAM(0x929D, _battery_settings.capacity); //130
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  390 |         // near full
LOWsrc/Battery/BQ27220.cpp:391 — Value stored to 'ret' is never read
  390 |         // near full
> 391 |         ret = write_RAM(0x926B, 5);
      |               ^^^^^^^^^^^^^^^^^^^^
  392 | 
LOWsrc/Battery/BQ27220.cpp:393 — Value stored to 'ret' is never read
  392 | 
> 393 |         ret = write_RAM(0x91F5, _battery_settings.temp_min * 10);
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  394 |         ret = write_RAM(0x91F7, _battery_settings.temp_max * 10);
LOWsrc/Battery/BQ27220.cpp:394 — Value stored to 'ret' is never read
  393 |         ret = write_RAM(0x91F5, _battery_settings.temp_min * 10);
> 394 |         ret = write_RAM(0x91F7, _battery_settings.temp_max * 10);
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  395 | 
LOWsrc/Battery/BQ27220.cpp:397 — Value stored to 'ret' is never read
  396 |         // charge current
> 397 |         ret = write_RAM(0x91FB, _battery_settings.i_charge);
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  398 | 
LOWsrc/Battery/BQ27220.cpp:400 — Value stored to 'ret' is never read
  399 |         // charge voltage
> 400 |         ret = write_RAM(0x91FD, _battery_settings.u_term * 1000);
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  401 | 
LOWsrc/Battery/BQ27220.cpp:403 — Value stored to 'ret' is never read
  402 |         // taper current
> 403 |         ret = write_RAM(0x9201, _battery_settings.i_term);
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  404 | 
LOWsrc/Battery/BQ27220.cpp:406 — Value stored to 'ret' is never read
  405 |         // experimental: min taper capacity
> 406 |         ret = write_RAM(0x9203, 4); // standard: 25
      |               ^^^^^^^^^^^^^^^^^^^^
  407 | 
LOWsrc/Battery/BQ27220.cpp:410 — Value stored to 'ret' is never read
  409 |         uint8_t val = 1;
> 410 |         ret = write_RAM(0x91DE, &val, sizeof(uint8_t));
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  411 |         
LOWsrc/Battery/BQ27220.cpp:418 — Value stored to 'ret' is never read
  417 |         // sleep current
> 418 |         ret = write_RAM(0x9217, 1);
      |               ^^^^^^^^^^^^^^^^^^^^
  419 | 
LOWsrc/Battery/BQ27220.cpp:421 — Value stored to 'ret' is never read
  420 |         // dischage current trd
> 421 |         ret = write_RAM(0x9228, 2);
      |               ^^^^^^^^^^^^^^^^^^^^
  422 |         // charge current trd
LOWsrc/Battery/BQ27220.cpp:423 — Value stored to 'ret' is never read
  422 |         // charge current trd
> 423 |         ret = write_RAM(0x922A, 2);
      |               ^^^^^^^^^^^^^^^^^^^^
  424 |         // quit current
LOWsrc/Battery/BQ27220.cpp:425 — Value stored to 'ret' is never read
  424 |         // quit current
> 425 |         ret = write_RAM(0x922C, 1);
      |               ^^^^^^^^^^^^^^^^^^^^
  426 | 
LOWsrc/Battery/BQ27220.cpp:447 — Value stored to 'ret' is never read
  446 |         // sysDown set Voltage
> 447 |         ret = write_RAM(0x9240, _battery_settings.u_vlo * 1000 + CONFIG_BATTERY_SYSDOWN_SET_OFFSET);
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  448 | 
LOWsrc/Battery/BQ27220.cpp:450 — Value stored to 'ret' is never read
  449 |         // sysDown clear Voltage
> 450 |         ret = write_RAM(0x9243, _battery_settings.u_vlo * 1000 + CONFIG_BATTERY_SYSDOWN_SET_OFFSET + CONFIG_BATTERY_SYSDOWN_HYSTERESIS);
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  451 | 
LOWsrc/Battery/BQ27220.cpp:453 — Value stored to 'ret' is never read
  452 |         // FD set
> 453 |         ret = write_RAM(0x9282, _battery_settings.u_vlo * 1000 + CONFIG_BATTERY_FD_SET_OFFSET);
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  454 | 
LOWsrc/Battery/BQ27220.cpp:456 — Value stored to 'ret' is never read
  455 |         // FD clear
> 456 |         ret = write_RAM(0x9284, _battery_settings.u_vlo * 1000 + CONFIG_BATTERY_FD_SET_OFFSET + CONFIG_BATTERY_FD_HYSTERESIS); 
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  457 | 
LOWsrc/Battery/BQ27220.cpp:459 — Value stored to 'ret' is never read
  458 |         // FC Voltage
> 459 |         ret = write_RAM(0x9288, _battery_settings.u_term * 1000 - CONFIG_BATTERY_FC_VOLTAGE_OFFSET);
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  460 | 
LOWsrc/Battery/BQ27220.cpp:462 — Value stored to 'ret' is never read
  461 |         // Electonic Load in 3µA steps
> 462 |         ret = write_RAM(0x9269, 6); // 18 µA
      |               ^^^^^^^^^^^^^^^^^^^^
  463 | 
LOWsrc/Battery/BQ27220.cpp:467 — Value stored to 'ret' is never read
  466 |         //C0
> 467 |         ret = write_RAM(0x92A9, 480); //bat1:250
      |               ^^^^^^^^^^^^^^^^^^^^^^
  468 |         //R0
LOWsrc/Battery/BQ27220.cpp:469 — Value stored to 'ret' is never read
  468 |         //R0
> 469 |         ret = write_RAM(0x92AB, 19941); //bat1: 19941 //22542 //new bat:  17340
      |               ^^^^^^^^^^^^^^^^^^^^^^^^
  470 |         //R1
LOWsrc/Battery/BQ27220.cpp:481 — Value stored to 'ret' is never read
  480 |         uint8_t flags_b = 0x8C;
> 481 |         ret = write_RAM(0x9281, &flags_b, sizeof(flags_b));
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  482 | 
LOWsrc/Battery/BQ27220.cpp:484 — Value stored to 'ret' is never read
  483 |         // Overload current
> 484 |         ret = write_RAM(0x9264, _battery_settings.i_max);
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  485 | 
LOWsrc/Battery/BQ27220.cpp:488 — Value stored to 'ret' is never read
  487 |         uint8_t cedv_conf = 0x0D; //Default: 0x08, Enable SMEXT, SMEN 0x0D
> 488 |         ret = write_RAM(0x9271, &cedv_conf, sizeof(cedv_conf));
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  489 | 
LOWsrc/Battery/BQ27220.cpp:490 — Value stored to 'ret' is never read
  489 | 
> 490 |         ret = write_RAM(0x9272, 3700);
      |               ^^^^^^^^^^^^^^^^^^^^^^^
  491 | 
LOWsrc/Battery/PowerManager.cpp:546 — Value stored to 'ret' is never read
  545 |     if (info.state == BT_CONN_STATE_CONNECTED) {
> 546 |         ret = bt_mgmt_conn_disconnect(conn, *((uint8_t*)data));
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  547 |     }
LOWsrc/Battery/PowerManager.cpp:557 — Value stored to 'ret' is never read
  556 | 
> 557 |     ret = bt_le_adv_stop();
      |           ^^^^^^^^^^^^^^^^
  558 | 
LOWsrc/Battery/PowerManager.cpp:576 — Value stored to 'ret' is never read
  575 | 
> 576 |     ret = bt_le_adv_stop();
      |           ^^^^^^^^^^^^^^^^
  577 | 
LOWsrc/Battery/PowerManager.cpp:617 — Value stored to 'ret' is never read
  616 | 
> 617 |     ret = bt_mgmt_stop_watchdog();
      |           ^^^^^^^^^^^^^^^^^^^^^^^
  618 |     //ERR_CHK(ret);
LOWsrc/Battery/PowerManager.cpp:634 — Value stored to 'ret' is never read
  633 | 
> 634 |     ret = pm_device_action_run(ls_sd,  PM_DEVICE_ACTION_SUSPEND);
      |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  635 |     ret = pm_device_action_run(ls_3_3, PM_DEVICE_ACTION_SUSPEND);
LOWsrc/Battery/PowerManager.cpp:635 — Value stored to 'ret' is never read
  634 |     ret = pm_device_action_run(ls_sd,  PM_DEVICE_ACTION_SUSPEND);
> 635 |     ret = pm_device_action_run(ls_3_3, PM_DEVICE_ACTION_SUSPEND);
      |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  636 |     ret = pm_device_action_run(ls_1_8, PM_DEVICE_ACTION_SUSPEND);
LOWsrc/Battery/PowerManager.cpp:636 — Value stored to 'ret' is never read
  635 |     ret = pm_device_action_run(ls_3_3, PM_DEVICE_ACTION_SUSPEND);
> 636 |     ret = pm_device_action_run(ls_1_8, PM_DEVICE_ACTION_SUSPEND);
      |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  637 |     ret = pm_device_action_run(cons, PM_DEVICE_ACTION_SUSPEND);
LOWsrc/Battery/PowerManager.cpp:637 — Value stored to 'ret' is never read
  636 |     ret = pm_device_action_run(ls_1_8, PM_DEVICE_ACTION_SUSPEND);
> 637 |     ret = pm_device_action_run(cons, PM_DEVICE_ACTION_SUSPEND);
      |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  638 | 
LOWsrc/SD_Card/SD_Card_Manager/SD_Card_Manager.cpp:118 — Value stored to 'ret' is never read
  117 | 
> 118 |     ret = pm_device_runtime_put(ls_1_8);
      |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  119 |     ret = pm_device_runtime_put(ls_3_3);
LOWsrc/SD_Card/SD_Card_Manager/SD_Card_Manager.cpp:119 — Value stored to 'ret' is never read
  118 |     ret = pm_device_runtime_put(ls_1_8);
> 119 |     ret = pm_device_runtime_put(ls_3_3);
      |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  120 |     ret = pm_device_runtime_put(ls_sd);
LOWsrc/SD_Card/SD_Card_Manager/SD_Card_Manager.cpp:120 — Value stored to 'ret' is never read
  119 |     ret = pm_device_runtime_put(ls_3_3);
> 120 |     ret = pm_device_runtime_put(ls_sd);
      |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  121 | 
LOWsrc/SD_Card/SD_Card_Manager/SD_Card_Manager.cpp:131 — Value stored to 'ret' is never read
  130 |     if (!device_is_ready(sd_state_pin.port)) {
> 131 |         ret = aquire_ls();
      |               ^^^^^^^^^^^
  132 |         LOG_ERR("SD state GPIO device not ready\n");
LOWsrc/SD_Card/SD_Card_Manager/SD_Card_Manager.cpp:181 — Value stored to 'ret' is never read
  180 | 
> 181 |     ret = aquire_ls();
      |           ^^^^^^^^^^^
  182 | 
LOWsrc/SensorManager/BMP388/Adafruit_BMP3XX.cpp:115 — Value stored to 'rslt' is never read
  114 | 
> 115 |   rslt = bmp3_init(&the_sensor);
      |          ^^^^^^^^^^^^^^^^^^^^^^
  116 | #ifdef BMP3XX_DEBUG
LOWsrc/SensorManager/BMX160/DFRobot_BMX160.cpp:97 — Value stored to 'rslt' is never read
  96 |   if (Obmx160 == NULL){
> 97 |     rslt = BMX160_E_NULL_PTR;
     |            ^^^^^^^^^^^^^^^^^
  98 |   }  
LOWsrc/SensorManager/MAXM86161/MAXM86161.cpp:149 — Value stored to 'status' is never read
  148 |         
> 149 |         status = _read_block(REG_FIFO_DATA, number_of_bytes, (uint8_t *) databuffer);
      |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  150 | 
LOWsrc/SensorManager/MAXM86161/MAXM86161.cpp:439 — Value stored to 'status' is never read
  438 |     int status;
> 439 |     status = _read_from_reg(REG_IRQ_STATUS2, value);
      |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  440 |     status = _read_from_reg(REG_IRQ_STATUS1, value);
LOWsrc/SensorManager/SensorManager.cpp:77 — Value stored to 'ret' is never read
  76 |     while (1) {
> 77 |         ret = k_poll(&sensor_manager_evt, 1, K_FOREVER);
     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  78 | 
LOWsrc/audio/audio_system.c:137 — Value stored to 'ret' is never read
  136 |         /* Don't start encoding until the stream needing it has started */
> 137 |         ret = k_poll(&encoder_evt, 1, K_FOREVER);
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  138 | 
LOWsrc/bluetooth/bt_management/scanning/bt_mgmt_scan.c:58 — Value stored to 'scan_param' during its initialization is never read
  57 | 
> 58 |     struct bt_le_scan_param *scan_param =
     |                              ^^^^^^^^^^
  59 |         BT_LE_SCAN_PARAM(NRF5340_AUDIO_GATEWAY_SCAN_TYPE, BT_LE_SCAN_OPT_FILTER_DUPLICATE,

Open the workflow run and download the complete CodeChecker report for a detailed view. Check out codechecker.html/index.html.

@github-actions

Copy link
Copy Markdown

Build output available:
openearable_v2_firmware.elf.zip
openearable_v2_fota.zip

Include the standard and project headers that declare functions used by each translation unit. This lets Clang analyze the files independently instead of relying on transitive includes.
Document the intended loss of precision when storing sensor and parsed values in 32-bit fields. Match variadic format arguments to the unsigned integer type expected by %X while preserving the existing lower-32-bit output.
Call std::fabs for the battery-capacity difference so overload resolution is explicit and the comparison remains in floating-point arithmetic.
The connection callback returns void, so stop processing with a plain return after a parameter-update failure instead of attempting to return the error value.
@Ruben-Lohberg
Ruben-Lohberg force-pushed the 255-fix-issues-exposed-by-codechecker branch from 2a83a4d to fa9f7c5 Compare July 27, 2026 14:00
@github-actions

Copy link
Copy Markdown

Build output available:
openearable_v2_firmware.elf.zip
openearable_v2_fota.zip

Initialize the application LED state and BMP388 FIFO sample data before they are passed to downstream code. This prevents uninitialized fields from being observed on valid error and partial-frame paths.
Only adjust and consume the FIFO length after reading it successfully. This avoids updating FIFO state or issuing a read with an undefined length after an I/O failure.
Return before selecting the Earable button when the callback does not contain its pin. This prevents dereferencing an uninitialized button pointer for an unexpected interrupt mask.
@github-actions

Copy link
Copy Markdown

Build output available:
openearable_v2_firmware.elf.zip
openearable_v2_fota.zip

@Ruben-Lohberg
Ruben-Lohberg force-pushed the 255-fix-issues-exposed-by-codechecker branch from e509194 to 5c96030 Compare July 27, 2026 14:53
@github-actions

Copy link
Copy Markdown

Build output available:
openearable_v2_firmware.elf.zip
openearable_v2_fota.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FW: Fix issues exposed by CodeChecker

1 participant