summaryrefslogtreecommitdiffstats
path: root/tools/pci/pcitest.c
diff options
context:
space:
mode:
authorGustavo Pimentel <gustavo.pimentel@synopsys.com>2018-08-23 07:34:53 -0400
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2018-10-03 06:18:12 -0400
commitfef31ecaaf2c5c54db85b35e893bf8abec96b93f (patch)
tree1bb418de7b4c9deadab0403c980d40e629d008a1 /tools/pci/pcitest.c
parent7876320f88802b22d4e2daf7eb027dd14175a0f8 (diff)
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' [-Wunused-variable] double time; ^~~~ tools/pci/pcitest.c:55:25: warning: unused variable 'end' [-Wunused-variable] struct timespec start, end; ^~~ tools/pci/pcitest.c:55:18: warning: unused variable 'start' [-Wunused-variable] 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: Gustavo Pimentel <gustavo.pimentel@synopsys.com> [lorenzo.pieralisi@arm.com: rewrote the commit log] Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'tools/pci/pcitest.c')
-rw-r--r--tools/pci/pcitest.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c
index af146bb03b4d..ec4d51f3308b 100644
--- a/tools/pci/pcitest.c
+++ b/tools/pci/pcitest.c
@@ -23,7 +23,6 @@
23#include <stdio.h> 23#include <stdio.h>
24#include <stdlib.h> 24#include <stdlib.h>
25#include <sys/ioctl.h> 25#include <sys/ioctl.h>
26#include <time.h>
27#include <unistd.h> 26#include <unistd.h>
28 27
29#include <linux/pcitest.h> 28#include <linux/pcitest.h>
@@ -48,17 +47,15 @@ struct pci_test {
48 unsigned long size; 47 unsigned long size;
49}; 48};
50 49
51static int run_test(struct pci_test *test) 50static void run_test(struct pci_test *test)
52{ 51{
53 long ret; 52 long ret;
54 int fd; 53 int fd;
55 struct timespec start, end;
56 double time;
57 54
58 fd = open(test->device, O_RDWR); 55 fd = open(test->device, O_RDWR);
59 if (fd < 0) { 56 if (fd < 0) {
60 perror("can't open PCI Endpoint Test device"); 57 perror("can't open PCI Endpoint Test device");
61 return fd; 58 return;
62 } 59 }
63 60
64 if (test->barnum >= 0 && test->barnum <= 5) { 61 if (test->barnum >= 0 && test->barnum <= 5) {