net/zxdh: remove redundant log prefix

Message ID 20241106090800.817227-1-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/zxdh: remove redundant log prefix |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation warning apply patch failure
ci/Intel-compilation warning apply issues
ci/iol-testing warning apply patch failure

Commit Message

David Marchand Nov. 6, 2024, 9:08 a.m. UTC
By using RTE_LOG*() macros, the log messages are prefixed by the logtype.

RTE_LOG_LINE_PREFIX(level, ZXDH_RX, "zxdh rx %s(): ", ...
will emit messages like "ZXDH_RX: zxdh rx %s(): ...\n"

There is no need to add a prefix repeating the same information.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Note: this is not a big issue, but can this be squashed in relevant
commit in next-net before reaching main? Thanks.

---
 drivers/net/zxdh/zxdh_logs.h | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
  

Comments

Junlong Wang Nov. 6, 2024, 9:41 a.m. UTC | #1
Hi, David,
    Sorry, my negligence caused this issue.
    Thank you for helping with the modifications.
  
Ferruh Yigit Nov. 6, 2024, 10:29 a.m. UTC | #2
On 11/6/2024 9:08 AM, David Marchand wrote:
> By using RTE_LOG*() macros, the log messages are prefixed by the logtype.
> 
> RTE_LOG_LINE_PREFIX(level, ZXDH_RX, "zxdh rx %s(): ", ...
> will emit messages like "ZXDH_RX: zxdh rx %s(): ...\n"
> 
> There is no need to add a prefix repeating the same information.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> Note: this is not a big issue, but can this be squashed in relevant
> commit in next-net before reaching main? Thanks.
>

Squashed into relevant commit in next-net, thanks.
  

Patch

diff --git a/drivers/net/zxdh/zxdh_logs.h b/drivers/net/zxdh/zxdh_logs.h
index 53838e313b..ad864a2089 100644
--- a/drivers/net/zxdh/zxdh_logs.h
+++ b/drivers/net/zxdh/zxdh_logs.h
@@ -10,25 +10,21 @@ 
 extern int zxdh_logtype_driver;
 #define RTE_LOGTYPE_ZXDH_DRIVER zxdh_logtype_driver
 #define PMD_DRV_LOG(level, ...) \
-	RTE_LOG_LINE_PREFIX(level, ZXDH_DRIVER, "zxdh %s(): ", \
-		__func__, __VA_ARGS__)
+	RTE_LOG_LINE_PREFIX(level, ZXDH_DRIVER, "%s(): ", __func__, __VA_ARGS__)
 
 extern int zxdh_logtype_rx;
 #define RTE_LOGTYPE_ZXDH_RX zxdh_logtype_rx
 #define PMD_RX_LOG(level, ...) \
-	RTE_LOG_LINE_PREFIX(level, ZXDH_RX, "zxdh rx %s(): ", \
-		__func__, __VA_ARGS__)
+	RTE_LOG_LINE_PREFIX(level, ZXDH_RX, "%s(): ", __func__, __VA_ARGS__)
 
 extern int zxdh_logtype_tx;
 #define RTE_LOGTYPE_ZXDH_TX zxdh_logtype_tx
 #define PMD_TX_LOG(level, ...) \
-	RTE_LOG_LINE_PREFIX(level, ZXDH_TX, "zxdh tx %s(): ", \
-		__func__, __VA_ARGS__)
+	RTE_LOG_LINE_PREFIX(level, ZXDH_TX, "%s(): ", __func__, __VA_ARGS__)
 
 extern int zxdh_logtype_msg;
 #define RTE_LOGTYPE_ZXDH_MSG zxdh_logtype_msg
 #define PMD_MSG_LOG(level, ...) \
-	RTE_LOG_LINE_PREFIX(level, ZXDH_MSG, "zxdh msg %s(): ", \
-		__func__, __VA_ARGS__)
+	RTE_LOG_LINE_PREFIX(level, ZXDH_MSG, "%s(): ", __func__, __VA_ARGS__)
 
 #endif /* ZXDH_LOGS_H */