Commit c1f58f1e1e5596f9377ae8839500f56677b3d0b7
Committed by
Florian Tobias Schandinat
1 parent
3d7e5a9b15
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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>
Showing 1 changed file with 21 additions and 20 deletions Side-by-side Diff
drivers/video/sis/sis_main.c
... | ... | @@ -4222,6 +4222,26 @@ |
4222 | 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 | 4245 | static int __devinit |
4226 | 4246 | sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, int buswidth, |
4227 | 4247 | int PseudoRankCapacity, int PseudoAdrPinCount, |
4228 | 4248 | |
... | ... | @@ -4231,27 +4251,8 @@ |
4231 | 4251 | unsigned short sr14; |
4232 | 4252 | unsigned int k, RankCapacity, PageCapacity, BankNumHigh, BankNumMid; |
4233 | 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 | 4257 | RankCapacity = buswidth * SiS_DRAMType[k][3]; |
4257 | 4258 |