diff mbox series

[1/4] wifi: brcmfmac: fix gnu_printf warnings

Message ID 20230613140918.389690-2-kvalo@kernel.org (mailing list archive)
State Accepted
Commit 56714e5f1255fc318b65b6b338a0d8ebc44c920c
Delegated to: Kalle Valo
Headers show
Series wifi: drivers: fix remaining W=1 warnings | expand

Commit Message

Kalle Valo June 13, 2023, 2:09 p.m. UTC
With GCC 13.1 and W=1 brcmfmac has warnings like this:

./include/trace/perf.h:26:16: warning: function 'perf_trace_brcmf_dbg' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]

Add a workaround which disables -Wsuggest-attribute=format in tracepoint.h. I
see similar workarounds in other drivers as well.

Compile tested only.

Signed-off-by: Kalle Valo <kvalo@kernel.org>
---
 .../net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.h  | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Kalle Valo June 16, 2023, 9:26 a.m. UTC | #1
Kalle Valo <kvalo@kernel.org> wrote:

> With GCC 13.1 and W=1 brcmfmac has warnings like this:
> 
> ./include/trace/perf.h:26:16: warning: function 'perf_trace_brcmf_dbg' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
> 
> Add a workaround which disables -Wsuggest-attribute=format in tracepoint.h. I
> see similar workarounds in other drivers as well.
> 
> Compile tested only.
> 
> Signed-off-by: Kalle Valo <kvalo@kernel.org>

4 patches applied to wireless-next.git, thanks.

56714e5f1255 wifi: brcmfmac: fix gnu_printf warnings
4b6ec74ec476 wifi: brcmsmac: fix gnu_printf warnings
5ea0c3130900 wifi: hostap: fix stringop-truncations GCC warning
707a13c7e488 wifi: ray_cs: fix stringop-truncation GCC warning
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.h
index 5a139d7ed47a..5d66e94c806d 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.h
@@ -28,6 +28,11 @@  static inline void trace_ ## name(proto) {}
 
 #define MAX_MSG_LEN		100
 
+#pragma GCC diagnostic push
+#ifndef __clang__
+#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
+#endif
+
 TRACE_EVENT(brcmf_err,
 	TP_PROTO(const char *func, struct va_format *vaf),
 	TP_ARGS(func, vaf),
@@ -123,6 +128,8 @@  TRACE_EVENT(brcmf_sdpcm_hdr,
 		  __entry->len, ((u8 *)__get_dynamic_array(hdr))[4])
 );
 
+#pragma GCC diagnostic pop
+
 #ifdef CONFIG_BRCM_TRACING
 
 #undef TRACE_INCLUDE_PATH