From 208569086c793c36d79f9b7dfc34c28c502e3146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kr=C3=B3lik?= <66667989+Damian-Nordic@users.noreply.github.com> Date: Fri, 1 Jul 2022 21:00:33 +0200 Subject: [PATCH] [platform] Remove dead code (#20222) Signed-off-by: Damian Krolik --- src/include/platform/CHIPDeviceConfig.h | 13 ------------- src/platform/ESP32/ConfigurationManagerImpl.cpp | 15 --------------- .../Zephyr/ConfigurationManagerImpl.cpp | 17 ----------------- .../BL602/ConfigurationManagerImpl.cpp | 15 --------------- src/platform/qpg/ConfigurationManagerImpl.cpp | 4 ---- 5 files changed, 64 deletions(-) diff --git a/src/include/platform/CHIPDeviceConfig.h b/src/include/platform/CHIPDeviceConfig.h index 0a35aca535a85f..f6b2818e683bf8 100644 --- a/src/include/platform/CHIPDeviceConfig.h +++ b/src/include/platform/CHIPDeviceConfig.h @@ -91,19 +91,6 @@ #define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE 100 #endif -/** - * CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING - * - * Enable the device factory provisioning feature. - * - * The factory provisioning feature allows factory or developer-supplied provisioning information - * to be injected into a device at boot time and automatically stored in persistent storage. - */ -#ifndef CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING -// We don't have platform/internal/FactoryProvisioning.ipp for now, so set it to 0 by default. -#define CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING 0 -#endif - /** * CHIP_DEVICE_CONFIG_LOG_PROVISIONING_HASH * diff --git a/src/platform/ESP32/ConfigurationManagerImpl.cpp b/src/platform/ESP32/ConfigurationManagerImpl.cpp index d7810afeedafc3..99756eb0fcd393 100644 --- a/src/platform/ESP32/ConfigurationManagerImpl.cpp +++ b/src/platform/ESP32/ConfigurationManagerImpl.cpp @@ -105,21 +105,6 @@ CHIP_ERROR ConfigurationManagerImpl::Init() // TODO: Initialize the global GroupKeyStore object here (#1266) -#if CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING - - { - FactoryProvisioning factoryProv; - uint8_t * const kInternalSRAM12Start = (uint8_t *) 0x3FFAE000; - uint8_t * const kInternalSRAM12End = kInternalSRAM12Start + (328 * 1024) - 1; - - // Scan ESP32 Internal SRAM regions 1 and 2 for injected provisioning data and save - // to persistent storage if found. - err = factoryProv.ProvisionDeviceFromRAM(kInternalSRAM12Start, kInternalSRAM12End); - SuccessOrExit(err); - } - -#endif // CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING - err = CHIP_NO_ERROR; exit: diff --git a/src/platform/Zephyr/ConfigurationManagerImpl.cpp b/src/platform/Zephyr/ConfigurationManagerImpl.cpp index c073ddf9577c08..6dfe51ab023f55 100644 --- a/src/platform/Zephyr/ConfigurationManagerImpl.cpp +++ b/src/platform/Zephyr/ConfigurationManagerImpl.cpp @@ -29,10 +29,6 @@ #include #include -#if CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING -#include -#endif // CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING - #include #include @@ -56,19 +52,6 @@ CHIP_ERROR ConfigurationManagerImpl::Init() err = Internal::GenericConfigurationManagerImpl::Init(); SuccessOrExit(err); - // TODO: Initialize the global GroupKeyStore object here -#if CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING - { - FactoryProvisioning factoryProv; - uint8_t * const kDeviceRAMStart = (uint8_t *) CONFIG_SRAM_BASE_ADDRESS; - uint8_t * const kDeviceRAMEnd = kDeviceRAMStart + CONFIG_SRAM_SIZE * 1024 - 1; - - // Scan device RAM for injected provisioning data and save to persistent storage if found. - err = factoryProv.ProvisionDeviceFromRAM(kDeviceRAMStart, kDeviceRAMEnd); - SuccessOrExit(err); - } -#endif // CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING - if (ZephyrConfig::ConfigValueExists(ZephyrConfig::kCounterKey_RebootCount)) { err = GetRebootCount(rebootCount); diff --git a/src/platform/bouffalolab/BL602/ConfigurationManagerImpl.cpp b/src/platform/bouffalolab/BL602/ConfigurationManagerImpl.cpp index a9149928901d4b..158dc51c057a7e 100644 --- a/src/platform/bouffalolab/BL602/ConfigurationManagerImpl.cpp +++ b/src/platform/bouffalolab/BL602/ConfigurationManagerImpl.cpp @@ -71,21 +71,6 @@ CHIP_ERROR ConfigurationManagerImpl::Init() err = Internal::GenericConfigurationManagerImpl::Init(); SuccessOrExit(err); -#if CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING - - { - FactoryProvisioning factoryProv; - uint8_t * const kInternalSRAM12Start = (uint8_t *) 0x3FFAE000; - uint8_t * const kInternalSRAM12End = kInternalSRAM12Start + (328 * 1024) - 1; - - // Scan ESP32 Internal SRAM regions 1 and 2 for injected provisioning data and save - // to persistent storage if found. - err = factoryProv.ProvisionDeviceFromRAM(kInternalSRAM12Start, kInternalSRAM12End); - SuccessOrExit(err); - } - -#endif // CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING - // If the fail-safe was armed when the device last shutdown, initiate a factory reset. if (GetFailSafeArmed(failSafeArmed) == CHIP_NO_ERROR && failSafeArmed) { diff --git a/src/platform/qpg/ConfigurationManagerImpl.cpp b/src/platform/qpg/ConfigurationManagerImpl.cpp index 253175de1a2d9c..139cce0d681b8c 100644 --- a/src/platform/qpg/ConfigurationManagerImpl.cpp +++ b/src/platform/qpg/ConfigurationManagerImpl.cpp @@ -29,10 +29,6 @@ #include #include -#if CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING -#include -#endif // CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING - #include #include