Clean up clang-tidy warnings and unused variables
Change-Id: I1365edf8926908b3a49652fb87f079f8fbf1f56b
This commit is contained in:
committed by
Galantsev, Dmitrii
orang tua
66eb189396
melakukan
aba1c792b4
+1
-1
@@ -1,6 +1,6 @@
|
||||
CompileFlags:
|
||||
Remove: -W*
|
||||
Add: [-Wall, -Wno-c++20-designator, -pedantic]
|
||||
Add: [-Wall, -Wno-c++20-designator, -pedantic, -Wno-sign-conversion]
|
||||
Compiler: clang++
|
||||
|
||||
# list here: https://clang.llvm.org/extra/clang-tidy/checks/list.html
|
||||
|
||||
@@ -108,7 +108,7 @@ class RocmSMI {
|
||||
io_link_map_;
|
||||
std::map<uint32_t, uint32_t> dev_ind_to_node_ind_map_;
|
||||
void AddToDeviceList(std::string dev_name, uint64_t bdfid = 0);
|
||||
typedef struct {
|
||||
typedef struct rsmi_device_enumeration_t {
|
||||
uint32_t card_index = std::numeric_limits<uint32_t>::max();
|
||||
std::string dev_name = "";
|
||||
std::string drm_render_path = "";
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
using amd::smi::monitorTypesToString;
|
||||
using amd::smi::getRSMIStatusString;
|
||||
using amd::smi::AMDGpuMetricTypeId_t;
|
||||
auto &devInfoTypesStrings = amd::smi::Device::devInfoTypesStrings;
|
||||
|
||||
static const uint32_t kMaxOverdriveLevel = 20;
|
||||
static const float kEnergyCounterResolution = 15.3F;
|
||||
@@ -918,7 +917,6 @@ rsmi_status_t rsmi_ras_feature_info_get(
|
||||
TRY
|
||||
rsmi_status_t ret;
|
||||
std::string feature_line;
|
||||
std::string tmp_str;
|
||||
std::ostringstream ss;
|
||||
ss << __PRETTY_FUNCTION__ << " | ======= start =======";
|
||||
LOG_TRACE(ss);
|
||||
@@ -1137,7 +1135,7 @@ rsmi_dev_vendor_id_get(uint32_t dv_ind, uint16_t *id) {
|
||||
}
|
||||
CHK_SUPPORT_NAME_ONLY(id)
|
||||
int ret_kfd = 0;
|
||||
uint32_t node_id;
|
||||
uint32_t node_id = 0;
|
||||
rsmi_status_t ret = get_id(dv_ind, amd::smi::kDevVendorID, id);
|
||||
bool need_fallback = false;
|
||||
if (ret != RSMI_STATUS_SUCCESS) {
|
||||
@@ -1585,7 +1583,6 @@ static rsmi_status_t get_od_clk_volt_info(uint32_t dv_ind,
|
||||
const std::string KTAG_MCLK{"MCLK:"};
|
||||
const std::string KTAG_SCLK{"SCLK:"};
|
||||
const std::string KTAG_OD_RANGE{"OD_RANGE:"};
|
||||
const std::string KTAG_OD_VDDGFX_OFFSET{"OD_VDDGFX_OFFSET:"};
|
||||
const std::string KTAG_FIRST_FREQ_IDX{"0:"};
|
||||
|
||||
amd::smi::TextFileTagContents_t txt_power_dev_od_voltage(val_vec);
|
||||
@@ -2070,7 +2067,6 @@ rsmi_dev_firmware_version_get(uint32_t dv_ind, rsmi_fw_block_t block,
|
||||
LOG_TRACE(ss);
|
||||
CHK_SUPPORT_VAR(fw_version, block)
|
||||
|
||||
std::string val_str;
|
||||
amd::smi::DevInfoTypes dev_type;
|
||||
|
||||
static const std::map<rsmi_fw_block_t, amd::smi::DevInfoTypes> kFWBlockTypeMap = {
|
||||
@@ -2719,7 +2715,6 @@ static std::string get_vendor_name_from_id(uint16_t vendor_id) {
|
||||
static rsmi_status_t get_dev_name_from_id(uint32_t dv_ind, char *name,
|
||||
size_t len, eNameStrType typ) {
|
||||
std::string ln;
|
||||
std::string token1;
|
||||
rsmi_status_t ret;
|
||||
uint16_t device_id;
|
||||
uint16_t vendor_id;
|
||||
@@ -5917,11 +5912,7 @@ rsmi_dev_compute_partition_set(uint32_t dv_ind,
|
||||
|
||||
ss << __PRETTY_FUNCTION__ << " | about to try writing |"
|
||||
<< newComputePartitionStr
|
||||
<< "| size of string = " << newComputePartitionStr.size()
|
||||
<< "| size of c-string = "<< std::dec
|
||||
<< sizeof(newComputePartitionStr.c_str())/sizeof(newComputePartitionStr[0])
|
||||
<< "| sizeof string = " << std::dec
|
||||
<< sizeof(newComputePartitionStr);
|
||||
<< "| size of string = " << newComputePartitionStr.size();
|
||||
LOG_DEBUG(ss);
|
||||
GET_DEV_FROM_INDX
|
||||
DEVICE_MUTEX
|
||||
@@ -6174,7 +6165,6 @@ rsmi_dev_compute_partition_xcp_config_set(uint32_t dv_ind,
|
||||
if (!amd::smi::is_sudo_user()) {
|
||||
return RSMI_STATUS_PERMISSION;
|
||||
}
|
||||
std::string currentXcpConfig = "";
|
||||
std::string newXcpConfigStr = "";
|
||||
std::string availableXcpConfigsStr = "";
|
||||
const int kLen30 = 30;
|
||||
@@ -6248,11 +6238,7 @@ rsmi_dev_compute_partition_xcp_config_set(uint32_t dv_ind,
|
||||
|
||||
ss << __PRETTY_FUNCTION__ << " | about to try writing |"
|
||||
<< newXcpConfigStr
|
||||
<< "| size of string = " << newXcpConfigStr.size()
|
||||
<< "| size of c-string = "<< std::dec
|
||||
<< sizeof(newXcpConfigStr.c_str())/sizeof(newXcpConfigStr[0])
|
||||
<< "| sizeof string = " << std::dec
|
||||
<< sizeof(newXcpConfigStr);
|
||||
<< "| size of string = " << newXcpConfigStr.size();
|
||||
LOG_DEBUG(ss);
|
||||
GET_DEV_FROM_INDX
|
||||
DEVICE_MUTEX
|
||||
|
||||
@@ -21,13 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "rocm_smi/rocm_smi_binary_parser.h"
|
||||
#include "rocm_smi/rocm_smi_common.h" // Should go before rocm_smi.h
|
||||
#include "rocm_smi/rocm_smi.h"
|
||||
#include "rocm_smi/rocm_smi_main.h"
|
||||
#include "rocm_smi/rocm_smi_utils.h"
|
||||
#include "rocm_smi/rocm_smi_exception.h"
|
||||
#include "rocm_smi/rocm_smi_device.h"
|
||||
#include "rocm_smi/rocm_smi_logger.h"
|
||||
|
||||
#include <dirent.h>
|
||||
#include <cinttypes>
|
||||
|
||||
@@ -1797,7 +1797,7 @@ rsmi_status_t Device::isRestartInProgress(bool *isRestartInProgress,
|
||||
if ((success == true) && (!out.empty())) {
|
||||
isSystemAMDGPUModuleLive = containsString(out, "live");
|
||||
}
|
||||
if (isAMDGPUModuleLive) {
|
||||
if (*isAMDGPUModuleLive) {
|
||||
deviceRestartInProgress = false;
|
||||
}
|
||||
*isRestartInProgress = deviceRestartInProgress;
|
||||
@@ -1866,7 +1866,7 @@ rsmi_status_t storeParameter<rsmi_compute_partition_type_t>(uint32_t dv_ind) {
|
||||
template <>
|
||||
rsmi_status_t storeParameter<rsmi_memory_partition_type_t>(uint32_t dv_ind) {
|
||||
rsmi_status_t returnStatus = RSMI_STATUS_SUCCESS;
|
||||
uint32_t kDatalength = 128;
|
||||
const uint32_t kDatalength = 128;
|
||||
char data[kDatalength];
|
||||
bool doesFileExist;
|
||||
std::tie(doesFileExist, std::ignore) = readTmpFile(dv_ind, "boot",
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
@@ -58,8 +56,6 @@ void TestVersionRead::Close() {
|
||||
TestBase::Close();
|
||||
}
|
||||
|
||||
static const uint32_t kVerMaxStrLen = 80;
|
||||
|
||||
void TestVersionRead::Run(void) {
|
||||
amdsmi_status_t err;
|
||||
amdsmi_version_t ver = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, nullptr};
|
||||
|
||||
Reference in New Issue
Block a user