diff mbox series

tools/pci: Fix compilation warnings

Message ID b2433aaac6ace7b1b9843b520242d9e9185d3685.1535024080.git.gustavo.pimentel@synopsys.com
State Accepted
Delegated to: Lorenzo Pieralisi
Headers show
Series tools/pci: Fix compilation warnings | expand

Commit Message

Gustavo Pimentel Aug. 23, 2018, 11:34 a.m. UTC
Fix compilation warnings:
 - remove unused variables
 - change function return from int to void, since it's not used

Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
---
 tools/pci/pcitest.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Kishon Vijay Abraham I Oct. 3, 2018, 8:56 a.m. UTC | #1
On Thursday 23 August 2018 05:04 PM, Gustavo Pimentel wrote:
> Fix compilation warnings:
>  - remove unused variables
>  - change function return from int to void, since it's not used
> 
> Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>

Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---
>  tools/pci/pcitest.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c
> index 9074b47..8ca1c62 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) {
>
Lorenzo Pieralisi Oct. 3, 2018, 10:41 a.m. UTC | #2
On Thu, Aug 23, 2018 at 01:34:53PM +0200, Gustavo Pimentel wrote:
> Fix compilation warnings:
>  - remove unused variables
>  - change function return from int to void, since it's not used
> 
> Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
> ---
>  tools/pci/pcitest.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

Applied to pci/tools for v4.20, however, I reformatted the subject
to make it in line with previous commits and added the warnings that
you are fixing in the commit log.

Lorenzo

> diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c
> index 9074b47..8ca1c62 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) {
> -- 
> 2.7.4
>
diff mbox series

Patch

diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c
index 9074b47..8ca1c62 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) {