clang-tidy: Suppress unused variable warnings
The following errors were reported during clang-tidy enablement due to
multiple unused variables. This temporary fix suppresses the warnings
using a pragma approach until a permanent solution is
implemented.
Changes:
- Commented out unused variables to suppress the -Wunused-variable
warnings.
'''
../tools/power-utils/aei_updater.cpp:36:15: error: unused variable 'MEM_STRETCH_DELAY' [-Werror
../tools/power-utils/aei_updater.cpp:40:19: error: unused variable 'I2C_SMBUS_BLOCK_MAX' [-Werror
../tools/power-utils/aei_updater.cpp:41:19: error: unused variable 'FW_READ_BLOCK_SIZE' [-Werror
../tools/power-utils/aei_updater.cpp:43:19: error: unused variable 'READ_SEQ_ST_CML_SIZE' [-Werror
../tools/power-utils/aei_updater.cpp:45:19: error: unused variable 'START_SEQUENCE_INDEX' [-Werror
../tools/power-utils/aei_updater.cpp:46:19: error: unused variable 'STATUS_CML_INDEX' [-Werror
../tools/power-utils/aei_updater.cpp:63:19: error: unused variable 'B_CHKSUM_ERR' [-Werror
../tools/power-utils/aei_updater.cpp:64:19: error: unused variable 'B_CHKSUM_SUCCESS' [-Werror
../tools/power-utils/aei_updater.cpp:66:19: error: unused variable 'B_MEM_ERR' [-Werror
../tools/power-utils/aei_updater.cpp:67:19: error: unused variable 'B_ALIGN_ERR' [-Werror
../tools/power-utils/aei_updater.cpp:68:19: error: unused variable 'B_KEY_ERR' [-Werror
../tools/power-utils/aei_updater.cpp:69:19: error: unused variable 'B_START_ERR' [-Werror
../tools/power-utils/aei_updater.cpp:70:19: error: unused variable 'B_IMG_MISSMATCH_ERR' [-Werror
../tools/power-utils/aei_updater.cpp:73:19: error: unused variable 'B_ISP_MODE_CHKSUM_GOOD' [-Werror
../tools/power-utils/aei_updater.cpp:74:19: error: unused variable 'B_PRGM_BUSY' [-Werror
../tools/power-utils/aei_updater.cpp:35:15: error: unused variable 'MEM_WRITE_DELAY' [-Werror
'''
Tested: Build and unit testing verified.
Change-Id: Idbe50bfc465f12f0cf4fd7e382a6f04879f08dba
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/tools/power-utils/aei_updater.cpp b/tools/power-utils/aei_updater.cpp
index 064258e..1e8cc96 100644
--- a/tools/power-utils/aei_updater.cpp
+++ b/tools/power-utils/aei_updater.cpp
@@ -29,6 +29,14 @@
namespace aeiUpdater
{
+
+// Suppress clang-tidy errors for unused variables that are intended
+// for future use
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-variable"
+#endif
+
constexpr uint8_t MAX_RETRIES = 0x02; // Constants for retry limits
constexpr int ISP_STATUS_DELAY = 1200; // Delay for ISP status check (1.2s)
@@ -60,14 +68,15 @@
// OS.
// Define AEI ISP response status bit
-constexpr uint8_t B_CHKSUM_ERR = 0x0; // The checksum verification unsuccessful
-constexpr uint8_t B_CHKSUM_SUCCESS = 0x1; // The checksum verification
- // successful.
-constexpr uint8_t B_MEM_ERR = 0x2; // Memory boundry error indication.
-constexpr uint8_t B_ALIGN_ERR = 0x4; // Address error indication.
-constexpr uint8_t B_KEY_ERR = 0x8; // Invalid Key
-constexpr uint8_t B_START_ERR = 0x10; // Error indicator set at startup.
-constexpr uint8_t B_IMG_MISSMATCH_ERR = 0x20; // Firmware image does not match
+constexpr uint8_t B_CHKSUM_ERR = 0x0; // The checksum verification
+ // unsuccessful
+constexpr uint8_t B_CHKSUM_SUCCESS = 0x1; // The checksum
+// verification successful.
+constexpr uint8_t B_MEM_ERR = 0x2; // Memory boundry error indication.
+constexpr uint8_t B_ALIGN_ERR = 0x4; // Address error indication.
+constexpr uint8_t B_KEY_ERR = 0x8; // Invalid Key
+constexpr uint8_t B_START_ERR = 0x10; // Error indicator set at startup.
+constexpr uint8_t B_IMG_MISSMATCH_ERR = 0x20; // Firmware image does not match
// PSU
constexpr uint8_t B_ISP_MODE = 0x40; // ISP mode
constexpr uint8_t B_ISP_MODE_CHKSUM_GOOD = 0x41; // ISP mode & good checksum.
@@ -75,6 +84,10 @@
constexpr uint8_t SUCCESSFUL_ISP_REBOOT_STATUS = 0x0; // Successful ISP reboot
// status
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
using namespace phosphor::logging;
namespace util = phosphor::power::util;