Remove duplicate ERROR strings from error logs

Now visible in 5898538
This commit is contained in:
Marc Di Luzio
2019-02-06 17:12:54 +00:00
parent 0170a72634
commit d18f3fc584
2 changed files with 9 additions and 9 deletions

View File

@ -214,7 +214,7 @@ int game_mode_apply_gpu(const GameModeGPUInfo *info, bool apply)
}; };
if (run_external_process(exec_args) != 0) { if (run_external_process(exec_args) != 0) {
LOG_ERROR("ERROR: Failed to call gpuclockctl, could not apply optimisations!\n"); LOG_ERROR("Failed to call gpuclockctl, could not apply optimisations!\n");
return -1; return -1;
} }

View File

@ -80,7 +80,7 @@ int set_gpu_state_nv(struct GameModeGPUInfo *info)
info->core); info->core);
const char *exec_args_core[] = { "/usr/bin/nvidia-settings", "-a", core_arg, NULL }; const char *exec_args_core[] = { "/usr/bin/nvidia-settings", "-a", core_arg, NULL };
if (run_external_process(exec_args_core) != 0) { if (run_external_process(exec_args_core) != 0) {
LOG_ERROR("ERROR: Failed to set %s!\n", core_arg); LOG_ERROR("Failed to set %s!\n", core_arg);
return -1; return -1;
} }
@ -94,7 +94,7 @@ int set_gpu_state_nv(struct GameModeGPUInfo *info)
info->mem); info->mem);
const char *exec_args_mem[] = { "/usr/bin/nvidia-settings", "-a", mem_arg, NULL }; const char *exec_args_mem[] = { "/usr/bin/nvidia-settings", "-a", mem_arg, NULL };
if (run_external_process(exec_args_mem) != 0) { if (run_external_process(exec_args_mem) != 0) {
LOG_ERROR("ERROR: Failed to set %s!\n", mem_arg); LOG_ERROR("Failed to set %s!\n", mem_arg);
return -1; return -1;
} }
@ -115,17 +115,17 @@ static int set_gpu_state_amd_file(const char *filename, long device, long value)
FILE *file = fopen(path, "w"); FILE *file = fopen(path, "w");
if (!file) { if (!file) {
LOG_ERROR("ERROR: Could not open %s for write (%s)!\n", path, strerror(errno)); LOG_ERROR("Could not open %s for write (%s)!\n", path, strerror(errno));
return -1; return -1;
} }
if (fprintf(file, "%ld", value) < 0) { if (fprintf(file, "%ld", value) < 0) {
LOG_ERROR("ERROR: Could not write to %s (%s)!\n", path, strerror(errno)); LOG_ERROR("Could not write to %s (%s)!\n", path, strerror(errno));
return -1; return -1;
} }
if (fclose(file) != 0) { if (fclose(file) != 0) {
LOG_ERROR("ERROR: Could not close %s after writing (%s)!\n", path, strerror(errno)); LOG_ERROR("Could not close %s after writing (%s)!\n", path, strerror(errno));
return -1; return -1;
} }
@ -155,7 +155,7 @@ static long get_vendor(const char *val)
char *end; char *end;
long ret = strtol(val, &end, 0); long ret = strtol(val, &end, 0);
if (!GPUVendorValid(ret) || end == val) { if (!GPUVendorValid(ret) || end == val) {
LOG_ERROR("ERROR: Invalid GPU Vendor passed (0x%04x)!\n", (unsigned short)ret); LOG_ERROR("Invalid GPU Vendor passed (0x%04x)!\n", (unsigned short)ret);
print_usage_and_exit(); print_usage_and_exit();
} }
return ret; return ret;
@ -167,7 +167,7 @@ static long get_device(const char *val)
char *end; char *end;
long ret = strtol(val, &end, 10); long ret = strtol(val, &end, 10);
if (ret < 0 || end == val) { if (ret < 0 || end == val) {
LOG_ERROR("ERROR: Invalid GPU device passed (%ld)!\n", ret); LOG_ERROR("Invalid GPU device passed (%ld)!\n", ret);
print_usage_and_exit(); print_usage_and_exit();
} }
return ret; return ret;
@ -179,7 +179,7 @@ static long get_generic_value(const char *val)
char *end; char *end;
long ret = strtol(val, &end, 10); long ret = strtol(val, &end, 10);
if (ret < 0 || end == val) { if (ret < 0 || end == val) {
LOG_ERROR("ERROR: Invalid value passed (%ld)!\n", ret); LOG_ERROR("Invalid value passed (%ld)!\n", ret);
print_usage_and_exit(); print_usage_and_exit();
} }
return ret; return ret;