From: Jan Kiszka <jan.kis...@siemens.com>

tools/ebgpart.c:380:11: style: Condition 'devfile' is always true 
[knownConditionTrueFalse]
 } while (devfile);
          ^

While resolving this, also reduce the scope of devfile (would be the
next warning).

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>
---
 tools/ebgpart.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/ebgpart.c b/tools/ebgpart.c
index fba7fb2..b6384f2 100644
--- a/tools/ebgpart.c
+++ b/tools/ebgpart.c
@@ -358,9 +358,8 @@ static int scan_devdir(unsigned int fmajor, unsigned int 
fminor, char *fullname,
                VERBOSE(stderr, "Failed to open %s\n", DEVDIR);
                return result;
        }
-       struct dirent *devfile;
-       do {
-               devfile = readdir(devdir);
+       while (true) {
+               struct dirent *devfile = readdir(devdir);
                if (!devfile) {
                        break;
                }
@@ -377,7 +376,7 @@ static int scan_devdir(unsigned int fmajor, unsigned int 
fminor, char *fullname,
                        result = 0;
                        break;
                }
-       } while (devfile);
+       }
        closedir(devdir);
 
        return result;
-- 
2.35.3

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to efibootguard-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/eaf64edbfa2d29bc8b109a03e46e42e24ad37006.1697736989.git.jan.kiszka%40siemens.com.

Reply via email to