From: Kent Gibson Date: Mon, 8 Nov 2021 01:28:50 +0000 (+0800) Subject: selftests: gpio: fix uninitialised variable warning X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c472d71be0be0f0ca0fbb794dce83bd76623ee2f;p=linux.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;