From 09eb7d31e8fa2988ee73f72f5234c8a82fabff2c Mon Sep 17 00:00:00 2001 From: nirenjan Date: Thu, 11 Jun 2020 23:11:25 -0700 Subject: [PATCH] x52test: Clean up compiler warnings --- utils/test/x52_test.c | 6 +++--- utils/test/x52_test_led.c | 17 +++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/utils/test/x52_test.c b/utils/test/x52_test.c index 9207bd9..1a8507a 100644 --- a/utils/test/x52_test.c +++ b/utils/test/x52_test.c @@ -162,7 +162,7 @@ static int run_tests(int test_set) return 0; } -void underline(const char *msg) { +static void underline(const char *msg) { size_t i; puts(msg); for (i = 0; i < strlen(msg); i++) { @@ -171,7 +171,7 @@ void underline(const char *msg) { putchar('\n'); } -void usage(void) +static void usage(void) { puts(_("These are the available tests with a description and\n" "approximate runtime. Not specifying any tests will run\n" @@ -187,7 +187,7 @@ void usage(void) } struct test_map { - char *cmd; + const char *cmd; int test_bitmap; }; const struct test_map tests[] = { diff --git a/utils/test/x52_test_led.c b/utils/test/x52_test_led.c index ed197f7..9bd28af 100644 --- a/utils/test/x52_test_led.c +++ b/utils/test/x52_test_led.c @@ -39,16 +39,17 @@ int test_leds(void) { - int rc; print_banner(_("LEDs")); - /* Check if the connected device supports individual LED control */ - rc = libx52_check_feature(dev, LIBX52_FEATURE_LED); - if (rc == LIBX52_ERROR_NOT_SUPPORTED) { - puts(_("Skipping LED tests since the device does not support LED control")); - return 0; - } else if (rc != LIBX52_SUCCESS) { - return rc; + { /* Check if the connected device supports individual LED control */ + int rc; + rc = libx52_check_feature(dev, LIBX52_FEATURE_LED); + if (rc == LIBX52_ERROR_NOT_SUPPORTED) { + puts(_("Skipping LED tests since the device does not support LED control")); + return 0; + } else if (rc != LIBX52_SUCCESS) { + return rc; + } } puts(_("This cycles the LEDs through all possible states"));