Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

e1000e: make function tables const

The initial function and setup tables can be marked as constant.

Reported-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>

+36 -36
+4 -4
drivers/net/ethernet/intel/e1000e/80003es2lan.c
··· 1441 1441 er32(ICRXDMTC); 1442 1442 } 1443 1443 1444 - static struct e1000_mac_operations es2_mac_ops = { 1444 + static const struct e1000_mac_operations es2_mac_ops = { 1445 1445 .read_mac_addr = e1000_read_mac_addr_80003es2lan, 1446 1446 .id_led_init = e1000e_id_led_init, 1447 1447 .blink_led = e1000e_blink_led_generic, ··· 1464 1464 .setup_led = e1000e_setup_led_generic, 1465 1465 }; 1466 1466 1467 - static struct e1000_phy_operations es2_phy_ops = { 1467 + static const struct e1000_phy_operations es2_phy_ops = { 1468 1468 .acquire = e1000_acquire_phy_80003es2lan, 1469 1469 .check_polarity = e1000_check_polarity_m88, 1470 1470 .check_reset_block = e1000e_check_reset_block_generic, ··· 1482 1482 .cfg_on_link_up = e1000_cfg_on_link_up_80003es2lan, 1483 1483 }; 1484 1484 1485 - static struct e1000_nvm_operations es2_nvm_ops = { 1485 + static const struct e1000_nvm_operations es2_nvm_ops = { 1486 1486 .acquire = e1000_acquire_nvm_80003es2lan, 1487 1487 .read = e1000e_read_nvm_eerd, 1488 1488 .release = e1000_release_nvm_80003es2lan, ··· 1492 1492 .write = e1000_write_nvm_80003es2lan, 1493 1493 }; 1494 1494 1495 - struct e1000_info e1000_es2_info = { 1495 + const struct e1000_info e1000_es2_info = { 1496 1496 .mac = e1000_80003es2lan, 1497 1497 .flags = FLAG_HAS_HW_VLAN_FILTER 1498 1498 | FLAG_HAS_JUMBO_FRAMES
+10 -10
drivers/net/ethernet/intel/e1000e/82571.c
··· 1927 1927 er32(ICRXDMTC); 1928 1928 } 1929 1929 1930 - static struct e1000_mac_operations e82571_mac_ops = { 1930 + static const struct e1000_mac_operations e82571_mac_ops = { 1931 1931 /* .check_mng_mode: mac type dependent */ 1932 1932 /* .check_for_link: media type dependent */ 1933 1933 .id_led_init = e1000e_id_led_init, ··· 1949 1949 .read_mac_addr = e1000_read_mac_addr_82571, 1950 1950 }; 1951 1951 1952 - static struct e1000_phy_operations e82_phy_ops_igp = { 1952 + static const struct e1000_phy_operations e82_phy_ops_igp = { 1953 1953 .acquire = e1000_get_hw_semaphore_82571, 1954 1954 .check_polarity = e1000_check_polarity_igp, 1955 1955 .check_reset_block = e1000e_check_reset_block_generic, ··· 1967 1967 .cfg_on_link_up = NULL, 1968 1968 }; 1969 1969 1970 - static struct e1000_phy_operations e82_phy_ops_m88 = { 1970 + static const struct e1000_phy_operations e82_phy_ops_m88 = { 1971 1971 .acquire = e1000_get_hw_semaphore_82571, 1972 1972 .check_polarity = e1000_check_polarity_m88, 1973 1973 .check_reset_block = e1000e_check_reset_block_generic, ··· 1985 1985 .cfg_on_link_up = NULL, 1986 1986 }; 1987 1987 1988 - static struct e1000_phy_operations e82_phy_ops_bm = { 1988 + static const struct e1000_phy_operations e82_phy_ops_bm = { 1989 1989 .acquire = e1000_get_hw_semaphore_82571, 1990 1990 .check_polarity = e1000_check_polarity_m88, 1991 1991 .check_reset_block = e1000e_check_reset_block_generic, ··· 2003 2003 .cfg_on_link_up = NULL, 2004 2004 }; 2005 2005 2006 - static struct e1000_nvm_operations e82571_nvm_ops = { 2006 + static const struct e1000_nvm_operations e82571_nvm_ops = { 2007 2007 .acquire = e1000_acquire_nvm_82571, 2008 2008 .read = e1000e_read_nvm_eerd, 2009 2009 .release = e1000_release_nvm_82571, ··· 2013 2013 .write = e1000_write_nvm_82571, 2014 2014 }; 2015 2015 2016 - struct e1000_info e1000_82571_info = { 2016 + const struct e1000_info e1000_82571_info = { 2017 2017 .mac = e1000_82571, 2018 2018 .flags = FLAG_HAS_HW_VLAN_FILTER 2019 2019 | FLAG_HAS_JUMBO_FRAMES ··· 2034 2034 .nvm_ops = &e82571_nvm_ops, 2035 2035 }; 2036 2036 2037 - struct e1000_info e1000_82572_info = { 2037 + const struct e1000_info e1000_82572_info = { 2038 2038 .mac = e1000_82572, 2039 2039 .flags = FLAG_HAS_HW_VLAN_FILTER 2040 2040 | FLAG_HAS_JUMBO_FRAMES ··· 2052 2052 .nvm_ops = &e82571_nvm_ops, 2053 2053 }; 2054 2054 2055 - struct e1000_info e1000_82573_info = { 2055 + const struct e1000_info e1000_82573_info = { 2056 2056 .mac = e1000_82573, 2057 2057 .flags = FLAG_HAS_HW_VLAN_FILTER 2058 2058 | FLAG_HAS_WOL ··· 2070 2070 .nvm_ops = &e82571_nvm_ops, 2071 2071 }; 2072 2072 2073 - struct e1000_info e1000_82574_info = { 2073 + const struct e1000_info e1000_82574_info = { 2074 2074 .mac = e1000_82574, 2075 2075 .flags = FLAG_HAS_HW_VLAN_FILTER 2076 2076 | FLAG_HAS_MSIX ··· 2091 2091 .nvm_ops = &e82571_nvm_ops, 2092 2092 }; 2093 2093 2094 - struct e1000_info e1000_82583_info = { 2094 + const struct e1000_info e1000_82583_info = { 2095 2095 .mac = e1000_82583, 2096 2096 .flags = FLAG_HAS_HW_VLAN_FILTER 2097 2097 | FLAG_HAS_WOL
+14 -14
drivers/net/ethernet/intel/e1000e/e1000.h
··· 406 406 u32 pba; 407 407 u32 max_hw_frame_size; 408 408 s32 (*get_variants)(struct e1000_adapter *); 409 - struct e1000_mac_operations *mac_ops; 410 - struct e1000_phy_operations *phy_ops; 411 - struct e1000_nvm_operations *nvm_ops; 409 + const struct e1000_mac_operations *mac_ops; 410 + const struct e1000_phy_operations *phy_ops; 411 + const struct e1000_nvm_operations *nvm_ops; 412 412 }; 413 413 414 414 /* hardware capability, feature, and workaround flags */ ··· 506 506 507 507 extern char *e1000e_get_hw_dev_name(struct e1000_hw *hw); 508 508 509 - extern struct e1000_info e1000_82571_info; 510 - extern struct e1000_info e1000_82572_info; 511 - extern struct e1000_info e1000_82573_info; 512 - extern struct e1000_info e1000_82574_info; 513 - extern struct e1000_info e1000_82583_info; 514 - extern struct e1000_info e1000_ich8_info; 515 - extern struct e1000_info e1000_ich9_info; 516 - extern struct e1000_info e1000_ich10_info; 517 - extern struct e1000_info e1000_pch_info; 518 - extern struct e1000_info e1000_pch2_info; 519 - extern struct e1000_info e1000_es2_info; 509 + extern const struct e1000_info e1000_82571_info; 510 + extern const struct e1000_info e1000_82572_info; 511 + extern const struct e1000_info e1000_82573_info; 512 + extern const struct e1000_info e1000_82574_info; 513 + extern const struct e1000_info e1000_82583_info; 514 + extern const struct e1000_info e1000_ich8_info; 515 + extern const struct e1000_info e1000_ich9_info; 516 + extern const struct e1000_info e1000_ich10_info; 517 + extern const struct e1000_info e1000_pch_info; 518 + extern const struct e1000_info e1000_pch2_info; 519 + extern const struct e1000_info e1000_es2_info; 520 520 521 521 extern s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num, 522 522 u32 pba_num_size);
+8 -8
drivers/net/ethernet/intel/e1000e/ich8lan.c
··· 4011 4011 } 4012 4012 } 4013 4013 4014 - static struct e1000_mac_operations ich8_mac_ops = { 4014 + static const struct e1000_mac_operations ich8_mac_ops = { 4015 4015 .id_led_init = e1000e_id_led_init, 4016 4016 /* check_mng_mode dependent on mac type */ 4017 4017 .check_for_link = e1000_check_for_copper_link_ich8lan, ··· 4030 4030 /* id_led_init dependent on mac type */ 4031 4031 }; 4032 4032 4033 - static struct e1000_phy_operations ich8_phy_ops = { 4033 + static const struct e1000_phy_operations ich8_phy_ops = { 4034 4034 .acquire = e1000_acquire_swflag_ich8lan, 4035 4035 .check_reset_block = e1000_check_reset_block_ich8lan, 4036 4036 .commit = NULL, ··· 4044 4044 .write_reg = e1000e_write_phy_reg_igp, 4045 4045 }; 4046 4046 4047 - static struct e1000_nvm_operations ich8_nvm_ops = { 4047 + static const struct e1000_nvm_operations ich8_nvm_ops = { 4048 4048 .acquire = e1000_acquire_nvm_ich8lan, 4049 4049 .read = e1000_read_nvm_ich8lan, 4050 4050 .release = e1000_release_nvm_ich8lan, ··· 4054 4054 .write = e1000_write_nvm_ich8lan, 4055 4055 }; 4056 4056 4057 - struct e1000_info e1000_ich8_info = { 4057 + const struct e1000_info e1000_ich8_info = { 4058 4058 .mac = e1000_ich8lan, 4059 4059 .flags = FLAG_HAS_WOL 4060 4060 | FLAG_IS_ICH ··· 4070 4070 .nvm_ops = &ich8_nvm_ops, 4071 4071 }; 4072 4072 4073 - struct e1000_info e1000_ich9_info = { 4073 + const struct e1000_info e1000_ich9_info = { 4074 4074 .mac = e1000_ich9lan, 4075 4075 .flags = FLAG_HAS_JUMBO_FRAMES 4076 4076 | FLAG_IS_ICH ··· 4088 4088 .nvm_ops = &ich8_nvm_ops, 4089 4089 }; 4090 4090 4091 - struct e1000_info e1000_ich10_info = { 4091 + const struct e1000_info e1000_ich10_info = { 4092 4092 .mac = e1000_ich10lan, 4093 4093 .flags = FLAG_HAS_JUMBO_FRAMES 4094 4094 | FLAG_IS_ICH ··· 4106 4106 .nvm_ops = &ich8_nvm_ops, 4107 4107 }; 4108 4108 4109 - struct e1000_info e1000_pch_info = { 4109 + const struct e1000_info e1000_pch_info = { 4110 4110 .mac = e1000_pchlan, 4111 4111 .flags = FLAG_IS_ICH 4112 4112 | FLAG_HAS_WOL ··· 4125 4125 .nvm_ops = &ich8_nvm_ops, 4126 4126 }; 4127 4127 4128 - struct e1000_info e1000_pch2_info = { 4128 + const struct e1000_info e1000_pch2_info = { 4129 4129 .mac = e1000_pch2lan, 4130 4130 .flags = FLAG_IS_ICH 4131 4131 | FLAG_HAS_WOL