Skip to content

Commit c472d71

Browse files
warthog618brgl
authored andcommitted
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 <warthog618@gmail.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
1 parent 92a59d7 commit c472d71

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/testing/selftests/gpio/gpio-mockup-cdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ int main(int argc, char *argv[])
117117
{
118118
char *chip;
119119
int opt, ret, cfd, lfd;
120-
unsigned int offset, val, abiv;
120+
unsigned int offset, val = 0, abiv;
121121
uint32_t flags_v1;
122122
uint64_t flags_v2;
123123

0 commit comments

Comments
 (0)