Skip to contentSkip to conversation

USB: ffs-test: fix header path

PATCH Superseded Davidlohr Bueso 2 participants 2 messages Jan 27, 2011

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 USB: ffs-test: fix header path

From: Davidlohr Bueso <[email protected]>

When compiling this program the functionfs.h header cannot be found, producing:
ffs-test.c:40: fatal error: linux/usb/functionfs.h: No such file or directory

This patch also fixes the following warning:
ffs-test.c:453: warning: format ‘%4d’ expects type ‘int’, but argument 3 has type ‘size_t’

---
 tools/usb/ffs-test.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/usb/ffs-test.c +2 -2
index bbe2e3a..b5a4430 100644
@@ -37,7 +37,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <linux/usb/functionfs.h>
+#include "../../include/linux/usb/functionfs.h"
 
 
 /******************** Little Endian Handling ********************************/
@@ -450,7 +450,7 @@ invalid:
 		    len, expected, *p);
 		for (p = buf, len = 0; len < nbytes; ++p, ++len) {
 			if (0 == (len % 32))
-				fprintf(stderr, "%4d:", len);
+				fprintf(stderr, "%4ld:", len);
 			fprintf(stderr, " %02x", *p);
 			if (31 == (len % 32))
 				fprintf(stderr, "\n");
Signature · 1 line
1.7.1
#1 lore raw
Quoted 9 lines · Davidlohr Bueso

From: Davidlohr Bueso <[email protected]>

When compiling this program the functionfs.h header cannot be found, producing:
ffs-test.c:40: fatal error: linux/usb/functionfs.h: No such file or directory

This patch also fixes the following warning:
ffs-test.c:453: warning: format ‘%4d’ expects type ‘int’, but argument 3 has type ‘size_t’

tools/usb/ffs-test.c invalid: · line 453

Quoted 5 lines
tools/usb/ffs-test.c +1 -1
@@ -450,7 +450,7 @@ invalid:
 		    len, expected, *p);
 		for (p = buf, len = 0; len < nbytes; ++p, ++len) {
 			if (0 == (len % 32))
-				fprintf(stderr, "%4d:", len);
+				fprintf(stderr, "%4ld:", len);

Since len's type is size_t, shouldn't the format be %4z?

Alan Stern