summaryrefslogtreecommitdiff
path: root/bus.c
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-11-09 11:41:11 -0500
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-11-09 11:41:11 -0500
commit16d6dea985b85ff596e98d4dc7f15f341ad6966b (patch)
tree445a695bc6c58849b0600af16bdd44ffe79f932e /bus.c
parent65c7900768799338b143a024c64b32661a38200e (diff)
cppcheck fixes
Diffstat (limited to 'bus.c')
-rw-r--r--bus.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bus.c b/bus.c
index 3f0dbc6..e733cdf 100644
--- a/bus.c
+++ b/bus.c
@@ -259,7 +259,7 @@ static int gpio_export(unsigned gpio_pin)
{
FILE* exportfile = fopen(GPIO_SYSFSPATH"/"GPIO_EXPORTNODE, "w");
if (exportfile != NULL) {
- fprintf(exportfile, "%d\n", gpio_pin);
+ fprintf(exportfile, "%u\n", gpio_pin);
fclose(exportfile);
return 0;
}
@@ -274,7 +274,7 @@ static int gpio_unexport(unsigned gpio_pin)
{
FILE* unexportfile = fopen(GPIO_SYSFSPATH"/"GPIO_UNEXPORTNODE, "w");
if (unexportfile != NULL) {
- fprintf(unexportfile, "%d\n", gpio_pin);
+ fprintf(unexportfile, "%u\n", gpio_pin);
fclose(unexportfile);
return 0;
}
@@ -288,7 +288,7 @@ static int gpio_unexport(unsigned gpio_pin)
static int gpio_changedirection(unsigned gpio_pin, bool out)
{
char path[PATHLEN];
- snprintf(path, PATHLEN, GPIO_SYSFSPATH"/gpio%d/"GPIO_DIRECTIONNODE, gpio_pin);
+ snprintf(path, PATHLEN, GPIO_SYSFSPATH"/gpio%u/"GPIO_DIRECTIONNODE, gpio_pin);
FILE* directionfile = fopen(path, "w");
if (directionfile != NULL) {
if (out) {
@@ -305,7 +305,7 @@ static int gpio_changedirection(unsigned gpio_pin, bool out)
static void gpio_getvaluenodepath(unsigned gpio_pin, char* buffer)
{
- snprintf(buffer, PATHLEN, GPIO_SYSFSPATH"/gpio%d/"GPIO_VALUENODE, gpio_pin);
+ snprintf(buffer, PATHLEN, GPIO_SYSFSPATH"/gpio%u/"GPIO_VALUENODE, gpio_pin);
}
/*