Skip to content

Commit

Permalink
Merge branch 'remotes/lorenzo/pci/misc'
Browse files Browse the repository at this point in the history
  - Fix pcitest build issues (Alan Mikhak)

  - Fix pcitest installation issue (Andy Shevchenko)

* remotes/lorenzo/pci/misc:
  tools: PCI: Fix installation when `make tools/pci_install`
  tools: PCI: Fix compiler warning in pcitest
  tools: PCI: Fix broken pcitest compilation
  • Loading branch information
Bjorn Helgaas committed Jul 12, 2019
2 parents 950cfbf + af33663 commit 31d5a60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions tools/pci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ ALL_TARGETS := pcitest
ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))

SCRIPTS := pcitest.sh
ALL_SCRIPTS := $(patsubst %,$(OUTPUT)%,$(SCRIPTS))

all: $(ALL_PROGRAMS)

Expand Down Expand Up @@ -47,10 +46,10 @@ clean:

install: $(ALL_PROGRAMS)
install -d -m 755 $(DESTDIR)$(bindir); \
for program in $(ALL_PROGRAMS) pcitest.sh; do \
for program in $(ALL_PROGRAMS); do \
install $$program $(DESTDIR)$(bindir); \
done; \
for script in $(ALL_SCRIPTS); do \
for script in $(SCRIPTS); do \
install $$script $(DESTDIR)$(bindir); \
done

Expand Down
8 changes: 4 additions & 4 deletions tools/pci/pcitest.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ struct pci_test {
unsigned long size;
};

static void run_test(struct pci_test *test)
static int run_test(struct pci_test *test)
{
long ret;
int ret = -EINVAL;
int fd;

fd = open(test->device, O_RDWR);
if (fd < 0) {
perror("can't open PCI Endpoint Test device");
return;
return -ENODEV;
}

if (test->barnum >= 0 && test->barnum <= 5) {
Expand Down Expand Up @@ -223,7 +223,7 @@ int main(int argc, char **argv)
"\t-r Read buffer test\n"
"\t-w Write buffer test\n"
"\t-c Copy buffer test\n"
"\t-s <size> Size of buffer {default: 100KB}\n",
"\t-s <size> Size of buffer {default: 100KB}\n"
"\t-h Print this help message\n",
argv[0]);
return -EINVAL;
Expand Down

0 comments on commit 31d5a60

Please sign in to comment.