Commit fef31eca authored by Gustavo Pimentel's avatar Gustavo Pimentel Committed by Lorenzo Pieralisi

tools: PCI: Fix compilation warnings

Current compilation produces the following warnings:

tools/pci/pcitest.c: In function 'run_test':
tools/pci/pcitest.c:56:9: warning: unused variable 'time'
  double time;
tools/pci/pcitest.c:55:25: warning: unused variable 'end'
  struct timespec start, end;
tools/pci/pcitest.c:55:18: warning: unused variable 'start'
  struct timespec start, end;
tools/pci/pcitest.c:146:1: warning: control reaches end of non-void
function [-Wreturn-type]

Fix them:
 - remove unused variables
 - change function return from int to void, since it's not used
Signed-off-by: default avatarGustavo Pimentel <>
[ rewrote the commit log]
Signed-off-by: default avatarLorenzo Pieralisi <>
Reviewed-by: default avatarKishon Vijay Abraham I <>
parent 7876320f
......@@ -23,7 +23,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <time.h>
#include <unistd.h>
#include <linux/pcitest.h>
......@@ -48,17 +47,15 @@ struct pci_test {
unsigned long size;
static int run_test(struct pci_test *test)
static void run_test(struct pci_test *test)
long ret;
int fd;
struct timespec start, end;
double time;
fd = open(test->device, O_RDWR);
if (fd < 0) {
perror("can't open PCI Endpoint Test device");
return fd;
if (test->barnum >= 0 && test->barnum <= 5) {
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment