diff --git a/src/driver/amdxdna/aie2_pci.c b/src/driver/amdxdna/aie2_pci.c index 9454b70..ae5c85e 100644 --- a/src/driver/amdxdna/aie2_pci.c +++ b/src/driver/amdxdna/aie2_pci.c @@ -789,7 +789,7 @@ static int aie2_get_firmware_version(struct amdxdna_client *client, static int aie2_get_power_mode(struct amdxdna_client *client, struct amdxdna_drm_get_info *args) { - struct amdxdna_drm_get_power_mode mode; + struct amdxdna_drm_get_power_mode mode = {}; struct amdxdna_dev *xdna = client->xdna; struct amdxdna_dev_hdl *ndev; diff --git a/src/driver/amdxdna/aie2_smu.c b/src/driver/amdxdna/aie2_smu.c index c17c672..abe9a1f 100644 --- a/src/driver/amdxdna/aie2_smu.c +++ b/src/driver/amdxdna/aie2_smu.c @@ -169,7 +169,7 @@ int aie2_smu_set_dpm_level(struct amdxdna_dev_hdl *ndev, u32 dpm_level) { int ret; - if (dpm_level < 0 || dpm_level > SMU_DPM_MAX(ndev)) + if (dpm_level > SMU_DPM_MAX(ndev)) return -EINVAL; if (!ndev->priv->smu_rev) diff --git a/src/shim/umq/hwq.cpp b/src/shim/umq/hwq.cpp index 5e03b24..5c41fa4 100644 --- a/src/shim/umq/hwq.cpp +++ b/src/shim/umq/hwq.cpp @@ -285,8 +285,7 @@ fill_indirect_exec_buf(uint64_t slot_idx, uint16_t cu_idx, volatile struct host_indirect_packet_entry *hp = reinterpret_cast(pkt->data); - for (int i = 0; dpu && dpu->chained >= 0; - i++, hp++, dpu = get_ert_dpu_data_next(dpu)) { + for (int i = 0; dpu; i++, hp++, dpu = get_ert_dpu_data_next(dpu)) { auto data_size = sizeof(struct host_indirect_data) * HSA_INDIRECT_PKT_NUM; auto prefix_off = get_pkt_idx(slot_idx) * data_size; auto prefix_idx = get_pkt_idx(slot_idx) * HSA_INDIRECT_PKT_NUM; diff --git a/test/shim_test/io_config.h b/test/shim_test/io_config.h index 915022e..1d1351d 100644 --- a/test/shim_test/io_config.h +++ b/test/shim_test/io_config.h @@ -246,7 +246,8 @@ int verify_output(int8_t* buf, const std::string &wrk_path) std::cout << "Examing output: " << dump_output_files[i] << std::endl; break; } else { - std::remove(dump_output_files[i].c_str()); + if (std::remove(dump_output_files[i].c_str())) + std::cout << "Failed to remove " << dump_output_files[i] << std::endl; } }