From ff1a838ab75635bcb027de72d4bf9c976a23d4ff Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sun, 3 Feb 2019 18:37:17 +0000 Subject: [PATCH] Apply format corrections --- daemon/daemon_config.c | 1 - daemon/gamemode-gpu.c | 8 +++++--- daemon/gpuclockctl.c | 9 +++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/daemon/daemon_config.c b/daemon/daemon_config.c index feedde7..69d0b0a 100644 --- a/daemon/daemon_config.c +++ b/daemon/daemon_config.c @@ -547,7 +547,6 @@ void config_get_nv_core_clock_mhz_offset(GameModeConfig *self, long *value) void config_get_nv_mem_clock_mhz_offset(GameModeConfig *self, long *value) { memcpy_locked_config(self, value, &self->nv_mem_clock_mhz_offset, sizeof(long)); - } void config_get_nv_perf_level(GameModeConfig *self, long *value) { diff --git a/daemon/gamemode-gpu.c b/daemon/gamemode-gpu.c index c3b6a7d..7bc1b80 100644 --- a/daemon/gamemode-gpu.c +++ b/daemon/gamemode-gpu.c @@ -124,9 +124,11 @@ int game_mode_initialise_gpu(GameModeConfig *config, GameModeGPUInfo **info) /* Sanity check the performance level value as well */ config_get_nv_perf_level(config, &new_info->nv_perf_level); - if(new_info->nv_perf_level < 0 || new_info->nv_perf_level > 16) - { - LOG_ERROR( "ERROR: NVIDIA Performance level value invalid (%ld), will not apply optimisations!\n", new_info->nv_perf_level ); + if (new_info->nv_perf_level < 0 || new_info->nv_perf_level > 16) { + LOG_ERROR( + "ERROR: NVIDIA Performance level value invalid (%ld), will not apply " + "optimisations!\n", + new_info->nv_perf_level); free(new_info); return -1; } diff --git a/daemon/gpuclockctl.c b/daemon/gpuclockctl.c index 026bd1b..a892198 100644 --- a/daemon/gpuclockctl.c +++ b/daemon/gpuclockctl.c @@ -36,7 +36,8 @@ POSSIBILITY OF SUCH DAMAGE. #include "gpu-control.h" /* Helper to quit with usage */ -static const char *usage_text = "usage: gpuclockctl PCI_ID DEVICE [get] [set CORE MEM [PERF_LEVEL]]]"; +static const char *usage_text = + "usage: gpuclockctl PCI_ID DEVICE [get] [set CORE MEM [PERF_LEVEL]]]"; static void print_usage_and_exit(void) { fprintf(stderr, "%s\n", usage_text); @@ -95,7 +96,7 @@ int main(int argc, char *argv[]) get_gpu_state(&info); printf("%ld %ld\n", info.core, info.mem); - } else if (argc >=6 && argc <=7 && strncmp(argv[3], "set", 3) == 0) { + } else if (argc >= 6 && argc <= 7 && strncmp(argv[3], "set", 3) == 0) { /* Must be root to set the state */ if (geteuid() != 0) { fprintf(stderr, "gpuclockctl must be run as root to set values\n"); @@ -110,7 +111,7 @@ int main(int argc, char *argv[]) info.core = get_generic_value(argv[4]); info.mem = get_generic_value(argv[5]); - if( info.vendor == Vendor_NVIDIA ) + if (info.vendor == Vendor_NVIDIA) info.nv_perf_level = get_generic_value(argv[6]); printf("gpuclockctl setting core:%ld mem:%ld on device:%ld with vendor 0x%04x\n", @@ -119,7 +120,7 @@ int main(int argc, char *argv[]) info.device, (unsigned short)info.vendor); - if( info.vendor == Vendor_NVIDIA ) + if (info.vendor == Vendor_NVIDIA) printf("on Performance Level %ld\n", info.nv_perf_level); return set_gpu_state(&info);