summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-22 14:39:22 -0400
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-22 14:39:22 -0400
commitcf7bc9aa99868c38ebb3fe032485e0513f493526 (patch)
tree0c6e54b63fae7b8743c8ee7cb82f0262637a615e
parentece0ad7e660b2285dda7d9bd52dd07d8eb2dd479 (diff)
fix misc cppcheck warnings in bus.c
-rw-r--r--bus.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/bus.c b/bus.c
index 29958b0..26963cc 100644
--- a/bus.c
+++ b/bus.c
@@ -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);