Message ID | 20240724085318.209318-2-YanceyChiew@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Fix com.bluez.battery1 randomly missing percentage | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/CheckPatch | success | CheckPatch PASS |
tedd_an/GitLint | success | Gitlint PASS |
tedd_an/BuildEll | success | Build ELL PASS |
tedd_an/BluezMake | success | Bluez Make PASS |
tedd_an/MakeCheck | success | Bluez Make Check PASS |
tedd_an/MakeDistcheck | success | Make Distcheck PASS |
tedd_an/CheckValgrind | success | Check Valgrind PASS |
tedd_an/CheckSmatch | success | CheckSparse PASS |
tedd_an/bluezmakeextell | success | Make External ELL PASS |
tedd_an/IncrementalBuild | success | Incremental Build PASS |
tedd_an/ScanBuild | success | Scan Build PASS |
This is automated email and please do not reply to this email! Dear submitter, Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series: PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=873475 ---Test result--- Test Summary: CheckPatch PASS 0.44 seconds GitLint PASS 0.28 seconds BuildEll PASS 24.83 seconds BluezMake PASS 1661.64 seconds MakeCheck PASS 13.09 seconds MakeDistcheck PASS 179.23 seconds CheckValgrind PASS 251.92 seconds CheckSmatch PASS 355.14 seconds bluezmakeextell PASS 118.93 seconds IncrementalBuild PASS 1448.45 seconds ScanBuild PASS 1011.74 seconds --- Regards, Linux Bluetooth
diff --git a/profiles/battery/battery.c b/profiles/battery/battery.c index 02d024d92..b2699c0d7 100644 --- a/profiles/battery/battery.c +++ b/profiles/battery/battery.c @@ -94,13 +94,15 @@ static void parse_battery_level(struct batt *batt, uint8_t percentage; percentage = value[0]; + + if (!batt->battery) { + warn("Trying to update an unregistered battery"); + return; + } + if (batt->percentage != percentage) { batt->percentage = percentage; DBG("Battery Level updated: %d%%", percentage); - if (!batt->battery) { - warn("Trying to update an unregistered battery"); - return; - } btd_battery_update(batt->battery, batt->percentage); } }