From: Kent Gibson Date: Mon, 8 Nov 2021 01:28:50 +0000 (+0800) Subject: selftests: gpio: fix uninitialised variable warning X-Git-Tag: baikal/mips/sdk6.1~7010^2~2 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=d451aba9ac70cfd26ec0a354a4764e81f92bc28d;p=kernel.git selftests: gpio: fix uninitialised variable warning When compiled with -Wall gpio-mockup-cdev.c reports an uninitialised variable warning. This is a false positive, as the variable is ignored in the case it is uninitialised, but initialise the variable anyway to remove the warning. Signed-off-by: Kent Gibson Signed-off-by: Bartosz Golaszewski --- diff --git a/tools/testing/selftests/gpio/gpio-mockup-cdev.c b/tools/testing/selftests/gpio/gpio-mockup-cdev.c index e83eac71621a0..d1640f44f8ac2 100644 --- a/tools/testing/selftests/gpio/gpio-mockup-cdev.c +++ b/tools/testing/selftests/gpio/gpio-mockup-cdev.c @@ -117,7 +117,7 @@ int main(int argc, char *argv[]) { char *chip; int opt, ret, cfd, lfd; - unsigned int offset, val, abiv; + unsigned int offset, val = 0, abiv; uint32_t flags_v1; uint64_t flags_v2;