git: f621b087c007 - main - iwlwifi: rtw88: rtw89: fix gcc warnings
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 19 Apr 2023 12:27:30 UTC
The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f621b087c00776de713944ae6561e44f83e7b541 commit f621b087c00776de713944ae6561e44f83e7b541 Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2023-04-18 19:51:09 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2023-04-19 12:21:40 +0000 iwlwifi: rtw88: rtw89: fix gcc warnings Fix -Wno-format and unused variables warnings with gcc by adopting (to|the) FreeBSD-specific code. Reported by: jhb Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D39673 --- sys/contrib/dev/iwlwifi/fw/dbg.h | 4 ++++ sys/contrib/dev/iwlwifi/iwl-debug.c | 6 +++--- sys/contrib/dev/iwlwifi/mvm/mac-ctxt.c | 4 ++++ sys/contrib/dev/iwlwifi/mvm/rx.c | 8 ++++++++ sys/contrib/dev/iwlwifi/mvm/rxmq.c | 4 ++++ sys/contrib/dev/rtw88/debug.c | 2 +- sys/contrib/dev/rtw89/debug.c | 2 +- sys/modules/iwlwifi/Makefile | 6 ------ sys/modules/rtw88/Makefile | 3 --- 9 files changed, 25 insertions(+), 14 deletions(-) diff --git a/sys/contrib/dev/iwlwifi/fw/dbg.h b/sys/contrib/dev/iwlwifi/fw/dbg.h index be7806407de8..e240ef2e1c96 100644 --- a/sys/contrib/dev/iwlwifi/fw/dbg.h +++ b/sys/contrib/dev/iwlwifi/fw/dbg.h @@ -164,7 +164,11 @@ _iwl_fw_dbg_trigger_simple_stop(struct iwl_fw_runtime *fwrt, if (!iwl_fw_dbg_trigger_check_stop(fwrt, wdev, trigger)) return; +#if defined(__linux__) iwl_fw_dbg_collect_trig(fwrt, trigger, NULL); +#elif defined(__FreeBSD__) + iwl_fw_dbg_collect_trig(fwrt, trigger, ""); +#endif } #define iwl_fw_dbg_trigger_simple_stop(fwrt, wdev, trig) \ diff --git a/sys/contrib/dev/iwlwifi/iwl-debug.c b/sys/contrib/dev/iwlwifi/iwl-debug.c index 5a9c8bc70168..010ac7b4294f 100644 --- a/sys/contrib/dev/iwlwifi/iwl-debug.c +++ b/sys/contrib/dev/iwlwifi/iwl-debug.c @@ -49,7 +49,7 @@ void __iwl_ ##fn(struct device *dev, const char *fmt, ...) \ \ va_start(args, fmt); \ vaf.va = &args; \ - vasprintf(&str, M_KMALLOC, fmt, args); \ + vasprintf(&str, M_KMALLOC, vaf.fmt, args); \ dev_ ##fn(dev, "%s", str); \ trace_iwlwifi_ ##fn(&vaf); \ free(str, M_KMALLOC); \ @@ -88,7 +88,7 @@ void __iwl_err(struct device *dev, enum iwl_err_mode mode, const char *fmt, ...) dev_err(dev, "%pV", &vaf); #elif defined(__FreeBSD__) char *str; - vasprintf(&str, M_KMALLOC, fmt, args2); + vasprintf(&str, M_KMALLOC, vaf.fmt, args2); dev_err(dev, "%s%s", (mode == IWL_ERR_MODE_RFKILL) ? "(RFKILL)" : "", str); free(str, M_KMALLOC); #endif @@ -154,7 +154,7 @@ void __iwl_dbg(struct device *dev, dev_printk(KERN_DEBUG, dev, "%s %pV", function, &vaf); #elif defined(__FreeBSD__) char *str; - vasprintf(&str, M_KMALLOC, fmt, args); + vasprintf(&str, M_KMALLOC, vaf.fmt, args); dev_printk(KERN_DEBUG, dev, "%d %u %s %s", curthread->td_tid, (unsigned int)ticks, function, str); free(str, M_KMALLOC); diff --git a/sys/contrib/dev/iwlwifi/mvm/mac-ctxt.c b/sys/contrib/dev/iwlwifi/mvm/mac-ctxt.c index 88893fade5cd..99624505c132 100644 --- a/sys/contrib/dev/iwlwifi/mvm/mac-ctxt.c +++ b/sys/contrib/dev/iwlwifi/mvm/mac-ctxt.c @@ -1438,7 +1438,11 @@ void iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm, if (rx_missed_bcon_since_rx >= stop_trig_missed_bcon_since_rx || rx_missed_bcon >= stop_trig_missed_bcon) +#if defined(__linux__) iwl_fw_dbg_collect_trig(&mvm->fwrt, trigger, NULL); +#elif defined(__FreeBSD__) + iwl_fw_dbg_collect_trig(&mvm->fwrt, trigger, ""); +#endif out: rcu_read_unlock(); diff --git a/sys/contrib/dev/iwlwifi/mvm/rx.c b/sys/contrib/dev/iwlwifi/mvm/rx.c index 72d03c5260dc..ee9249a0c5b0 100644 --- a/sys/contrib/dev/iwlwifi/mvm/rx.c +++ b/sys/contrib/dev/iwlwifi/mvm/rx.c @@ -427,7 +427,11 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi, if (rx_status->signal < rssi) iwl_fw_dbg_collect_trig(&mvm->fwrt, trig, +#if defined(__linux__) NULL); +#elif defined(__FreeBSD__) + ""); +#endif } if (!mvm->tcm.paused && len >= sizeof(*hdr) && @@ -692,7 +696,11 @@ iwl_mvm_rx_stats_check_trigger(struct iwl_mvm *mvm, struct iwl_rx_packet *pkt) if (le32_to_cpup((__le32 *) (pkt->data + trig_offset)) < trig_thold) return; +#if defined(__linux__) iwl_fw_dbg_collect_trig(&mvm->fwrt, trig, NULL); +#elif defined(__FreeBSD__) + iwl_fw_dbg_collect_trig(&mvm->fwrt, trig, ""); +#endif } static void iwl_mvm_stats_energy_iter(void *_data, diff --git a/sys/contrib/dev/iwlwifi/mvm/rxmq.c b/sys/contrib/dev/iwlwifi/mvm/rxmq.c index 7325e9d44273..872a45ea15ca 100644 --- a/sys/contrib/dev/iwlwifi/mvm/rxmq.c +++ b/sys/contrib/dev/iwlwifi/mvm/rxmq.c @@ -1958,7 +1958,11 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi, if (rx_status->signal < rssi) iwl_fw_dbg_collect_trig(&mvm->fwrt, trig, +#if defined(__linux__) NULL); +#elif defined(__FreeBSD__) + ""); +#endif } if (ieee80211_is_data(hdr->frame_control)) diff --git a/sys/contrib/dev/rtw88/debug.c b/sys/contrib/dev/rtw88/debug.c index 7b6319c07b65..fbbd11be5eef 100644 --- a/sys/contrib/dev/rtw88/debug.c +++ b/sys/contrib/dev/rtw88/debug.c @@ -1284,7 +1284,7 @@ void __rtw_dbg(struct rtw_dev *rtwdev, enum rtw_debug_mask mask, #if defined(__linux__) dev_printk(KERN_DEBUG, rtwdev->dev, "%pV", &vaf); #elif defined(__FreeBSD__) - vlog(LOG_DEBUG, fmt, args); + vlog(LOG_DEBUG, vaf.fmt, args); #endif va_end(args); diff --git a/sys/contrib/dev/rtw89/debug.c b/sys/contrib/dev/rtw89/debug.c index 1a14633c5ff7..90a15279b8f8 100644 --- a/sys/contrib/dev/rtw89/debug.c +++ b/sys/contrib/dev/rtw89/debug.c @@ -2655,7 +2655,7 @@ void __rtw89_debug(struct rtw89_dev *rtwdev, #elif defined(__FreeBSD__) { char *str; - vasprintf(&str, M_KMALLOC, fmt, args); + vasprintf(&str, M_KMALLOC, vaf.fmt, args); dev_printk(KERN_DEBUG, rtwdev->dev, "%s", str); free(str, M_KMALLOC); } diff --git a/sys/modules/iwlwifi/Makefile b/sys/modules/iwlwifi/Makefile index 39e60cb452af..831fe97847a5 100644 --- a/sys/modules/iwlwifi/Makefile +++ b/sys/modules/iwlwifi/Makefile @@ -63,10 +63,4 @@ CFLAGS+= -DCONFIG_IWLWIFI_DEVICE_TRACING=1 #CFLAGS+= -DCONFIG_THERMAL=1 #CFLAGS+= -DCONFIG_EFI=1 -# GCC warns about NULL format strings passed to iwl_fw_dbg_collect_trig -CWARNFLAGS.gcc+= -Wno-format - -# GCC warns about set but unused vaf variables -CWARNFLAGS.iwl-debug.c+= ${NO_WUNUSED_BUT_SET_VARIABLE} - .include <bsd.kmod.mk> diff --git a/sys/modules/rtw88/Makefile b/sys/modules/rtw88/Makefile index 930438a04f2c..2df00358821c 100644 --- a/sys/modules/rtw88/Makefile +++ b/sys/modules/rtw88/Makefile @@ -40,7 +40,4 @@ CFLAGS+= ${LINUXKPI_INCLUDES} CFLAGS+= -DCONFIG_RTW88_DEBUG #CFLAGS+= -DCONFIG_RTW88_DEBUGFS -# GCC warns about set but unused vaf variables -CWARNFLAGS.debug.c+= ${NO_WUNUSED_BUT_SET_VARIABLE} - .include <bsd.kmod.mk>