Skip to content

Commit

Permalink
tools: PCI: Fix compilation warnings
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
gustavoSNPS authored and Lorenzo Pieralisi committed Oct 3, 2018
1 parent 7876320 commit fef31ec
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tools/pci/pcitest.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <time.h>
#include <unistd.h>

#include <linux/pcitest.h>
Expand All @@ -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;
return;
}

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

0 comments on commit fef31ec

Please sign in to comment.