backports.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: backports@vger.kernel.org
Subject: [PATCH 4/8] headers: add __vstring and __assign_vstr
Date: Thu, 13 Oct 2022 10:53:47 +0200	[thread overview]
Message-ID: <20221013085351.14516-4-nbd@nbd.name> (raw)
In-Reply-To: <20221013085351.14516-1-nbd@nbd.name>

Used within tracepoints on a few drivers

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 backport/backport-include/trace/trace_events.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 backport/backport-include/trace/trace_events.h

diff --git a/backport/backport-include/trace/trace_events.h b/backport/backport-include/trace/trace_events.h
new file mode 100644
index 000000000000..fd6a4f3c343d
--- /dev/null
+++ b/backport/backport-include/trace/trace_events.h
@@ -0,0 +1,16 @@
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(6,0,0)
+#undef VSTRING_MSG_MAX
+#define VSTRING_MSG_MAX	512
+
+#undef __vstring
+#define __vstring(msg, fmt, va) __dynamic_array(char, msg, VSTRING_MSG_MAX)
+
+#undef __assign_vstr
+#define __assign_vstr(msg, fmt, va)					  \
+	WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), VSTRING_MSG_MAX, \
+			       fmt, *va) >= VSTRING_MSG_MAX)
+#endif /* <6.0 */
+
+#include_next <trace/trace_events.h>
-- 
2.36.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

  parent reply	other threads:[~2022-10-13  8:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13  8:53 [PATCH 1/8] headers: backport napi add functions Felix Fietkau
2022-10-13  8:53 ` [PATCH 2/8] headers: backport usb_maxpacket api change Felix Fietkau
2022-10-13  8:53 ` [PATCH 3/8] headers: add txq_trans_cond_update Felix Fietkau
2022-10-13  8:53 ` Felix Fietkau [this message]
2022-10-13  8:53 ` [PATCH 5/8] headers: backport mmc_sw_reset and mmc_hw_reset API changes Felix Fietkau
2022-10-13  8:53 ` [PATCH 6/8] headers: add DEFINE_SIMPLE_DEV_PM_OPS Felix Fietkau
2022-10-13  8:53 ` [PATCH 7/8] headers: backport device_get_mac_address api change Felix Fietkau
2022-10-13  8:53 ` [PATCH 8/8] headers: add skb_tcp_all_headers Felix Fietkau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221013085351.14516-4-nbd@nbd.name \
    --to=nbd@nbd.name \
    --cc=backports@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).