diff options
author | Gustavo Pimentel <gustavo.pimentel@synopsys.com> | 2018-08-23 13:34:53 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-24 08:23:03 +0100 |
commit | c0b2af64f99e6f548121aaeac172211968f5b1eb (patch) | |
tree | 2952dc67209242468a1761b932437523b960d845 /tools/pci | |
parent | 7896a8171e18b1a738d710d69490f748202270b7 (diff) | |
download | linux-stable-c0b2af64f99e6f548121aaeac172211968f5b1eb.tar.gz linux-stable-c0b2af64f99e6f548121aaeac172211968f5b1eb.tar.bz2 linux-stable-c0b2af64f99e6f548121aaeac172211968f5b1eb.zip |
tools: PCI: Fix compilation warnings
[ Upstream commit fef31ecaaf2c5c54db85b35e893bf8abec96b93f ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/pci')
-rw-r--r-- | tools/pci/pcitest.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c index 9074b477bff0..8ca1c62bc06d 100644 --- a/tools/pci/pcitest.c +++ b/tools/pci/pcitest.c @@ -23,7 +23,6 @@ #include <stdio.h> #include <stdlib.h> #include <sys/ioctl.h> -#include <time.h> #include <unistd.h> #include <linux/pcitest.h> @@ -43,17 +42,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; + return; } if (test->barnum >= 0 && test->barnum <= 5) { |