aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbevf
diff options
context:
space:
mode:
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>2010-12-01 14:59:50 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2010-12-11 01:12:32 -0500
commit667445008db3f45a760c235d771be0c9671e59e5 (patch)
tree6b6fea62bfcfeb78a6deeb851b70c8eda0700c17 /drivers/net/ixgbevf
parent19a0b67afd174c4db261d587b5c67704dcd53c17 (diff)
Intel Wired LAN drivers: Use static const
Based on work by Joe Perches <joe@perches.com> Using static const to decrease data and overall object size. CC: Joe Perches <joe@perches.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
Diffstat (limited to 'drivers/net/ixgbevf')
-rw-r--r--drivers/net/ixgbevf/ethtool.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/net/ixgbevf/ethtool.c b/drivers/net/ixgbevf/ethtool.c
index 4cc817acfb62..fa29b3c8c464 100644
--- a/drivers/net/ixgbevf/ethtool.c
+++ b/drivers/net/ixgbevf/ethtool.c
@@ -544,7 +544,7 @@ struct ixgbevf_reg_test {
544#define TABLE64_TEST_HI 6 544#define TABLE64_TEST_HI 6
545 545
546/* default VF register test */ 546/* default VF register test */
547static struct ixgbevf_reg_test reg_test_vf[] = { 547static const struct ixgbevf_reg_test reg_test_vf[] = {
548 { IXGBE_VFRDBAL(0), 2, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFF80 }, 548 { IXGBE_VFRDBAL(0), 2, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFF80 },
549 { IXGBE_VFRDBAH(0), 2, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF }, 549 { IXGBE_VFRDBAH(0), 2, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
550 { IXGBE_VFRDLEN(0), 2, PATTERN_TEST, 0x000FFF80, 0x000FFFFF }, 550 { IXGBE_VFRDLEN(0), 2, PATTERN_TEST, 0x000FFF80, 0x000FFFFF },
@@ -557,19 +557,23 @@ static struct ixgbevf_reg_test reg_test_vf[] = {
557 { 0, 0, 0, 0 } 557 { 0, 0, 0, 0 }
558}; 558};
559 559
560static const u32 register_test_patterns[] = {
561 0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF
562};
563
560#define REG_PATTERN_TEST(R, M, W) \ 564#define REG_PATTERN_TEST(R, M, W) \
561{ \ 565{ \
562 u32 pat, val, before; \ 566 u32 pat, val, before; \
563 const u32 _test[] = {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF}; \ 567 for (pat = 0; pat < ARRAY_SIZE(register_test_patterns); pat++) { \
564 for (pat = 0; pat < ARRAY_SIZE(_test); pat++) { \
565 before = readl(adapter->hw.hw_addr + R); \ 568 before = readl(adapter->hw.hw_addr + R); \
566 writel((_test[pat] & W), (adapter->hw.hw_addr + R)); \ 569 writel((register_test_patterns[pat] & W), \
570 (adapter->hw.hw_addr + R)); \
567 val = readl(adapter->hw.hw_addr + R); \ 571 val = readl(adapter->hw.hw_addr + R); \
568 if (val != (_test[pat] & W & M)) { \ 572 if (val != (register_test_patterns[pat] & W & M)) { \
569 hw_dbg(&adapter->hw, \ 573 hw_dbg(&adapter->hw, \
570 "pattern test reg %04X failed: got " \ 574 "pattern test reg %04X failed: got " \
571 "0x%08X expected 0x%08X\n", \ 575 "0x%08X expected 0x%08X\n", \
572 R, val, (_test[pat] & W & M)); \ 576 R, val, (register_test_patterns[pat] & W & M)); \
573 *data = R; \ 577 *data = R; \
574 writel(before, adapter->hw.hw_addr + R); \ 578 writel(before, adapter->hw.hw_addr + R); \
575 return 1; \ 579 return 1; \
@@ -596,7 +600,7 @@ static struct ixgbevf_reg_test reg_test_vf[] = {
596 600
597static int ixgbevf_reg_test(struct ixgbevf_adapter *adapter, u64 *data) 601static int ixgbevf_reg_test(struct ixgbevf_adapter *adapter, u64 *data)
598{ 602{
599 struct ixgbevf_reg_test *test; 603 const struct ixgbevf_reg_test *test;
600 u32 i; 604 u32 i;
601 605
602 test = reg_test_vf; 606 test = reg_test_vf;