diff options
author | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-22 14:39:22 -0400 |
---|---|---|
committer | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-22 14:39:22 -0400 |
commit | cf7bc9aa99868c38ebb3fe032485e0513f493526 (patch) | |
tree | 0c6e54b63fae7b8743c8ee7cb82f0262637a615e /bus.c | |
parent | ece0ad7e660b2285dda7d9bd52dd07d8eb2dd479 (diff) |
fix misc cppcheck warnings in bus.c
Diffstat (limited to 'bus.c')
-rw-r--r-- | bus.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -60,7 +60,6 @@ static int devmemfd = -1; static bool util_isbeaglebone() { - bool ret = false; int fd = open("/sys/kernel/debug/omap_mux/board/core", O_RDONLY); close(fd); return fd > -1; @@ -272,10 +271,10 @@ static void gpio_getvaluenodepath(unsigned base, unsigned io, char* buffer) static int gpio_readvalue(unsigned base, unsigned io) { char path[PATHLEN]; - char value[2]; // value will be a single char and \n gpio_getvaluenodepath(base, io, path); FILE* valuefile = fopen(path, "r"); if (valuefile != NULL) { + char value[2]; // value will be a single char and \n fread(value, 1, 2, valuefile); fclose(valuefile); return atoi(value); |