hw/omap_dss.c: Fix !-vs-~ bug in handling DISPC_CONTROL
Fix a bug revealed by a coverity scan (see bug 887883) which meant that we would never print the warning about unpredictable behaviour if a nonexistent overlay is enabled. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
		
							parent
							
								
									66e3dd9282
								
							
						
					
					
						commit
						95117be5a3
					
				@ -389,10 +389,11 @@ static void omap_disc_write(void *opaque, target_phys_addr_t addr,
 | 
				
			|||||||
        s->dig.enable = (value >> 1) & 1;
 | 
					        s->dig.enable = (value >> 1) & 1;
 | 
				
			||||||
        s->lcd.enable = (value >> 0) & 1;
 | 
					        s->lcd.enable = (value >> 0) & 1;
 | 
				
			||||||
        if (value & (1 << 12))			/* OVERLAY_OPTIMIZATION */
 | 
					        if (value & (1 << 12))			/* OVERLAY_OPTIMIZATION */
 | 
				
			||||||
            if (~((s->dispc.l[1].attr | s->dispc.l[2].attr) & 1))
 | 
					            if (!((s->dispc.l[1].attr | s->dispc.l[2].attr) & 1)) {
 | 
				
			||||||
                fprintf(stderr, "%s: Overlay Optimization when no overlay "
 | 
					                fprintf(stderr, "%s: Overlay Optimization when no overlay "
 | 
				
			||||||
                        "region effectively exists leads to "
 | 
					                        "region effectively exists leads to "
 | 
				
			||||||
                                 "unpredictable behaviour!\n", __FUNCTION__);
 | 
					                        "unpredictable behaviour!\n", __func__);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        if (value & (1 << 6)) {				/* GODIGITAL */
 | 
					        if (value & (1 << 6)) {				/* GODIGITAL */
 | 
				
			||||||
            /* XXX: Shadowed fields are:
 | 
					            /* XXX: Shadowed fields are:
 | 
				
			||||||
             * s->dispc.config
 | 
					             * s->dispc.config
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user