mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Huewe <peterhuewe@gmx.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Peter Huewe <peterhuewe@gmx.de>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 09/14] staging/xgifb: Replace constant arrays with constant values
Date: Thu, 14 Jun 2012 00:21:47 +0200	[thread overview]
Message-ID: <1339626112-20671-9-git-send-email-peterhuewe@gmx.de> (raw)
In-Reply-To: <1339626112-20671-1-git-send-email-peterhuewe@gmx.de>

This patch removes the arrays in XGI_GetVCLK2Ptr which each contain only
one value four times and replaces them with their constant value.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
 drivers/staging/xgifb/vb_setmode.c |   28 +++++-----------------------
 1 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
index ad1e23d..47d60c8 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -1010,24 +1010,6 @@ static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo,
 		struct xgi_hw_device_info *HwDeviceExtension,
 		struct vb_device_info *pVBInfo)
 {
-	unsigned short LCDXlat1VCLK[4] = { VCLK65_315 + 2,
-					   VCLK65_315 + 2,
-					   VCLK65_315 + 2,
-					   VCLK65_315 + 2 };
-	unsigned short LCDXlat2VCLK[4] = { VCLK108_2_315 + 5,
-					   VCLK108_2_315 + 5,
-					   VCLK108_2_315 + 5,
-					   VCLK108_2_315 + 5 };
-	unsigned short LVDSXlat1VCLK[4] = { VCLK40, VCLK40, VCLK40, VCLK40 };
-	unsigned short LVDSXlat2VCLK[4] = { VCLK65_315 + 2,
-					    VCLK65_315 + 2,
-					    VCLK65_315 + 2,
-					    VCLK65_315 + 2 };
-	unsigned short LVDSXlat3VCLK[4] = { VCLK65_315 + 2,
-					    VCLK65_315 + 2,
-					    VCLK65_315 + 2,
-					    VCLK65_315 + 2 };
-
 	unsigned short CRT2Index, VCLKIndex;
 	unsigned short modeflag, resinfo;
 
@@ -1040,9 +1022,9 @@ static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo,
 		CRT2Index = CRT2Index >> 6; /*  for LCD */
 		if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { /*301b*/
 			if (pVBInfo->LCDResInfo != Panel_1024x768)
-				VCLKIndex = LCDXlat2VCLK[CRT2Index];
+				VCLKIndex =  VCLK108_2_315 + 5; /* LCDXlat2VCLK */
 			else
-				VCLKIndex = LCDXlat1VCLK[CRT2Index];
+				VCLKIndex = VCLK65_315 + 2; /* LCDXlat1VCLK */
 		} else if (pVBInfo->VBInfo & SetCRT2ToHiVision) {
 			if (pVBInfo->SetFlag & RPLLDIV2XO) {
 				VCLKIndex = TVCLKBASE_315 + HiTVVCLKDIV2;
@@ -1093,12 +1075,12 @@ static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo,
 		VCLKIndex = VCLKIndex >> 6;
 		if ((pVBInfo->LCDResInfo == Panel_800x600) ||
 		    (pVBInfo->LCDResInfo == Panel_320x480))
-			VCLKIndex = LVDSXlat1VCLK[VCLKIndex];
+			VCLKIndex = VCLK40; /* LVDSXlat1VCLK */
 		else if ((pVBInfo->LCDResInfo == Panel_1024x768) ||
 			 (pVBInfo->LCDResInfo == Panel_1024x768x75))
-			VCLKIndex = LVDSXlat2VCLK[VCLKIndex];
+			VCLKIndex = VCLK65_315 + 2; /* LVDSXlat2VCLK */
 		else
-			VCLKIndex = LVDSXlat3VCLK[VCLKIndex];
+			VCLKIndex = VCLK65_315 + 2; /* LVDSXlat3VCLK */
 	}
 
 	return VCLKIndex;
-- 
1.7.3.4


  parent reply	other threads:[~2012-06-13 22:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-13 22:21 [PATCH 01/14] staging/xgifb: Remove assignments without effect Peter Huewe
2012-06-13 22:21 ` [PATCH 02/14] staging/xgifb: Add mutext for fb_mmap locking Peter Huewe
2012-06-13 22:21 ` [PATCH 03/14] staging/xgifb: Add header #include guards to vb_table.h Peter Huewe
2012-06-13 22:21 ` [PATCH 04/14] staging/xgifb: Remove superfluous header includes Peter Huewe
2012-06-13 22:21 ` [PATCH 05/14] staging/xgifb: Consolidate XGINew_SetDRAMSize{,20}Reg Peter Huewe
2012-06-13 22:21 ` [PATCH 06/14] staging/xgifb: Remove duplicated code from XGINew_DDRSizing340 Peter Huewe
2012-06-13 22:21 ` [PATCH 07/14] staging/xgifb: Inline XGINew_SetDRAMSizingType Peter Huewe
2012-06-13 22:21 ` [PATCH 08/14] staging/xgifb: Remove unnecessary fields of XGINew_DDRDRAM_TYPE{340,20} Peter Huewe
2012-06-13 22:21 ` Peter Huewe [this message]
2012-06-13 22:21 ` [PATCH 10/14] staging/xgifb: Simplyfy XGI_GetVCLK2Ptr a bit Peter Huewe
2012-06-13 22:21 ` [PATCH 11/14] staging/xgifb: Remove useless function XGI_CloseCRTC Peter Huewe
2012-06-13 22:21 ` [PATCH 12/14] staging/xgifb: Replace delay lookup tables with constant values Peter Huewe
2012-06-13 22:21 ` [PATCH 13/14] staging/xgifb: Use SiS structs Peter Huewe
2012-06-13 22:21 ` [PATCH 14/14] staging/xgifb: Cleanup vb_device_info struct Peter Huewe
2012-06-14  9:36   ` Dan Carpenter
     [not found]     ` <bf2c5063-2ce7-40f8-9980-04d1666eb76f@email.android.com>
2012-06-14 11:50       ` Dan Carpenter
2012-06-14 11:04   ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1339626112-20671-9-git-send-email-peterhuewe@gmx.de \
    --to=peterhuewe@gmx.de \
    --cc=aaro.koskinen@iki.fi \
    --cc=arnaud.patard@rtp-net.org \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®