patches for DPDK stable branches
 help / color / mirror / Atom feed
* [23.11 1/2] log: remove per line log helper
@ 2024-12-12 13:23 David Marchand
  2024-12-12 13:23 ` [23.11 2/2] power: fix log message when checking lcore ID David Marchand
  0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2024-12-12 13:23 UTC (permalink / raw)
  To: stable, xuemingl

This looks like a rebase/backport issue.
RTE_LOG_LINE is not required in the LTS branch.
Just adapt crypto/dpaa_sec log macro.

Fixes: e56ba1eea617 ("drivers: remove redundant newline from logs")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/checkpatches.sh               |  8 --------
 drivers/crypto/dpaa_sec/dpaa_sec_log.h |  2 +-
 lib/log/rte_log.h                      | 21 ---------------------
 3 files changed, 1 insertion(+), 30 deletions(-)

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 10d1bf490b..10b79ca2bc 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -53,14 +53,6 @@ print_usage () {
 check_forbidden_additions() { # <patch>
 	res=0
 
-	# refrain from new calls to RTE_LOG
-	awk -v FOLDERS="lib" \
-		-v EXPRESSIONS="RTE_LOG\\\(" \
-		-v RET_ON_FAIL=1 \
-		-v MESSAGE='Prefer RTE_LOG_LINE' \
-		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
-		"$1" || res=1
-
 	# refrain from new additions of rte_panic() and rte_exit()
 	# multiple folders and expressions are separated by spaces
 	awk -v FOLDERS="lib drivers" \
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec_log.h b/drivers/crypto/dpaa_sec/dpaa_sec_log.h
index 82ac1fa1c4..d298ac5b57 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec_log.h
+++ b/drivers/crypto/dpaa_sec/dpaa_sec_log.h
@@ -29,7 +29,7 @@ extern int dpaa_logtype_sec;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA_SEC_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP_LINE(level, PMD, fmt, ## args)
+	RTE_LOG_DP(level, PMD, fmt "\n", ## args)
 
 #define DPAA_SEC_DP_DEBUG(fmt, args...) \
 	DPAA_SEC_DP_LOG(DEBUG, fmt, ## args)
diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index 584cea541e..f7a8405de9 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -17,7 +17,6 @@
 extern "C" {
 #endif
 
-#include <assert.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdarg.h>
@@ -359,26 +358,6 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
 		 RTE_LOGTYPE_ ## t, # t ": " __VA_ARGS__) :	\
 	 0)
 
-#if defined(RTE_TOOLCHAIN_GCC) && !defined(PEDANTIC)
-#define RTE_LOG_CHECK_NO_NEWLINE(fmt) \
-	static_assert(!__builtin_strchr(fmt, '\n'), \
-		"This log format string contains a \\n")
-#else
-#define RTE_LOG_CHECK_NO_NEWLINE(...)
-#endif
-
-#define RTE_LOG_LINE(l, t, ...) do { \
-	RTE_LOG_CHECK_NO_NEWLINE(RTE_FMT_HEAD(__VA_ARGS__ ,)); \
-	RTE_LOG(l, t, RTE_FMT(RTE_FMT_HEAD(__VA_ARGS__ ,) "\n", \
-		RTE_FMT_TAIL(__VA_ARGS__ ,))); \
-} while (0)
-
-#define RTE_LOG_DP_LINE(l, t, ...) do { \
-	RTE_LOG_CHECK_NO_NEWLINE(RTE_FMT_HEAD(__VA_ARGS__ ,)); \
-	RTE_LOG_DP(l, t, RTE_FMT(RTE_FMT_HEAD(__VA_ARGS__ ,) "\n", \
-		RTE_FMT_TAIL(__VA_ARGS__ ,))); \
-} while (0)
-
 #define RTE_LOG_REGISTER_IMPL(type, name, level)			    \
 int type;								    \
 RTE_INIT(__##type)							    \
-- 
2.47.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-12-12 14:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-12 13:23 [23.11 1/2] log: remove per line log helper David Marchand
2024-12-12 13:23 ` [23.11 2/2] power: fix log message when checking lcore ID David Marchand
2024-12-12 14:08   ` Xueming Li

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).