Johannes Berg <johannes@xxxxxxxxxxxxxxxx> writes: > On Thu, 2019-09-19 at 14:22 +0200, Toke Høiland-Jørgensen wrote: > > Given a ULL constant: > >> +/* constants for calculating reciprocals to avoid division in fast path */ >> +#define IEEE80211_RECIPROCAL_DIVISOR 0x100000000ULL > > [...] > >> +void ieee80211_sta_set_last_tx_bitrate(struct ieee80211_sta *pubsta, >> + u32 rate) >> +{ >> + struct sta_info *sta = container_of(pubsta, struct sta_info, sta); >> + >> + sta->last_tx_bitrate = rate; >> + sta->last_tx_bitrate_reciprocal = ((u64)IEEE80211_RECIPROCAL_DIVISOR / rate); > > that cast seems unnecessary? Yeah. I only remembered to make it a ULL constant later, and forgot to remove the cast. But I guess this should be using do_div() anyway... -Toke