Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amdgpu_plugin: fix lint errors #2345

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/amdgpu/amdgpu_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ int amdgpu_plugin_handle_device_vma(int fd, const struct stat *st_buf)
/* Determine if input is a DRM device and therefore is supported */
ret = amdgpu_plugin_drm_handle_device_vma(fd, st_buf);
if (ret)
pr_perror("%s(), Can't handle VMAs of input device\n", __func__);
pr_perror("%s(), Can't handle VMAs of input device", __func__);

return ret;
}
Expand Down
3 changes: 1 addition & 2 deletions plugins/amdgpu/amdgpu_plugin_drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int amdgpu_plugin_drm_handle_device_vma(int fd, const struct stat *st)
snprintf(path, sizeof(path), AMDGPU_DRM_DEVICE, DRM_FIRST_RENDER_NODE);
ret = stat(path, &drm);
if (ret == -1) {
pr_err("Error in getting stat for: %s", path);
pr_err("Error in getting stat for: %s\n", path);
return ret;
}

Expand Down Expand Up @@ -98,4 +98,3 @@ int amdgpu_plugin_drm_dump_file(int fd, int id, struct stat *drm)
xfree(buf);
return ret;
}

16 changes: 7 additions & 9 deletions plugins/amdgpu/amdgpu_plugin_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void init_gpu_count(struct tp_system *topo)
return;

/* We add ONE to include checkpointing of KFD device */
dev_file_cnt = 1 + topology_gpu_count(topo);
dev_file_cnt = 1 + topology_gpu_count(topo);
}

int read_fp(FILE *fp, void *buf, const size_t buf_len)
Expand All @@ -74,7 +74,7 @@ int read_fp(FILE *fp, void *buf, const size_t buf_len)

len_read = fread(buf, 1, buf_len, fp);
if (len_read != buf_len) {
pr_err("Unable to read file (read:%ld buf_len:%ld)", len_read, buf_len);
pr_err("Unable to read file (read:%ld buf_len:%ld)\n", len_read, buf_len);
return -EIO;
}
return 0;
Expand All @@ -86,7 +86,7 @@ int write_fp(FILE *fp, const void *buf, const size_t buf_len)

len_write = fwrite(buf, 1, buf_len, fp);
if (len_write != buf_len) {
pr_err("Unable to write file (wrote:%ld buf_len:%ld)", len_write, buf_len);
pr_err("Unable to write file (wrote:%ld buf_len:%ld)\n", len_write, buf_len);
return -EIO;
}
return 0;
Expand Down Expand Up @@ -117,13 +117,13 @@ FILE *open_img_file(char *path, bool write, size_t *size)
fd = openat(criu_get_image_dir(), path, write ? (O_WRONLY | O_CREAT) : O_RDONLY, 0600);

if (fd < 0) {
pr_err("%s: Failed to open for %s", path, write ? "write" : "read");
pr_err("%s: Failed to open for %s\n", path, write ? "write" : "read");
return NULL;
}

fp = fdopen(fd, write ? "w" : "r");
if (!fp) {
pr_err("%s: Failed get pointer for %s", path, write ? "write" : "read");
pr_err("%s: Failed get pointer for %s\n", path, write ? "write" : "read");
return NULL;
}

Expand All @@ -133,7 +133,7 @@ FILE *open_img_file(char *path, bool write, size_t *size)
ret = read_fp(fp, size, sizeof(*size));

if (ret) {
pr_err("%s:Failed to access file size", path);
pr_err("%s:Failed to access file size\n", path);
fclose(fp);
return NULL;
}
Expand All @@ -149,7 +149,7 @@ int read_file(const char *file_path, void *buf, const size_t buf_len)

fp = fopen(file_path, "r");
if (!fp) {
pr_err("Cannot fopen %s", file_path);
pr_err("Cannot fopen %s\n", file_path);
return -errno;
}

Expand Down Expand Up @@ -204,5 +204,3 @@ void print_kfd_bo_stat(int bo_cnt, struct kfd_criu_bo_bucket *bo_list)
}
pr_info("\n");
}


Loading