lkml.org 
[lkml]   [2019]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 4.19 217/220] tools: PCI: Fix broken pcitest compilation
    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
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2019-11-23 22:56    [W:4.157 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site