From patchwork Mon Jul 7 20:56:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 4497891 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B0CC19F26C for ; Mon, 7 Jul 2014 20:55:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D92BD201F2 for ; Mon, 7 Jul 2014 20:55:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0642F201ED for ; Mon, 7 Jul 2014 20:55:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752495AbaGGUzI (ORCPT ); Mon, 7 Jul 2014 16:55:08 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:52882 "EHLO mail-we0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752443AbaGGUzF (ORCPT ); Mon, 7 Jul 2014 16:55:05 -0400 Received: by mail-we0-f173.google.com with SMTP id t60so5052055wes.18 for ; Mon, 07 Jul 2014 13:55:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=K78rOh5qbH8kGLqvi5/tXK/EZskaKSYko63LNr8CP0A=; b=Gnb3GdCb2zWz7xoRyDm2jBBH6BOaElr+tahv3Z+5sDNDgaSCh6jBQnnM/PcU7ELFaP LopCXxjBWWwFiEAlpZI5q7W3r1WUSPmNyuE2DUrdwelKRibICkOC4wqZ1dBjdO6YzCnO o7Ne3kMkcHFPeyu9cg2mY1/OE9F2AJ0x/ZCGHL/yPt1Oxu0cfY8I5ky3vHxm/wbbzKsl tR9ZpwaYof0j5LgKmxZ702W90F51+0/++9RCGYm0Q+X+SaxNLhrzIEN9sGK+7FBUUTZM olTVc/wRUkgCa61tIe90bC7kXH1v37JVBI6766uwmsVpptByOX8DGstO6wpNzIfRKH1A wSVA== X-Gm-Message-State: ALoCoQngPGXpZngu7GxswjQ9ISr7+VwU2lebECVeVwOfWRqrbrv6S4HkdEX62G5kc8lYfT7iV36/ X-Received: by 10.180.96.170 with SMTP id dt10mr2440784wib.80.1404766503644; Mon, 07 Jul 2014 13:55:03 -0700 (PDT) Received: from localhost.localdomain (h-245-62.a218.priv.bahnhof.se. [85.24.245.62]) by mx.google.com with ESMTPSA id nc19sm64722318wic.4.2014.07.07.13.55.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Jul 2014 13:55:02 -0700 (PDT) From: Rickard Strandqvist To: Jean-Christophe Plagniol-Villard , Tomi Valkeinen Cc: Rickard Strandqvist , Jingoo Han , Daniel Vetter , Mauro Carvalho Chehab , "Chen, Gong" , Dan Carpenter , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] video: fbdev: sis: init.c: Cleaning up redundant condition is always true Date: Mon, 7 Jul 2014 22:56:19 +0200 Message-Id: <1404766579-25501-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Find a redundant condition that is always true, that after some discussions prove to be that wrong variable that was checked. Signed-off-by: Rickard Strandqvist --- drivers/video/fbdev/sis/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/sis/init.c b/drivers/video/fbdev/sis/init.c index bd40f5e..dc9613a 100644 --- a/drivers/video/fbdev/sis/init.c +++ b/drivers/video/fbdev/sis/init.c @@ -355,12 +355,12 @@ SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, } break; case 400: - if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 800) && (LCDwidth >= 600))) { + if ((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 800) && (LCDheight >= 600))) { if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth]; } break; case 512: - if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 1024) && (LCDwidth >= 768))) { + if ((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 1024) && (LCDheight >= 768))) { if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth]; } break;