From 0df7a72d57c6bea82f359f5c8aec8cc5628d8d0d Mon Sep 17 00:00:00 2001 From: Tennessee Carmel-Veilleux Date: Mon, 27 Jun 2022 21:51:06 -0400 Subject: [PATCH] Applied code review comments --- .../access-control-server/access-control-server.cpp | 4 ---- src/credentials/FabricTable.cpp | 7 ++++--- src/credentials/FabricTable.h | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/app/clusters/access-control-server/access-control-server.cpp b/src/app/clusters/access-control-server/access-control-server.cpp index 5d432121fc1948..33ddd2979a3a2a 100644 --- a/src/app/clusters/access-control-server/access-control-server.cpp +++ b/src/app/clusters/access-control-server/access-control-server.cpp @@ -149,7 +149,6 @@ CHIP_ERROR AccessControlAttribute::ReadAcl(AttributeValueEncoder & aEncoder) CHIP_ERROR AccessControlAttribute::ReadExtension(AttributeValueEncoder & aEncoder) { -#if SUPPORT_EXTENSION auto & storage = Server::GetInstance().GetPersistentStorage(); DefaultStorageKeyAllocator key; @@ -175,9 +174,6 @@ CHIP_ERROR AccessControlAttribute::ReadExtension(AttributeValueEncoder & aEncode } return CHIP_NO_ERROR; }); -#else - return CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute); -#endif } CHIP_ERROR AccessControlAttribute::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) diff --git a/src/credentials/FabricTable.cpp b/src/credentials/FabricTable.cpp index afcf79715c92b3..743149ef20a0f3 100644 --- a/src/credentials/FabricTable.cpp +++ b/src/credentials/FabricTable.cpp @@ -51,14 +51,15 @@ constexpr TLV::Tag kFabricLabelTag = TLV::ContextTag(1); constexpr TLV::Tag kNextAvailableFabricIndexTag = TLV::ContextTag(0); constexpr TLV::Tag kFabricIndicesTag = TLV::ContextTag(1); -// Tagsd for commit marker storage +// Tags for commit marker storage constexpr TLV::Tag kMarkerFabricIndexTag = TLV::ContextTag(0); constexpr TLV::Tag kMarkerIsAdditionTag = TLV::ContextTag(1); constexpr size_t CommitMarkerContextTLVMaxSize() { - // Add room for the future - return TLV::EstimateStructOverhead(sizeof(FabricIndex), sizeof(bool)) * 2; + // Add 2x uncommitted uint64_t to leave space for backwards/forwards + // versioning for this critical feature that runs at boot. + return TLV::EstimateStructOverhead(sizeof(FabricIndex), sizeof(bool), sizeof(uint64_t), sizeof(uint64_t)); } constexpr size_t IndexInfoTLVMaxSize() diff --git a/src/credentials/FabricTable.h b/src/credentials/FabricTable.h index f2182c7733fcbe..b7cffb12dcf114 100644 --- a/src/credentials/FabricTable.h +++ b/src/credentials/FabricTable.h @@ -423,7 +423,7 @@ class DLL_EXPORT FabricTable void Shutdown(); /** - * @brief If `Init()` caused a Deted due to partial commit, the fabric index at play is returned. + * @brief If `Init()` caused a Delete due to partial commit, the fabric index at play is returned. * * Allows caller to schedule more clean-up. This is because at Init() time, none of the delegates * are registered yet, so no other modules would learn of the removal.