From patchwork Mon Jul 7 20:23:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 4497141 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 2A61C9F26C for ; Mon, 7 Jul 2014 20:23:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5ABC5202EB for ; Mon, 7 Jul 2014 20:23:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82154202B8 for ; Mon, 7 Jul 2014 20:23:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751309AbaGGUW7 (ORCPT ); Mon, 7 Jul 2014 16:22:59 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:46743 "EHLO mail-we0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751038AbaGGUWe (ORCPT ); Mon, 7 Jul 2014 16:22:34 -0400 Received: by mail-we0-f173.google.com with SMTP id t60so4980108wes.4 for ; Mon, 07 Jul 2014 13:22:32 -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=ksf5Ed4WYKUlOAcKPIZH3mlM5KZ74oVCbuB8h8Vh+Qo=; b=YU3lpaiOTp+Z2YTxWdFRcxU+v0zb3YAj28LDSXeb/WPIUP3IwdVeamZWg4HTKQ2Ucx 6B1WFIzF3JK/hfQucHqrOwxTfizr4rXrTCVuTln2jnbWtFvxRzdcykTxQItVNG8sltiW XkbYuYNEsDbl/Kq0CRh9hOQbvEFUVufn3eioh+5TFV83IP6HHQeTzWeosIfPJkxr/yvl OStNbu2o26jvNB3+C+VLbeG/41+7WbDtnjons132YxUGSZSHd8NeM5RE19rI165PNq/O RobxM0QtH81IeL+BI3B/13YXrqdAMbzEkwCIf7JMGyAmQBEZUe9XW+yKPL5fsUGuRV9T eyXg== X-Gm-Message-State: ALoCoQnSSCMyS0TUH6kuvghJQUxiClw/zzmYHidJO14jWLXthXo/7XV28fjOUBx4dpSh7/tH6820 X-Received: by 10.180.24.66 with SMTP id s2mr76529592wif.33.1404764552196; Mon, 07 Jul 2014 13:22:32 -0700 (PDT) Received: from localhost.localdomain (h-245-62.a218.priv.bahnhof.se. [85.24.245.62]) by mx.google.com with ESMTPSA id dt7sm118873635wic.6.2014.07.07.13.22.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Jul 2014 13:22:31 -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 variable that is never used Date: Mon, 7 Jul 2014 22:23:47 +0200 Message-Id: <1404764628-25192-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=unavailable 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 Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist Reviewed-by: Dan Carpenter --- drivers/video/fbdev/sis/init.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/drivers/video/fbdev/sis/init.c b/drivers/video/fbdev/sis/init.c index bd40f5e..1948b623 100644 --- a/drivers/video/fbdev/sis/init.c +++ b/drivers/video/fbdev/sis/init.c @@ -2649,7 +2649,7 @@ static void SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RRTI) { - unsigned short data, infoflag = 0, modeflag, resindex; + unsigned short data, infoflag = 0, modeflag; #ifdef CONFIG_FB_SIS_315 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short data2, data3; @@ -2659,11 +2659,8 @@ SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo, if(SiS_Pr->UseCustomMode) { infoflag = SiS_Pr->CInfoFlag; - } else { - resindex = SiS_GetResInfo(SiS_Pr, ModeNo, ModeIdIndex); - if(ModeNo > 0x13) { - infoflag = SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag; - } + } else if (ModeNo > 0x13) { + infoflag = SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag; } /* Disable DPMS */ @@ -3539,16 +3536,15 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, struct fb_var_screeninfo *var, bool writeres ) { - unsigned short HRE, HBE, HRS, HBS, HDE, HT; - unsigned short VRE, VBE, VRS, VBS, VDE, VT; + unsigned short HRE, HBE, HRS, HDE, HT; + unsigned short VRE, VBE, VRS, VDE, VT; unsigned char sr_data, cr_data, cr_data2; - int A, B, C, D, E, F, temp; + int B, C, D, E, F, temp; sr_data = crdata[14]; /* Horizontal total */ HT = crdata[0] | ((unsigned short)(sr_data & 0x03) << 8); - A = HT + 5; /* Horizontal display enable end */ HDE = crdata[1] | ((unsigned short)(sr_data & 0x0C) << 6); @@ -3558,9 +3554,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, HRS = crdata[4] | ((unsigned short)(sr_data & 0xC0) << 2); F = HRS - E - 3; - /* Horizontal blank start */ - HBS = crdata[2] | ((unsigned short)(sr_data & 0x30) << 4); - sr_data = crdata[15]; cr_data = crdata[5]; @@ -3594,7 +3587,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, ((unsigned short)(cr_data & 0x01) << 8) | ((unsigned short)(cr_data & 0x20) << 4) | ((unsigned short)(sr_data & 0x01) << 10); - A = VT + 2; /* Vertical display enable end */ VDE = crdata[10] | @@ -3612,12 +3604,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, cr_data2 = (crdata[16] & 0x01) << 5; - /* Vertical blank start */ - VBS = crdata[11] | - ((unsigned short)(cr_data & 0x08) << 5) | - ((unsigned short)(cr_data2 & 0x20) << 4) | - ((unsigned short)(sr_data & 0x04) << 8); - /* Vertical blank end */ VBE = crdata[12] | ((unsigned short)(sr_data & 0x10) << 4); temp = VBE - ((E - 1) & 511);