ixgbe: declare ixgbe_mac_operations structures as const
Subsystems (3)
PATCH 1/1 ixgbe: declare ixgbe_mac_operations structures as const
Declare ixgbe_mac_operations structures as const as they are only stored in the mac_ops field of ixgbe_info structure. This field is of type const and therefore ixgbe_mac_operations structure can be made const too.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c +2 -2
@@ -3858,7 +3858,7 @@ static s32 ixgbe_write_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, .write_iosf_sb_reg = ixgbe_write_iosf_sb_reg_x550, }; -static struct ixgbe_mac_operations mac_ops_x550em_a = { +static const struct ixgbe_mac_operations mac_ops_x550em_a = {X550_COMMON_MAC .led_on = ixgbe_led_on_t_x550em, .led_off = ixgbe_led_off_t_x550em,
@@ -3879,7 +3879,7 @@ static s32 ixgbe_write_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, .write_iosf_sb_reg = ixgbe_write_iosf_sb_reg_x550a, }; -static struct ixgbe_mac_operations mac_ops_x550em_a_fw = { +static const struct ixgbe_mac_operations mac_ops_x550em_a_fw = {X550_COMMON_MAC .led_on = ixgbe_led_on_generic, .led_off = ixgbe_led_off_generic,
Signature · 1 line
1.9.1
Bowers
PATCH 1/1 ixgbe: declare ixgbe_mac_operations structures as const
Quoted 11 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Bhumika Goyal
Sent: Monday, July 17, 2017 8:01 AM
To: julia.lawall at lip6.fr; Kirsher, Jeffrey T <[email protected]>; intel- wired-lan at lists.osuosl.org; netdev at vger.kernel.org; linux-
kernel at vger.kernel.org
Cc: Bhumika Goyal <[email protected]>
Subject: [Intel-wired-lan] [PATCH] ixgbe: declareixgbe_mac_operationsstructures as const
Quoted 8 lines
Declare
ixgbe_mac_operationsstructures as const as they are only stored in themac_opsfield ofixgbe_infostructure. This field is of type const and thereforeixgbe_mac_operationsstructure can be made const too.Signed-off-by Bhumika Goyal <[email protected]>--- drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)