Skip to content

Commit fef31ec

Browse files
gustavoSNPSLorenzo Pieralisi
authored andcommitted
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>
1 parent 7876320 commit fef31ec

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tools/pci/pcitest.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <stdio.h>
2424
#include <stdlib.h>
2525
#include <sys/ioctl.h>
26-
#include <time.h>
2726
#include <unistd.h>
2827

2928
#include <linux/pcitest.h>
@@ -48,17 +47,15 @@ struct pci_test {
4847
unsigned long size;
4948
};
5049

51-
static int run_test(struct pci_test *test)
50+
static void run_test(struct pci_test *test)
5251
{
5352
long ret;
5453
int fd;
55-
struct timespec start, end;
56-
double time;
5754

5855
fd = open(test->device, O_RDWR);
5956
if (fd < 0) {
6057
perror("can't open PCI Endpoint Test device");
61-
return fd;
58+
return;
6259
}
6360

6461
if (test->barnum >= 0 && test->barnum <= 5) {

0 commit comments

Comments
 (0)