aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/Build2
-rw-r--r--tools/perf/util/perf_regs.c2
-rw-r--r--tools/perf/util/perf_regs.h1
-rw-r--r--tools/usb/testusb.c10
-rw-r--r--tools/usb/usbip/src/usbip_detach.c4
5 files changed, 12 insertions, 7 deletions
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index 349bc96ca1fe..e5f18a288b74 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -17,6 +17,7 @@ libperf-y += levenshtein.o
17libperf-y += llvm-utils.o 17libperf-y += llvm-utils.o
18libperf-y += parse-options.o 18libperf-y += parse-options.o
19libperf-y += parse-events.o 19libperf-y += parse-events.o
20libperf-y += perf_regs.o
20libperf-y += path.o 21libperf-y += path.o
21libperf-y += rbtree.o 22libperf-y += rbtree.o
22libperf-y += bitmap.o 23libperf-y += bitmap.o
@@ -103,7 +104,6 @@ libperf-$(CONFIG_LIBBABELTRACE) += data-convert-bt.o
103 104
104libperf-y += scripting-engines/ 105libperf-y += scripting-engines/
105 106
106libperf-$(CONFIG_PERF_REGS) += perf_regs.o
107libperf-$(CONFIG_ZLIB) += zlib.o 107libperf-$(CONFIG_ZLIB) += zlib.o
108libperf-$(CONFIG_LZMA) += lzma.o 108libperf-$(CONFIG_LZMA) += lzma.o
109 109
diff --git a/tools/perf/util/perf_regs.c b/tools/perf/util/perf_regs.c
index 885e8ac83997..6b8eb13e14e4 100644
--- a/tools/perf/util/perf_regs.c
+++ b/tools/perf/util/perf_regs.c
@@ -6,6 +6,7 @@ const struct sample_reg __weak sample_reg_masks[] = {
6 SMPL_REG_END 6 SMPL_REG_END
7}; 7};
8 8
9#ifdef HAVE_PERF_REGS_SUPPORT
9int perf_reg_value(u64 *valp, struct regs_dump *regs, int id) 10int perf_reg_value(u64 *valp, struct regs_dump *regs, int id)
10{ 11{
11 int i, idx = 0; 12 int i, idx = 0;
@@ -29,3 +30,4 @@ out:
29 *valp = regs->cache_regs[id]; 30 *valp = regs->cache_regs[id];
30 return 0; 31 return 0;
31} 32}
33#endif
diff --git a/tools/perf/util/perf_regs.h b/tools/perf/util/perf_regs.h
index 2984dcc54d67..679d6e493962 100644
--- a/tools/perf/util/perf_regs.h
+++ b/tools/perf/util/perf_regs.h
@@ -2,6 +2,7 @@
2#define __PERF_REGS_H 2#define __PERF_REGS_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/compiler.h>
5 6
6struct regs_dump; 7struct regs_dump;
7 8
diff --git a/tools/usb/testusb.c b/tools/usb/testusb.c
index 879f9870a6bc..0692d99b6d8f 100644
--- a/tools/usb/testusb.c
+++ b/tools/usb/testusb.c
@@ -394,7 +394,7 @@ int main (int argc, char **argv)
394 * low speed, interrupt 8 * 1 = 8 394 * low speed, interrupt 8 * 1 = 8
395 */ 395 */
396 param.iterations = 1000; 396 param.iterations = 1000;
397 param.length = 512; 397 param.length = 1024;
398 param.vary = 512; 398 param.vary = 512;
399 param.sglen = 32; 399 param.sglen = 32;
400 400
@@ -454,10 +454,10 @@ usage:
454 "\t-t testnum only run specified case\n" 454 "\t-t testnum only run specified case\n"
455 "\t-n no test running, show devices to be tested\n" 455 "\t-n no test running, show devices to be tested\n"
456 "Case arguments:\n" 456 "Case arguments:\n"
457 "\t-c iterations default 1000\n" 457 "\t-c iterations default 1000\n"
458 "\t-s packetsize default 512\n" 458 "\t-s transfer length default 1024\n"
459 "\t-g sglen default 32\n" 459 "\t-g sglen default 32\n"
460 "\t-v vary default 512\n", 460 "\t-v vary default 512\n",
461 argv[0]); 461 argv[0]);
462 return 1; 462 return 1;
463 } 463 }
diff --git a/tools/usb/usbip/src/usbip_detach.c b/tools/usb/usbip/src/usbip_detach.c
index 05c6d15856eb..9db9d21bb2ec 100644
--- a/tools/usb/usbip/src/usbip_detach.c
+++ b/tools/usb/usbip/src/usbip_detach.c
@@ -47,7 +47,9 @@ static int detach_port(char *port)
47 uint8_t portnum; 47 uint8_t portnum;
48 char path[PATH_MAX+1]; 48 char path[PATH_MAX+1];
49 49
50 for (unsigned int i = 0; i < strlen(port); i++) 50 unsigned int port_len = strlen(port);
51
52 for (unsigned int i = 0; i < port_len; i++)
51 if (!isdigit(port[i])) { 53 if (!isdigit(port[i])) {
52 err("invalid port %s", port); 54 err("invalid port %s", port);
53 return -1; 55 return -1;