[2/9] xfree86: numTimings is never value other than 0

Submitted by Konstantin Kharlamov on March 23, 2019, 11:51 p.m.

Details

Message ID 20190323235203.30143-3-Hi-Angel@yandex.ru
State New
Headers show
Series "Fix some of LGTM warnings" ( rev: 2 1 ) in X.org

Not browsing as part of any series.

Commit Message

Konstantin Kharlamov March 23, 2019, 11:51 p.m.
Correctness is ensured be checking md5sum result before and after the
commit (it's the same).

Fixes LGTM warning "Comparison is always false because numTimings <= 0."

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
---
 hw/xfree86/common/xf86Mode.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

Patch hide | download patch | download mbox

diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index 484cde7ab..252df8c65 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -1352,8 +1352,7 @@  xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
     int saveType;
     PixmapFormatRec *BankFormat;
     ClockRangePtr cp;
-    int numTimings = 0;
-    range hsync[MAX_HSYNC];
+    const int numTimings = 0;
     range vrefresh[MAX_VREFRESH];
     Bool inferred_virtual = FALSE;
 
@@ -1394,18 +1393,9 @@  xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
         Bool specified = FALSE;
 
         if (scrp->monitor->nHsync <= 0) {
-            if (numTimings > 0) {
-                scrp->monitor->nHsync = numTimings;
-                for (i = 0; i < numTimings; i++) {
-                    scrp->monitor->hsync[i].lo = hsync[i].lo;
-                    scrp->monitor->hsync[i].hi = hsync[i].hi;
-                }
-            }
-            else {
-                scrp->monitor->hsync[0].lo = 31.5;
-                scrp->monitor->hsync[0].hi = 48.0;
-                scrp->monitor->nHsync = 1;
-            }
+            scrp->monitor->hsync[0].lo = 31.5;
+            scrp->monitor->hsync[0].hi = 48.0;
+            scrp->monitor->nHsync = 1;
             type = "default ";
         }
         else {