Skip to content

Commit

Permalink
Fix PVS warning
Browse files Browse the repository at this point in the history
  • Loading branch information
skotopes committed Dec 23, 2024
1 parent 8a09e8d commit b920cb4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/nfc/protocols/mf_plus/mf_plus_poller.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static void mf_plus_poller_set_callback(

static NfcCommand mf_plus_poller_run(NfcGenericEvent event, void* context) {
furi_assert(context);
furi_assert(event.protocol = NfcProtocolIso14443_4a);
furi_assert(event.protocol == NfcProtocolIso14443_4a);
furi_assert(event.event_data);

MfPlusPoller* instance = context;
Expand Down Expand Up @@ -178,7 +178,7 @@ void mf_plus_poller_free(MfPlusPoller* instance) {

static bool mf_plus_poller_detect(NfcGenericEvent event, void* context) {
furi_assert(context);
furi_assert(event.protocol = NfcProtocolIso14443_4a);
furi_assert(event.protocol == NfcProtocolIso14443_4a);
furi_assert(event.event_data);

MfPlusPoller* instance = context;
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/protocols/bin_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ SubGhzProtocolStatus
flipper_format, "Repeat", (uint32_t*)&instance->encoder.repeat, 1);

if(!subghz_protocol_encoder_bin_raw_get_upload(instance)) {
break;
res = SubGhzProtocolStatusErrorEncoderGetUpload;
break;
}
instance->encoder.is_running = true;

Expand Down
18 changes: 12 additions & 6 deletions targets/f7/ble_glue/furi_ble/gatt.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

#define GATT_MIN_READ_KEY_SIZE (10)

#ifdef BLE_GATT_STRICT
#define ble_gatt_strict_crash(message) furi_crash(message)
#else
#define ble_gatt_strict_crash(message)
#endif

void ble_gatt_characteristic_init(
uint16_t svc_handle,
const BleGattCharacteristicParams* char_descriptor,
Expand Down Expand Up @@ -42,7 +48,7 @@ void ble_gatt_characteristic_init(
&char_instance->handle);
if(status) {
FURI_LOG_E(TAG, "Failed to add %s char: %d", char_descriptor->name, status);
furi_assert(false, "Failed to add characteristic");
ble_gatt_strict_crash("Failed to add characteristic");
}

char_instance->descriptor_handle = 0;
Expand All @@ -69,7 +75,7 @@ void ble_gatt_characteristic_init(
&char_instance->descriptor_handle);
if(status) {
FURI_LOG_E(TAG, "Failed to add %s char descriptor: %d", char_descriptor->name, status);
furi_assert(false, "Failed to add characteristic descriptor");
ble_gatt_strict_crash("Failed to add characteristic descriptor");
}
if(release_data) {
free((void*)char_data);
Expand All @@ -84,7 +90,7 @@ void ble_gatt_characteristic_delete(
if(status) {
FURI_LOG_E(
TAG, "Failed to delete %s char: %d", char_instance->characteristic->name, status);
furi_assert(false, "Failed to delete characteristic");
ble_gatt_strict_crash("Failed to delete characteristic");
}
free((void*)char_instance->characteristic);
}
Expand Down Expand Up @@ -132,7 +138,7 @@ bool ble_gatt_characteristic_update(

if(result != BLE_STATUS_SUCCESS) {
FURI_LOG_E(TAG, "Failed updating %s characteristic: %d", char_descriptor->name, result);
furi_assert(false, "Failed to update characteristic");
ble_gatt_strict_crash("Failed to update characteristic");
}

return result != BLE_STATUS_SUCCESS;
Expand All @@ -148,7 +154,7 @@ bool ble_gatt_service_add(
Service_UUID_Type, Service_UUID, Service_Type, Max_Attribute_Records, Service_Handle);
if(result) {
FURI_LOG_E(TAG, "Failed to add service: %x", result);
furi_assert(false, "Failed to add service");
ble_gatt_strict_crash("Failed to add service");
}

return result == BLE_STATUS_SUCCESS;
Expand All @@ -158,7 +164,7 @@ bool ble_gatt_service_delete(uint16_t svc_handle) {
tBleStatus result = aci_gatt_del_service(svc_handle);
if(result) {
FURI_LOG_E(TAG, "Failed to delete service: %x", result);
furi_assert(false, "Failed to delete service");
ble_gatt_strict_crash("Failed to delete service");
}

return result == BLE_STATUS_SUCCESS;
Expand Down

0 comments on commit b920cb4

Please sign in to comment.