From d8e7567e537e32a9309f10e59c72abfb1e6645d8 Mon Sep 17 00:00:00 2001 From: Aaro Koskinen Date: Wed, 27 Mar 2013 23:53:14 +0200 Subject: [PATCH] staging: xgifb: make SR15/SR13 arrays single dimensional Since we only access the third row, we can delete the others. Signed-off-by: Aaro Koskinen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/xgifb/vb_init.c | 16 ++++------------ drivers/staging/xgifb/vb_struct.h | 2 +- drivers/staging/xgifb/vb_table.h | 12 ++++-------- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c index 18095fbe6d98..6e2c6b40c31b 100644 --- a/drivers/staging/xgifb/vb_init.c +++ b/drivers/staging/xgifb/vb_init.c @@ -90,18 +90,14 @@ static void XGINew_DDR1x_MRS_340(unsigned long P3c4, xgifb_reg_set(P3c4, 0x16, 0x80); udelay(60); - xgifb_reg_set(P3c4, - 0x18, - pVBInfo->SR15[2][pVBInfo->ram_type]); /* SR18 */ + xgifb_reg_set(P3c4, 0x18, pVBInfo->SR15[pVBInfo->ram_type]); /* SR18 */ xgifb_reg_set(P3c4, 0x19, 0x01); xgifb_reg_set(P3c4, 0x16, 0x03); xgifb_reg_set(P3c4, 0x16, 0x83); mdelay(1); xgifb_reg_set(P3c4, 0x1B, 0x03); udelay(500); - xgifb_reg_set(P3c4, - 0x18, - pVBInfo->SR15[2][pVBInfo->ram_type]); /* SR18 */ + xgifb_reg_set(P3c4, 0x18, pVBInfo->SR15[pVBInfo->ram_type]); /* SR18 */ xgifb_reg_set(P3c4, 0x19, 0x00); xgifb_reg_set(P3c4, 0x16, 0x03); xgifb_reg_set(P3c4, 0x16, 0x83); @@ -265,18 +261,14 @@ static void XGINew_DDR1x_MRS_XG20(unsigned long P3c4, xgifb_reg_set(P3c4, 0x16, 0x00); xgifb_reg_set(P3c4, 0x16, 0x80); udelay(60); - xgifb_reg_set(P3c4, - 0x18, - pVBInfo->SR15[2][pVBInfo->ram_type]); /* SR18 */ + xgifb_reg_set(P3c4, 0x18, pVBInfo->SR15[pVBInfo->ram_type]); /* SR18 */ xgifb_reg_set(P3c4, 0x19, 0x01); xgifb_reg_set(P3c4, 0x16, 0x03); xgifb_reg_set(P3c4, 0x16, 0x83); mdelay(1); xgifb_reg_set(P3c4, 0x1B, 0x03); udelay(500); - xgifb_reg_set(P3c4, - 0x18, - pVBInfo->SR15[2][pVBInfo->ram_type]); /* SR18 */ + xgifb_reg_set(P3c4, 0x18, pVBInfo->SR15[pVBInfo->ram_type]); /* SR18 */ xgifb_reg_set(P3c4, 0x19, 0x00); xgifb_reg_set(P3c4, 0x16, 0x03); xgifb_reg_set(P3c4, 0x16, 0x83); diff --git a/drivers/staging/xgifb/vb_struct.h b/drivers/staging/xgifb/vb_struct.h index e75130038c8a..4909efa8eb2e 100644 --- a/drivers/staging/xgifb/vb_struct.h +++ b/drivers/staging/xgifb/vb_struct.h @@ -146,7 +146,7 @@ struct vb_device_info { void __iomem *FBAddr; - unsigned char const (*SR15)[3]; + unsigned char const *SR15; unsigned char const (*CR40)[3]; struct SiS_MCLKData const *MCLKData; diff --git a/drivers/staging/xgifb/vb_table.h b/drivers/staging/xgifb/vb_table.h index 38ae55455830..f8735944631b 100644 --- a/drivers/staging/xgifb/vb_table.h +++ b/drivers/staging/xgifb/vb_table.h @@ -18,16 +18,12 @@ const struct XGI_ECLKDataStruct XGI340_ECLKData[] = { {0x7C, 0x08, 0x01, 200}, }; -static const unsigned char XG27_SR13[3][3] = { - {0x35, 0x45, 0xb1}, /* SR13 */ - {0x41, 0x51, 0x5c}, /* SR14 */ - {0x32, 0x32, 0x42}, /* SR18 */ +static const unsigned char XG27_SR13[3] = { + 0x32, 0x32, 0x42 /* SR18 */ }; -static const unsigned char XGI340_SR13[3][3] = { - {0x35, 0x45, 0xb1}, /* SR13 */ - {0x41, 0x51, 0x5c}, /* SR14 */ - {0x31, 0x42, 0x42}, /* SR18 */ +static const unsigned char XGI340_SR13[3] = { + 0x31, 0x42, 0x42 /* SR18 */ }; static const unsigned char XGI340_cr41[24][3] = {