diff options
author | Yoshinori Sato <ysato@users.sourceforge.jp> | 2019-06-02 15:46:11 +0900 |
---|---|---|
committer | Yoshinori Sato <ysato@users.sourceforge.jp> | 2019-06-02 15:46:11 +0900 |
commit | 860dbce3d8dd90cb9e909c58fa79808766243651 (patch) | |
tree | f68920c82fa779ae37bbce08a58259e5c3934ab3 /tools/pci | |
parent | 1b496469d0c020e09124e03e66a81421c21272a7 (diff) | |
parent | 3ab4436f688c2d2f221793953cd05435ca84261c (diff) | |
download | blackbird-op-linux-860dbce3d8dd90cb9e909c58fa79808766243651.tar.gz blackbird-op-linux-860dbce3d8dd90cb9e909c58fa79808766243651.zip |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
Diffstat (limited to 'tools/pci')
-rw-r--r-- | tools/pci/Makefile | 10 | ||||
-rw-r--r-- | tools/pci/pcitest.c | 8 |
2 files changed, 12 insertions, 6 deletions
diff --git a/tools/pci/Makefile b/tools/pci/Makefile index 46e4c2f318c9..6876ee4bd78c 100644 --- a/tools/pci/Makefile +++ b/tools/pci/Makefile @@ -14,9 +14,12 @@ MAKEFLAGS += -r CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include -ALL_TARGETS := pcitest pcitest.sh +ALL_TARGETS := pcitest ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS)) +SCRIPTS := pcitest.sh +ALL_SCRIPTS := $(patsubst %,$(OUTPUT)%,$(SCRIPTS)) + all: $(ALL_PROGRAMS) export srctree OUTPUT CC LD CFLAGS @@ -44,8 +47,11 @@ clean: install: $(ALL_PROGRAMS) install -d -m 755 $(DESTDIR)$(bindir); \ - for program in $(ALL_PROGRAMS); do \ + for program in $(ALL_PROGRAMS) pcitest.sh; do \ install $$program $(DESTDIR)$(bindir); \ + done; \ + for script in $(ALL_SCRIPTS); do \ + install $$script $(DESTDIR)$(bindir); \ done FORCE: diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c index ec4d51f3308b..5fa5c2bdd427 100644 --- a/tools/pci/pcitest.c +++ b/tools/pci/pcitest.c @@ -140,6 +140,7 @@ static void run_test(struct pci_test *test) } fflush(stdout); + return (ret < 0) ? ret : 1 - ret; /* return 0 if test succeeded */ } int main(int argc, char **argv) @@ -162,7 +163,7 @@ int main(int argc, char **argv) /* set default endpoint device */ test->device = "/dev/pci-endpoint-test.0"; - while ((c = getopt(argc, argv, "D:b:m:x:i:Ilrwcs:")) != EOF) + while ((c = getopt(argc, argv, "D:b:m:x:i:Ilhrwcs:")) != EOF) switch (c) { case 'D': test->device = optarg; @@ -206,7 +207,6 @@ int main(int argc, char **argv) case 's': test->size = strtoul(optarg, NULL, 0); continue; - case '?': case 'h': default: usage: @@ -224,10 +224,10 @@ usage: "\t-w Write buffer test\n" "\t-c Copy buffer test\n" "\t-s <size> Size of buffer {default: 100KB}\n", + "\t-h Print this help message\n", argv[0]); return -EINVAL; } - run_test(test); - return 0; + return run_test(test); } |