wifi: brcmfmac: fix gnu_printf warnings
authorKalle Valo <kvalo@kernel.org>
Tue, 13 Jun 2023 14:09:15 +0000 (17:09 +0300)
committerKalle Valo <kvalo@kernel.org>
Fri, 16 Jun 2023 09:24:15 +0000 (12:24 +0300)
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>
Link: https://lore.kernel.org/r/20230613140918.389690-2-kvalo@kernel.org
drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.h

index 5a139d7ed47aac4f744b27892b137e1c0b77c98c..5d66e94c806d59a56cc9920655c4e9a233e2cc53 100644 (file)
@@ -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