fm10k: address operator not needed when declaring function pointers
Subsystems (2)
PATCH 1/2 fm10k: address operator not needed when declaring function pointers
--- drivers/net/ethernet/intel/fm10k/fm10k_pf.c | 58 ++++++++++++++------------- drivers/net/ethernet/intel/fm10k/fm10k_vf.c | 38 +++++++++--------- 2 files changed, 48 insertions(+), 48 deletions(-)
drivers/net/ethernet/intel/fm10k/fm10k_pf.c +29 -29
@@ -1867,38 +1867,38 @@ static const struct fm10k_msg_data fm10k_msg_data_pf[] = { };static struct fm10k_mac_ops mac_ops_pf = { - .get_bus_info = &fm10k_get_bus_info_generic, - .reset_hw = &fm10k_reset_hw_pf, - .init_hw = &fm10k_init_hw_pf, - .start_hw = &fm10k_start_hw_generic, - .stop_hw = &fm10k_stop_hw_generic, - .update_vlan = &fm10k_update_vlan_pf, - .read_mac_addr = &fm10k_read_mac_addr_pf, - .update_uc_addr = &fm10k_update_uc_addr_pf, - .update_mc_addr = &fm10k_update_mc_addr_pf, - .update_xcast_mode = &fm10k_update_xcast_mode_pf, - .update_int_moderator = &fm10k_update_int_moderator_pf, - .update_lport_state = &fm10k_update_lport_state_pf, - .update_hw_stats = &fm10k_update_hw_stats_pf, - .rebind_hw_stats = &fm10k_rebind_hw_stats_pf, - .configure_dglort_map = &fm10k_configure_dglort_map_pf, - .set_dma_mask = &fm10k_set_dma_mask_pf, - .get_fault = &fm10k_get_fault_pf, - .get_host_state = &fm10k_get_host_state_pf, - .adjust_systime = &fm10k_adjust_systime_pf, - .read_systime = &fm10k_read_systime_pf, + .get_bus_info = fm10k_get_bus_info_generic, + .reset_hw = fm10k_reset_hw_pf, + .init_hw = fm10k_init_hw_pf, + .start_hw = fm10k_start_hw_generic, + .stop_hw = fm10k_stop_hw_generic, + .update_vlan = fm10k_update_vlan_pf, + .read_mac_addr = fm10k_read_mac_addr_pf, + .update_uc_addr = fm10k_update_uc_addr_pf, + .update_mc_addr = fm10k_update_mc_addr_pf, + .update_xcast_mode = fm10k_update_xcast_mode_pf, + .update_int_moderator = fm10k_update_int_moderator_pf, + .update_lport_state = fm10k_update_lport_state_pf, + .update_hw_stats = fm10k_update_hw_stats_pf, + .rebind_hw_stats = fm10k_rebind_hw_stats_pf, + .configure_dglort_map = fm10k_configure_dglort_map_pf, + .set_dma_mask = fm10k_set_dma_mask_pf, + .get_fault = fm10k_get_fault_pf, + .get_host_state = fm10k_get_host_state_pf, + .adjust_systime = fm10k_adjust_systime_pf, + .read_systime = fm10k_read_systime_pf, };static struct fm10k_iov_ops iov_ops_pf = { - .assign_resources = &fm10k_iov_assign_resources_pf, - .configure_tc = &fm10k_iov_configure_tc_pf, - .assign_int_moderator = &fm10k_iov_assign_int_moderator_pf, + .assign_resources = fm10k_iov_assign_resources_pf, + .configure_tc = fm10k_iov_configure_tc_pf, + .assign_int_moderator = fm10k_iov_assign_int_moderator_pf, .assign_default_mac_vlan = fm10k_iov_assign_default_mac_vlan_pf, - .reset_resources = &fm10k_iov_reset_resources_pf, - .set_lport = &fm10k_iov_set_lport_pf, - .reset_lport = &fm10k_iov_reset_lport_pf, - .update_stats = &fm10k_iov_update_stats_pf, - .report_timestamp = &fm10k_iov_report_timestamp_pf, + .reset_resources = fm10k_iov_reset_resources_pf, + .set_lport = fm10k_iov_set_lport_pf, + .reset_lport = fm10k_iov_reset_lport_pf, + .update_stats = fm10k_iov_update_stats_pf, + .report_timestamp = fm10k_iov_report_timestamp_pf, };static s32 fm10k_get_invariants_pf (struct fm10k_hw *hw)
@@ -1910,7 +1910,7 @@ static s32 fm10k_get_invariants_pf(struct fm10k_hw *hw)struct fm10k_info fm10k_pf_info = { .mac = fm10k_mac_pf, - .get_invariants = &fm10k_get_invariants_pf, + .get_invariants = fm10k_get_invariants_pf, .mac_ops = &mac_ops_pf, .iov_ops = &iov_ops_pf, };
drivers/net/ethernet/intel/fm10k/fm10k_vf.c +19 -19
@@ -563,24 +563,24 @@ static const struct fm10k_msg_data fm10k_msg_data_vf[] = { };static struct fm10k_mac_ops mac_ops_vf = { - .get_bus_info = &fm10k_get_bus_info_generic, - .reset_hw = &fm10k_reset_hw_vf, - .init_hw = &fm10k_init_hw_vf, - .start_hw = &fm10k_start_hw_generic, - .stop_hw = &fm10k_stop_hw_vf, - .update_vlan = &fm10k_update_vlan_vf, - .read_mac_addr = &fm10k_read_mac_addr_vf, - .update_uc_addr = &fm10k_update_uc_addr_vf, - .update_mc_addr = &fm10k_update_mc_addr_vf, - .update_xcast_mode = &fm10k_update_xcast_mode_vf, - .update_int_moderator = &fm10k_update_int_moderator_vf, - .update_lport_state = &fm10k_update_lport_state_vf, - .update_hw_stats = &fm10k_update_hw_stats_vf, - .rebind_hw_stats = &fm10k_rebind_hw_stats_vf, - .configure_dglort_map = &fm10k_configure_dglort_map_vf, - .get_host_state = &fm10k_get_host_state_generic, - .adjust_systime = &fm10k_adjust_systime_vf, - .read_systime = &fm10k_read_systime_vf, + .get_bus_info = fm10k_get_bus_info_generic, + .reset_hw = fm10k_reset_hw_vf, + .init_hw = fm10k_init_hw_vf, + .start_hw = fm10k_start_hw_generic, + .stop_hw = fm10k_stop_hw_vf, + .update_vlan = fm10k_update_vlan_vf, + .read_mac_addr = fm10k_read_mac_addr_vf, + .update_uc_addr = fm10k_update_uc_addr_vf, + .update_mc_addr = fm10k_update_mc_addr_vf, + .update_xcast_mode = fm10k_update_xcast_mode_vf, + .update_int_moderator = fm10k_update_int_moderator_vf, + .update_lport_state = fm10k_update_lport_state_vf, + .update_hw_stats = fm10k_update_hw_stats_vf, + .rebind_hw_stats = fm10k_rebind_hw_stats_vf, + .configure_dglort_map = fm10k_configure_dglort_map_vf, + .get_host_state = fm10k_get_host_state_generic, + .adjust_systime = fm10k_adjust_systime_vf, + .read_systime = fm10k_read_systime_vf, };static s32 fm10k_get_invariants_vf (struct fm10k_hw *hw)
@@ -592,6 +592,6 @@ static s32 fm10k_get_invariants_vf(struct fm10k_hw *hw)struct fm10k_info fm10k_vf_info = { .mac = fm10k_mac_vf, - .get_invariants = &fm10k_get_invariants_vf, + .get_invariants = fm10k_get_invariants_vf, .mac_ops = &mac_ops_vf, };
PATCH 2/2 fm10k: constify fm10k_mac_ops, fm10k_iov_ops and fm10k_info structures
These structures never change so declare them as const.
--- drivers/net/ethernet/intel/fm10k/fm10k_pf.c | 6 +++--- drivers/net/ethernet/intel/fm10k/fm10k_pf.h | 2 +- drivers/net/ethernet/intel/fm10k/fm10k_type.h | 8 ++++---- drivers/net/ethernet/intel/fm10k/fm10k_vf.c | 4 ++-- drivers/net/ethernet/intel/fm10k/fm10k_vf.h | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-)
drivers/net/ethernet/intel/fm10k/fm10k_pf.c +3 -3
@@ -1866,7 +1866,7 @@ static const struct fm10k_msg_data fm10k_msg_data_pf[] = { FM10K_TLV_MSG_ERROR_HANDLER(fm10k_tlv_msg_error), }; -static struct fm10k_mac_ops mac_ops_pf = { +static const struct fm10k_mac_ops mac_ops_pf = { .get_bus_info = fm10k_get_bus_info_generic, .reset_hw = fm10k_reset_hw_pf, .init_hw = fm10k_init_hw_pf,
@@ -1889,7 +1889,7 @@ static struct fm10k_mac_ops mac_ops_pf = { .read_systime = fm10k_read_systime_pf, }; -static struct fm10k_iov_ops iov_ops_pf = { +static const struct fm10k_iov_ops iov_ops_pf = { .assign_resources = fm10k_iov_assign_resources_pf, .configure_tc = fm10k_iov_configure_tc_pf, .assign_int_moderator = fm10k_iov_assign_int_moderator_pf,
@@ -1908,7 +1908,7 @@ static s32 fm10k_get_invariants_pf(struct fm10k_hw *hw)return fm10k_sm_mbx_init (hw, &hw->mbx, fm10k_msg_data_pf); } -struct fm10k_info fm10k_pf_info = { +const struct fm10k_info fm10k_pf_info = { .mac = fm10k_mac_pf, .get_invariants = fm10k_get_invariants_pf, .mac_ops = &mac_ops_pf,
drivers/net/ethernet/intel/fm10k/fm10k_pf.h +1 -1
@@ -133,5 +133,5 @@ s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *, u32 **,s32 fm10k_iov_msg_lport_state_pf (struct fm10k_hw *,u32 **,struct fm10k_mbx_info *); -extern struct fm10k_info fm10k_pf_info; +extern const struct fm10k_info fm10k_pf_info;#endif /* _FM10K_PF_H */
drivers/net/ethernet/intel/fm10k/fm10k_type.h +4 -4
@@ -660,10 +660,10 @@ enum fm10k_devices { };struct fm10k_info { -enum fm10k_mac_type mac; -s32 (*get_invariants)(struct fm10k_hw *); -struct fm10k_mac_ops *mac_ops; -struct fm10k_iov_ops *iov_ops; +enum fm10k_mac_type mac; +s32 (*get_invariants)(struct fm10k_hw *); +const struct fm10k_mac_ops *mac_ops; +const struct fm10k_iov_ops *iov_ops; };struct fm10k_hw {
drivers/net/ethernet/intel/fm10k/fm10k_vf.c +2 -2
@@ -562,7 +562,7 @@ static const struct fm10k_msg_data fm10k_msg_data_vf[] = { FM10K_TLV_MSG_ERROR_HANDLER(fm10k_tlv_msg_error), }; -static struct fm10k_mac_ops mac_ops_vf = { +static const struct fm10k_mac_ops mac_ops_vf = { .get_bus_info = fm10k_get_bus_info_generic, .reset_hw = fm10k_reset_hw_vf, .init_hw = fm10k_init_hw_vf,
@@ -590,7 +590,7 @@ static s32 fm10k_get_invariants_vf(struct fm10k_hw *hw)return fm10k_pfvf_mbx_init (hw, &hw->mbx, fm10k_msg_data_vf,0 ); } -struct fm10k_info fm10k_vf_info = { +const struct fm10k_info fm10k_vf_info = { .mac = fm10k_mac_vf, .get_invariants = fm10k_get_invariants_vf, .mac_ops = &mac_ops_vf,
drivers/net/ethernet/intel/fm10k/fm10k_vf.h +1 -1
@@ -74,5 +74,5 @@ extern const struct fm10k_tlv_attr fm10k_1588_msg_attr[];#define FM10K_VF_MSG_1588_HANDLER (func) \ FM10K_MSG_HANDLER(FM10K_VF_MSG_ID_1588, fm10k_1588_msg_attr, func) -extern struct fm10k_info fm10k_vf_info; +extern const struct fm10k_info fm10k_vf_info;#endif /* _FM10K_VF_H */
Singh
PATCH 2/2 fm10k: constify fm10k_mac_ops, fm10k_iov_ops and fm10k_info structures
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bruce Allan
Sent: Tuesday, December 8, 2015 3:51 PM
To: [email protected]
Subject: [Intel-wired-lan] [PATCH 2/2] fm10k: constify fm10k_mac_ops, fm10k_iov_ops and fm10k_info structures
These structures never change so declare them as const.
---
Singh
PATCH 1/2 fm10k: address operator not needed when declaring function pointers
In reply to Bruce Allan-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Bruce Allan
Sent: Tuesday, December 8, 2015 3:51 PM
To: [email protected]
Subject: [Intel-wired-lan] [PATCH 1/2] fm10k: address operator not needed when declaring function pointers
---