xfree86: numTimings is never value other than 0
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>
This commit is contained in:
		
							parent
							
								
									1d80db55dd
								
							
						
					
					
						commit
						cd0d4c1bb5
					
				| 
						 | 
					@ -1352,8 +1352,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
 | 
				
			||||||
    int saveType;
 | 
					    int saveType;
 | 
				
			||||||
    PixmapFormatRec *BankFormat;
 | 
					    PixmapFormatRec *BankFormat;
 | 
				
			||||||
    ClockRangePtr cp;
 | 
					    ClockRangePtr cp;
 | 
				
			||||||
    int numTimings = 0;
 | 
					    const int numTimings = 0;
 | 
				
			||||||
    range hsync[MAX_HSYNC];
 | 
					 | 
				
			||||||
    range vrefresh[MAX_VREFRESH];
 | 
					    range vrefresh[MAX_VREFRESH];
 | 
				
			||||||
    Bool inferred_virtual = FALSE;
 | 
					    Bool inferred_virtual = FALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1394,18 +1393,9 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
 | 
				
			||||||
        Bool specified = FALSE;
 | 
					        Bool specified = FALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (scrp->monitor->nHsync <= 0) {
 | 
					        if (scrp->monitor->nHsync <= 0) {
 | 
				
			||||||
            if (numTimings > 0) {
 | 
					            scrp->monitor->hsync[0].lo = 31.5;
 | 
				
			||||||
                scrp->monitor->nHsync = numTimings;
 | 
					            scrp->monitor->hsync[0].hi = 48.0;
 | 
				
			||||||
                for (i = 0; i < numTimings; i++) {
 | 
					            scrp->monitor->nHsync = 1;
 | 
				
			||||||
                    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;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            type = "default ";
 | 
					            type = "default ";
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue