Re: [PATCH 4.19 217/220] tools: PCI: Fix broken pcitest compilation

Pavel Machek
2019-11-23T21:55:47Z

[-- Attachment #1: Type: text/plain, Size: 1295 bytes --]

Hi!

> From: Alan Mikhak <alan.mikhak@sifive.com>
>
> [ Upstream commit 8a5e0af240e07dd3d4897eb8ff52aab757da7fab ]
>
> pcitest is currently broken due to the following compiler error
> and related warning. Fix by changing the run_test() function
> signature to return an integer result.
>
> pcitest.c: In function run_test:
> pcitest.c:143:9: warning: return with a value, in function
> returning void
> return (ret < 0) ? ret : 1 - ret; /* return 0 if test succeeded */

There is no such line in 4.19 version.

> +++ b/tools/pci/pcitest.c
> @@ -47,15 +47,15 @@ struct pci_test {
> unsigned long size;
> };
>
> -static void run_test(struct pci_test *test)
> +static int run_test(struct pci_test *test)
> {
> - long ret;
> + int ret = -EINVAL;
> int fd;

...
fflush(stdout);
}

No, sorry, this will bring back warning fef31ecaaf2c was supposed to
fix.

My recommendation would be to drop this and fef31ecaaf2c from the
stable. It is warning, not a "serious bug" after all.

Alternatively, it needs to return something at the end of function,
after the fflush().

Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]