fm10k: constify fm10k_mac_ops, fm10k_iov_ops and fm10k_info structures
authorBruce Allan <bruce.w.allan@intel.com>
Tue, 8 Dec 2015 23:50:39 +0000 (15:50 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 22 Dec 2015 13:10:01 +0000 (05:10 -0800)
These structures never change so declare them as const.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/fm10k/fm10k_pf.c
drivers/net/ethernet/intel/fm10k/fm10k_pf.h
drivers/net/ethernet/intel/fm10k/fm10k_type.h
drivers/net/ethernet/intel/fm10k/fm10k_vf.c
drivers/net/ethernet/intel/fm10k/fm10k_vf.h

index 606c0f1e49e676fa3ceecb83d26db6dec9576cde..62ccebc5f7288ceb79262b7c01f6162fd675ac20 100644 (file)
@@ -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,
index 337859260b9b0f5e4747de2f9f6a1e89c5c1f777..b2d96b45ca3ccadc936170557b4a32f337f7396c 100644 (file)
@@ -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 */
index 098883d2875f6f4e3f34a8a424788e0a025b67dc..bc27c757d88b291840a0e3b61f8ce3e9dcbede61 100644 (file)
@@ -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 {
index 38219f5f51b26b18f8067812432118d44045e12e..91f8d7311f3bfc08dd91ad7edb8a3641cdd58d21 100644 (file)
@@ -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,
index 06a99d794c99beda298ad4ffa7d812545f56eb72..c4439f1313a016cf42486fc90f17d665f23f9368 100644 (file)
@@ -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 */