lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 11 Sep 2018 15:49:54 -0600
From:   Mathieu Poirier <mathieu.poirier@...aro.org>
To:     linux-arm-kernel@...ts.infradead.org
Cc:     alexander.shishkin@...ux.intel.com, suzuki.poulose@....com,
        gregkh@...uxfoundation.org, kim.phillips@....com,
        leo.yan@...aro.org, linux-kernel@...r.kernel.org
Subject: [PATCH 4/5] coresight: Define macro to replace dev_dbg() boiler plate code

Using a macro is much better than repeating the same code everywhere
in the drivers.  That way it is easy to keep debug output messages
confined to the sysFS mode of operation.

Signed-off-by: Mathieu Poirier <mathieu.poirier@...aro.org>
---
 drivers/hwtracing/coresight/coresight-priv.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h
index acfe67646a05..8a7a197cba69 100644
--- a/drivers/hwtracing/coresight/coresight-priv.h
+++ b/drivers/hwtracing/coresight/coresight-priv.h
@@ -7,6 +7,7 @@
 #define _CORESIGHT_PRIV_H
 
 #include <linux/bitops.h>
+#include <linux/device.h>
 #include <linux/io.h>
 #include <linux/coresight.h>
 #include <linux/pm_runtime.h>
@@ -74,6 +75,12 @@ enum cs_mode {
 	CS_MODE_PERF,
 };
 
+#define coresight_dev_dbg(dev, mode, format, ...)	\
+do {							\
+	if (mode == CS_MODE_SYSFS)			\
+		dev_dbg(dev, format, ##__VA_ARGS__);	\
+} while (0)
+
 /**
  * struct cs_buffer - keep track of a recording session' specifics
  * @cur:	index of the current buffer
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ