Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Mar 2018 11:58:27 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r330650 - head/sys/dev/mlx5/mlx5_core
Message-ID:  <201803081158.w28BwRcU095645@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu Mar  8 11:58:27 2018
New Revision: 330650
URL: https://svnweb.freebsd.org/changeset/base/330650

Log:
  Use device_printf() instead of printf() when printing warnings and errors
  to dmesg(8) in mlx5core.
  
  Submitted by:	Matthew Finlay <matt@mellanox.com>
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_core.h

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_core.h	Thu Mar  8 11:40:39 2018	(r330649)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h	Thu Mar  8 11:58:27 2018	(r330650)
@@ -49,14 +49,14 @@ do {									\
 		mlx5_core_dbg(dev, format, ##__VA_ARGS__);		\
 } while (0)
 
-#define mlx5_core_err(dev, format, ...)					\
-	printf("mlx5_core: ERR: ""%s:%s:%d:(pid %d): " format, \
-	       (dev)->priv.name, __func__, __LINE__, curthread->td_proc->p_pid, \
-	       ##__VA_ARGS__)
+#define mlx5_core_err(_dev, format, ...)					\
+	device_printf((&(_dev)->pdev->dev)->bsddev, "ERR: ""%s:%d:(pid %d): " format, \
+		__func__, __LINE__, curthread->td_proc->p_pid, \
+		##__VA_ARGS__)
 
-#define mlx5_core_warn(dev, format, ...)				\
-	printf("mlx5_core: WARN: ""%s:%s:%d:(pid %d): " format, \
-		(dev)->priv.name, __func__, __LINE__, curthread->td_proc->p_pid, \
+#define mlx5_core_warn(_dev, format, ...)				\
+	device_printf((&(_dev)->pdev->dev)->bsddev, "WARN: ""%s:%d:(pid %d): " format, \
+		__func__, __LINE__, curthread->td_proc->p_pid, \
 		##__VA_ARGS__)
 
 enum {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803081158.w28BwRcU095645>