OSDN Git Service

cleanup: found is always true in branch
authorDan Robertson <danlrobertson89@gmail.com>
Wed, 7 Feb 2018 13:00:09 +0000 (13:00 +0000)
committerPeter Jones <pjones@redhat.com>
Fri, 9 Feb 2018 16:08:05 +0000 (11:08 -0500)
Remove use of found in conditional, as it is always true.

src/linux.c

index b37cd62..490be37 100644 (file)
@@ -941,7 +941,7 @@ make_blockdev_path(uint8_t *buf, ssize_t size, struct disk_info *info)
                rc = sysfs_test_sata(linkbuf+loff, PATH_MAX-off);
                if (rc < 0)
                        return -1;
-               if (!found && rc > 0) {
+               else if (rc > 0) {
                        ssize_t linksz=0;
                        rc = sysfs_parse_sata(buf+off, size?size-off:0, &sz,
                                              linkbuf+loff, PATH_MAX-off,