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

Commit 4f0fc7c3 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville
Browse files

ath9k: make private driver rate tables const



On x86 this allows us to do the following small savings:
shave off 23 % off of the module's data, and
shave off 6  % off of the module's text.

We save 456 bytes, for those counting.

$ size ath9k.ko
   text    data     bss     dec     hex filename
 250794    3628    1600  256022   3e816 ath9k.ko
$ size ath9k-old.ko
   text    data     bss     dec     hex filename
 239114   15308    1600  256022   3e816 ath9k-old.ko

$ du -b ath9k.ko
4034244 ath9k.ko
$ du -b ath9k-old.ko
4033788 ath9k-old.ko

Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 7c5a189d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -576,8 +576,8 @@ struct ath_softc {
	struct ath_tx tx;
	struct ath_beacon beacon;
	struct ieee80211_rate rates[IEEE80211_NUM_BANDS][ATH_RATE_MAX];
	struct ath_rate_table *hw_rate_table[ATH9K_MODE_MAX];
	struct ath_rate_table *cur_rate_table;
	const struct ath_rate_table *hw_rate_table[ATH9K_MODE_MAX];
	const struct ath_rate_table *cur_rate_table;
	struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];

	struct ath_led radio_led;
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp,
	struct ath_hw *ah = sc->sc_ah;
	struct ath_desc *ds;
	struct ath9k_11n_rate_series series[4];
	struct ath_rate_table *rt;
	const struct ath_rate_table *rt;
	int flags, antenna, ctsrate = 0, ctsduration = 0;
	u8 rate;

+1 −1
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ bool ath9k_get_channel_edges(struct ath_hw *ah,
}

u16 ath9k_hw_computetxtime(struct ath_hw *ah,
			   struct ath_rate_table *rates,
			   const struct ath_rate_table *rates,
			   u32 frameLen, u16 rateix,
			   bool shortPreamble)
{
+2 −1
Original line number Diff line number Diff line
@@ -580,7 +580,8 @@ bool ath9k_hw_setantennaswitch(struct ath_hw *ah,
bool ath9k_hw_wait(struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout);
u32 ath9k_hw_reverse_bits(u32 val, u32 n);
bool ath9k_get_channel_edges(struct ath_hw *ah, u16 flags, u16 *low, u16 *high);
u16 ath9k_hw_computetxtime(struct ath_hw *ah, struct ath_rate_table *rates,
u16 ath9k_hw_computetxtime(struct ath_hw *ah,
			   const struct ath_rate_table *rates,
			   u32 frameLen, u16 rateix, bool shortPreamble);
void ath9k_hw_get_channel_centers(struct ath_hw *ah,
				  struct ath9k_channel *chan,
+1 −1
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ static u8 parse_mpdudensity(u8 mpdudensity)

static void ath_setup_rates(struct ath_softc *sc, enum ieee80211_band band)
{
	struct ath_rate_table *rate_table = NULL;
	const struct ath_rate_table *rate_table = NULL;
	struct ieee80211_supported_band *sband;
	struct ieee80211_rate *rate;
	int i, maxrates;
Loading