diff options
author | Peter Huewe <peterhuewe@gmx.de> | 2012-05-03 18:14:55 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-05-08 12:58:27 -0400 |
commit | c1f58f1e1e5596f9377ae8839500f56677b3d0b7 (patch) | |
tree | 0c9427cbd5b58b2f44539555490ce88e8a29c131 /drivers/video/sis/sis_main.c | |
parent | 3d7e5a9b15bcf832260831176f1f7001f104d38b (diff) |
video/sis: Annotate SiS_DRAMType as __devinitconst
SiS_DRAMType is const and only used by sisfb_post_300_rwtest which is
marked __devinit we can annotate SiS_DRAMType with __devinitconst and
move it into the file scope in order to not have it created on the
stack.
This patch decreases the compiled module size by about 100bytes.
And since hardcoded values are bad we use ARRAY_SIZE for determining
the size of SiS_DRAMType ;)
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/sis/sis_main.c')
-rw-r--r-- | drivers/video/sis/sis_main.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c index 078ca2167d6f..a7a48db64ce2 100644 --- a/drivers/video/sis/sis_main.c +++ b/drivers/video/sis/sis_main.c | |||
@@ -4222,6 +4222,26 @@ sisfb_post_300_buswidth(struct sis_video_info *ivideo) | |||
4222 | return 1; /* 32bit */ | 4222 | return 1; /* 32bit */ |
4223 | } | 4223 | } |
4224 | 4224 | ||
4225 | static const unsigned short __devinitconst SiS_DRAMType[17][5] = { | ||
4226 | {0x0C,0x0A,0x02,0x40,0x39}, | ||
4227 | {0x0D,0x0A,0x01,0x40,0x48}, | ||
4228 | {0x0C,0x09,0x02,0x20,0x35}, | ||
4229 | {0x0D,0x09,0x01,0x20,0x44}, | ||
4230 | {0x0C,0x08,0x02,0x10,0x31}, | ||
4231 | {0x0D,0x08,0x01,0x10,0x40}, | ||
4232 | {0x0C,0x0A,0x01,0x20,0x34}, | ||
4233 | {0x0C,0x09,0x01,0x08,0x32}, | ||
4234 | {0x0B,0x08,0x02,0x08,0x21}, | ||
4235 | {0x0C,0x08,0x01,0x08,0x30}, | ||
4236 | {0x0A,0x08,0x02,0x04,0x11}, | ||
4237 | {0x0B,0x0A,0x01,0x10,0x28}, | ||
4238 | {0x09,0x08,0x02,0x02,0x01}, | ||
4239 | {0x0B,0x09,0x01,0x08,0x24}, | ||
4240 | {0x0B,0x08,0x01,0x04,0x20}, | ||
4241 | {0x0A,0x08,0x01,0x02,0x10}, | ||
4242 | {0x09,0x08,0x01,0x01,0x00} | ||
4243 | }; | ||
4244 | |||
4225 | static int __devinit | 4245 | static int __devinit |
4226 | sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, int buswidth, | 4246 | sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, int buswidth, |
4227 | int PseudoRankCapacity, int PseudoAdrPinCount, | 4247 | int PseudoRankCapacity, int PseudoAdrPinCount, |
@@ -4231,27 +4251,8 @@ sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, int buswidth | |||
4231 | unsigned short sr14; | 4251 | unsigned short sr14; |
4232 | unsigned int k, RankCapacity, PageCapacity, BankNumHigh, BankNumMid; | 4252 | unsigned int k, RankCapacity, PageCapacity, BankNumHigh, BankNumMid; |
4233 | unsigned int PhysicalAdrOtherPage, PhysicalAdrHigh, PhysicalAdrHalfPage; | 4253 | unsigned int PhysicalAdrOtherPage, PhysicalAdrHigh, PhysicalAdrHalfPage; |
4234 | static const unsigned short SiS_DRAMType[17][5] = { | ||
4235 | {0x0C,0x0A,0x02,0x40,0x39}, | ||
4236 | {0x0D,0x0A,0x01,0x40,0x48}, | ||
4237 | {0x0C,0x09,0x02,0x20,0x35}, | ||
4238 | {0x0D,0x09,0x01,0x20,0x44}, | ||
4239 | {0x0C,0x08,0x02,0x10,0x31}, | ||
4240 | {0x0D,0x08,0x01,0x10,0x40}, | ||
4241 | {0x0C,0x0A,0x01,0x20,0x34}, | ||
4242 | {0x0C,0x09,0x01,0x08,0x32}, | ||
4243 | {0x0B,0x08,0x02,0x08,0x21}, | ||
4244 | {0x0C,0x08,0x01,0x08,0x30}, | ||
4245 | {0x0A,0x08,0x02,0x04,0x11}, | ||
4246 | {0x0B,0x0A,0x01,0x10,0x28}, | ||
4247 | {0x09,0x08,0x02,0x02,0x01}, | ||
4248 | {0x0B,0x09,0x01,0x08,0x24}, | ||
4249 | {0x0B,0x08,0x01,0x04,0x20}, | ||
4250 | {0x0A,0x08,0x01,0x02,0x10}, | ||
4251 | {0x09,0x08,0x01,0x01,0x00} | ||
4252 | }; | ||
4253 | 4254 | ||
4254 | for(k = 0; k <= 16; k++) { | 4255 | for(k = 0; k < ARRAY_SIZE(SiS_DRAMType); k++) { |
4255 | 4256 | ||
4256 | RankCapacity = buswidth * SiS_DRAMType[k][3]; | 4257 | RankCapacity = buswidth * SiS_DRAMType[k][3]; |
4257 | 4258 | ||