]> mj.ucw.cz Git - pciutils.git/commitdiff
lspci: Remove unnecessary !verbose check in show_range()
authorKelsey Skunberg <skunberg.kelsey@gmail.com>
Wed, 19 Jun 2019 16:48:57 +0000 (10:48 -0600)
committerMartin Mares <mj@ucw.cz>
Tue, 21 Jan 2020 20:49:11 +0000 (21:49 +0100)
Remove 'if (!verbose)' code in show_range() due to not being called.
show_range() will only be called when verbose is true. Additional call
to check for verbosity within show_range() is dead code.

!verbose was used so nothing would print if the range behind a bridge
had a base > limit and verbose == false. Since show_range() will not be
called when verbose == false, not printing bridge information is
still accomplished.

Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com>
lspci.c

diff --git a/lspci.c b/lspci.c
index 937c6e4067439e8f53036ce0e2418d44c1b4ba62..7418b072c0c23783e5763a4b8091b9cc24d6f793 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -376,17 +376,11 @@ show_size(u64 x)
 static void
 show_range(char *prefix, u64 base, u64 limit, int is_64bit)
 {
-  if (base > limit)
+  if (base > limit && verbose < 3)
     {
-      if (!verbose)
-       return;
-      else if (verbose < 3)
-       {
-         printf("%s: None\n", prefix);
-         return;
-       }
+      printf("%s: None\n", prefix);
+      return;
     }
-
   printf("%s: ", prefix);
   if (is_64bit)
     printf("%016" PCI_U64_FMT_X "-%016" PCI_U64_FMT_X, base, limit);