Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66744500 authored by Jeff Kirsher's avatar Jeff Kirsher
Browse files

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: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: default avatarEmil Tantilov <emil.s.tantilov@intel.com>
parent 19a0b67a
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -4892,8 +4892,8 @@ static s32 e1000_get_cable_length(struct e1000_hw *hw, u16 *min_length,
	} else if (hw->phy_type == e1000_phy_igp) {	/* For IGP PHY */
		u16 cur_agc_value;
		u16 min_agc_value = IGP01E1000_AGC_LENGTH_TABLE_SIZE;
		u16 agc_reg_array[IGP01E1000_PHY_CHANNEL_NUM] =
		    { IGP01E1000_PHY_AGC_A,
		static const u16 agc_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = {
		       IGP01E1000_PHY_AGC_A,
		       IGP01E1000_PHY_AGC_B,
		       IGP01E1000_PHY_AGC_C,
		       IGP01E1000_PHY_AGC_D
@@ -5071,8 +5071,8 @@ static s32 e1000_config_dsp_after_link_change(struct e1000_hw *hw, bool link_up)
{
	s32 ret_val;
	u16 phy_data, phy_saved_data, speed, duplex, i;
	u16 dsp_reg_array[IGP01E1000_PHY_CHANNEL_NUM] =
	    { IGP01E1000_PHY_AGC_PARAM_A,
	static const u16 dsp_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = {
	       IGP01E1000_PHY_AGC_PARAM_A,
	       IGP01E1000_PHY_AGC_PARAM_B,
	       IGP01E1000_PHY_AGC_PARAM_C,
	       IGP01E1000_PHY_AGC_PARAM_D
+7 −6
Original line number Diff line number Diff line
@@ -352,12 +352,13 @@ void __devinit e1000_check_options(struct e1000_adapter *adapter)
	}
	{ /* Flow Control */

		struct e1000_opt_list fc_list[] =
			{{ E1000_FC_NONE,    "Flow Control Disabled" },
		static const struct e1000_opt_list fc_list[] = {
		       { E1000_FC_NONE, "Flow Control Disabled" },
		       { E1000_FC_RX_PAUSE, "Flow Control Receive Only" },
		       { E1000_FC_TX_PAUSE, "Flow Control Transmit Only" },
		       { E1000_FC_FULL, "Flow Control Enabled" },
			 { E1000_FC_DEFAULT, "Flow Control Hardware Default" }};
		       { E1000_FC_DEFAULT, "Flow Control Hardware Default" }
		};

		opt = (struct e1000_option) {
			.type = list_option,
+6 −5
Original line number Diff line number Diff line
@@ -1840,11 +1840,12 @@ s32 e1000e_get_cable_length_igp_2(struct e1000_hw *hw)
	u16 phy_data, i, agc_value = 0;
	u16 cur_agc_index, max_agc_index = 0;
	u16 min_agc_index = IGP02E1000_CABLE_LENGTH_TABLE_SIZE - 1;
	u16 agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] =
							 {IGP02E1000_PHY_AGC_A,
	static const u16 agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] = {
	       IGP02E1000_PHY_AGC_A,
	       IGP02E1000_PHY_AGC_B,
	       IGP02E1000_PHY_AGC_C,
							  IGP02E1000_PHY_AGC_D};
	       IGP02E1000_PHY_AGC_D
	};

	/* Read the AGC registers for all channels */
	for (i = 0; i < IGP02E1000_PHY_CHANNEL_NUM; i++) {
+6 −5
Original line number Diff line number Diff line
@@ -1757,11 +1757,12 @@ s32 igb_get_cable_length_igp_2(struct e1000_hw *hw)
	u16 phy_data, i, agc_value = 0;
	u16 cur_agc_index, max_agc_index = 0;
	u16 min_agc_index = IGP02E1000_CABLE_LENGTH_TABLE_SIZE - 1;
	u16 agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] =
							 {IGP02E1000_PHY_AGC_A,
	static const u16 agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] = {
	       IGP02E1000_PHY_AGC_A,
	       IGP02E1000_PHY_AGC_B,
	       IGP02E1000_PHY_AGC_C,
							  IGP02E1000_PHY_AGC_D};
	       IGP02E1000_PHY_AGC_D
	};

	/* Read the AGC registers for all channels */
	for (i = 0; i < IGP02E1000_PHY_CHANNEL_NUM; i++) {
+11 −10
Original line number Diff line number Diff line
@@ -191,9 +191,9 @@ struct ixgb_option {
		} r;
		struct {	/* list_option info */
			int nr;
			struct ixgb_opt_list {
			const struct ixgb_opt_list {
				int i;
				char *str;
				const char *str;
			} *p;
		} l;
	} arg;
@@ -226,7 +226,7 @@ ixgb_validate_option(unsigned int *value, const struct ixgb_option *opt)
		break;
	case list_option: {
		int i;
		struct ixgb_opt_list *ent;
		const struct ixgb_opt_list *ent;

		for (i = 0; i < opt->arg.l.nr; i++) {
			ent = &opt->arg.l.p[i];
@@ -322,14 +322,15 @@ ixgb_check_options(struct ixgb_adapter *adapter)
	}
	{ /* Flow Control */

		struct ixgb_opt_list fc_list[] =
			{{ ixgb_fc_none,	"Flow Control Disabled" },
		static const struct ixgb_opt_list fc_list[] = {
		       { ixgb_fc_none, "Flow Control Disabled" },
		       { ixgb_fc_rx_pause, "Flow Control Receive Only" },
		       { ixgb_fc_tx_pause, "Flow Control Transmit Only" },
		       { ixgb_fc_full, "Flow Control Enabled" },
			 { ixgb_fc_default, "Flow Control Hardware Default" }};
		       { ixgb_fc_default, "Flow Control Hardware Default" }
		};

		const struct ixgb_option opt = {
		static const struct ixgb_option opt = {
			.type = list_option,
			.name = "Flow Control",
			.err  = "reading default settings from EEPROM",
Loading