On 13/03/2024 05:53, Ping-Ke Shih wrote: > On Wed, 2024-03-13 at 01:21 +0200, Bitterblue Smith wrote: > >> > >> rtl92d_dm_check_txpower_tracking_thermal_meter() is actually >> unused in rtl8192de. Should I just delete it? >> >> I don't remember why I made it static, but that introduced >> a warning. > > > I feel we can set rtlpriv->dm.txpower_tracking = false, and then uncomment > /* rtl92d_dm_check_txpower_tracking_thermal_meter(hw); */ > That sounds good. > > More, this function appears twice: > > $ git grep rtl92d_dm_check_txpower_tracking_thermal_meter > rtl8192de/dm.c:static void rtl92d_dm_check_txpower_tracking_thermal_meter(struct ieee80211_hw *hw) > rtl8192de/dm.c: /* rtl92d_dm_check_txpower_tracking_thermal_meter(hw); */ > rtl8192du/dm.c:void rtl92d_dm_check_txpower_tracking_thermal_meter(struct ieee80211_hw *hw) > rtl8192du/dm.c: rtl92d_dm_check_txpower_tracking_thermal_meter(hw); > > I suppose you should move rtl92d_dm_check_txpower_tracking_thermal_meter() > to dm_common.c. > I didn't move the TX power tracking to dm_common.c because it calls two functions which are different in the PCI driver and the out-of-tree USB driver. (The USB driver is a few years newer.) * rtl92d_phy_lc_calibrate() * rtl92d_phy_iq_calibrate() I suppose if rtl92d_dm_check_txpower_tracking_thermal_meter() takes two function pointers, it can be moved: void rtl92d_dm_check_txpower_tracking_thermal_meter(struct ieee80211_hw *hw, void (*lc_calibrate)(struct ieee80211_hw *hw), void (*iq_calibrate)(struct ieee80211_hw *hw)) Or, struct rtl_hal_ops already has phy_lc_calibrate member. I could add phy_iq_calibrate too.