提交 85a56498 编写于 作者: J Jon Mason 提交者: David S. Miller

s2io: Using static const generally increases object text and decreases data...

s2io: Using static const generally increases object text and decreases data size. It also generally decreases overall object size.

text	   data	    bss	    dec	    hex	filename
 109387	    389	  24432	 134208	  20c40	drivers/net/s2io.o.old
 109358	    389	  24432	 134179	  20c23	drivers/net/s2io.o.new
Signed-off-by: NJoe Perches <joe@perches.com>
Acked-by: NJon Mason <jon.mason@exar.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 11410b62
...@@ -3598,10 +3598,12 @@ static int s2io_set_swapper(struct s2io_nic *sp) ...@@ -3598,10 +3598,12 @@ static int s2io_set_swapper(struct s2io_nic *sp)
val64 = readq(&bar0->pif_rd_swapper_fb); val64 = readq(&bar0->pif_rd_swapper_fb);
if (val64 != 0x0123456789ABCDEFULL) { if (val64 != 0x0123456789ABCDEFULL) {
int i = 0; int i = 0;
u64 value[] = { 0xC30000C3C30000C3ULL, /* FE=1, SE=1 */ static const u64 value[] = {
0xC30000C3C30000C3ULL, /* FE=1, SE=1 */
0x8100008181000081ULL, /* FE=1, SE=0 */ 0x8100008181000081ULL, /* FE=1, SE=0 */
0x4200004242000042ULL, /* FE=0, SE=1 */ 0x4200004242000042ULL, /* FE=0, SE=1 */
0}; /* FE=0, SE=0 */ 0 /* FE=0, SE=0 */
};
while (i < 4) { while (i < 4) {
writeq(value[i], &bar0->swapper_ctrl); writeq(value[i], &bar0->swapper_ctrl);
...@@ -3627,10 +3629,12 @@ static int s2io_set_swapper(struct s2io_nic *sp) ...@@ -3627,10 +3629,12 @@ static int s2io_set_swapper(struct s2io_nic *sp)
if (val64 != valt) { if (val64 != valt) {
int i = 0; int i = 0;
u64 value[] = { 0x00C3C30000C3C300ULL, /* FE=1, SE=1 */ static const u64 value[] = {
0x00C3C30000C3C300ULL, /* FE=1, SE=1 */
0x0081810000818100ULL, /* FE=1, SE=0 */ 0x0081810000818100ULL, /* FE=1, SE=0 */
0x0042420000424200ULL, /* FE=0, SE=1 */ 0x0042420000424200ULL, /* FE=0, SE=1 */
0}; /* FE=0, SE=0 */ 0 /* FE=0, SE=0 */
};
while (i < 4) { while (i < 4) {
writeq((value[i] | valr), &bar0->swapper_ctrl); writeq((value[i] | valr), &bar0->swapper_ctrl);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册