Skip to content

Commit

Permalink
Restyled by clang-format (#11464)
Browse files Browse the repository at this point in the history
Co-authored-by: Restyled.io <[email protected]>
Signed-off-by: Doru Gucea <[email protected]>
  • Loading branch information
2 people authored and doru91 committed Nov 11, 2021
1 parent a49bd3e commit dec7719
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/platform/nxp/k32w/k32w0/KeyValueStoreManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ CHIP_ERROR RestoreFromFlash()
{
ChipLogProgress(DeviceLayer, "KVS, Error while restoring Matter key [%s] from flash with PDM id: %i", key_string_id,
pdm_internal_id);
break;
return err;
}

if (key_string_id_size)
Expand Down Expand Up @@ -162,7 +162,11 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Put(const char * key, const void * value,

if (iter == g_key_ids_set.end())
{
assert(g_key_ids_set.size() < kMaxNumberOfKeys);
if (g_key_ids_set.size() >= kMaxNumberOfKeys)
{
return CHIP_ERROR_NO_MEMORY;
}

g_key_ids_set.insert(key_id);

put_key = true;
Expand All @@ -188,20 +192,20 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Put(const char * key, const void * value,
if (err == CHIP_NO_ERROR)
{
pdm_internal_id = chip::DeviceLayer::Internal::K32WConfigKey(pdm_id_kvs, key_id + kMaxNumberOfKeys);
ChipLogProgress(DeviceLayer, "KVS, save in flash the Matter key [%s] with PDM id: %i", key,
pdm_internal_id);
ChipLogProgress(DeviceLayer, "KVS, save in flash the Matter key [%s] with PDM id: %i", key, pdm_internal_id);

err = chip::DeviceLayer::Internal::K32WConfig::WriteConfigValueStr(pdm_internal_id, key, strlen(key));

if (err != CHIP_NO_ERROR)
{
ChipLogProgress(DeviceLayer, "KVS, Error while saving in flash the Matter key [%s] with PDM id: %i",
key, pdm_internal_id);
ChipLogProgress(DeviceLayer, "KVS, Error while saving in flash the Matter key [%s] with PDM id: %i", key,
pdm_internal_id);
}
}
else
{
ChipLogProgress(DeviceLayer, "KVS, Error while saving in flash the value of the Matter key [%s] with PDM id: %i", key, pdm_internal_id);
ChipLogProgress(DeviceLayer, "KVS, Error while saving in flash the value of the Matter key [%s] with PDM id: %i", key,
pdm_internal_id);
}
}

Expand Down

0 comments on commit dec7719

Please sign in to comment.