mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 01:51:51 +00:00
amdgpu_plugin: fix lint errors
$ make lint ... # Do not append \n to pr_perror, pr_pwarn or fail ! git --no-pager grep -E '^\s*\<(pr_perror|pr_pwarn|fail)\>.*\\n"' plugins/amdgpu/amdgpu_plugin.c: pr_perror("%s(), Can't handle VMAs of input device\n", __func__); ! git --no-pager grep -En '^\s*\<pr_(err|warn|msg|info|debug)\>.*);$' | grep -v '\\n' plugins/amdgpu/amdgpu_plugin_drm.c:45: pr_err("Error in getting stat for: %s", path); plugins/amdgpu/amdgpu_plugin_util.c:77: pr_err("Unable to read file (read:%ld buf_len:%ld)", len_read, buf_len); plugins/amdgpu/amdgpu_plugin_util.c:89: pr_err("Unable to write file (wrote:%ld buf_len:%ld)", len_write, buf_len); plugins/amdgpu/amdgpu_plugin_util.c:120: pr_err("%s: Failed to open for %s", path, write ? "write" : "read"); plugins/amdgpu/amdgpu_plugin_util.c:126: pr_err("%s: Failed get pointer for %s", path, write ? "write" : "read"); plugins/amdgpu/amdgpu_plugin_util.c:136: pr_err("%s:Failed to access file size", path); plugins/amdgpu/amdgpu_plugin_util.c:152: pr_err("Cannot fopen %s", file_path); make: *** [Makefile:470: lint] Error 1 Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
parent
bd17bd43e3
commit
a808f09bea
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
@ -98,4 +98,3 @@ int amdgpu_plugin_drm_dump_file(int fd, int id, struct stat *drm)
|
||||
xfree(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
@ -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;
|
||||
@ -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;
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -204,5 +204,3 @@ void print_kfd_bo_stat(int bo_cnt, struct kfd_criu_bo_bucket *bo_list)
|
||||
}
|
||||
pr_info("\n");
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user