nfit: Get rid of CONFIG_ACPI_NFIT_DEBUG
diff mbox

Message ID 1469699369-70824-1-git-send-email-jthumshirn@suse.de
State Under Review
Headers show

Commit Message

Johannes Thumshirn July 28, 2016, 9:49 a.m. UTC
CONFIG_ACPI_NFIT_DEBUG is currently used to dump the buffers used in NFIT _DSM
calls. Within the statements guarded by CONFIG_ACPI_NFIT_DEBUG we use dynamic
debugging as well as print_hex_dump_debug(). Change the print_hex_dump_debug()
call to dynamic_hex_dump() so we can enable it on demand and at runtime, not
dependend on a compile time option.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 drivers/acpi/Kconfig | 12 ------------
 drivers/acpi/nfit.c  | 28 +++++++++++++---------------
 2 files changed, 13 insertions(+), 27 deletions(-)

Comments

Dan Williams July 28, 2016, 3:06 p.m. UTC | #1
On Thu, Jul 28, 2016 at 2:49 AM, Johannes Thumshirn <jthumshirn@suse.de> wrote:
> CONFIG_ACPI_NFIT_DEBUG is currently used to dump the buffers used in NFIT _DSM
> calls. Within the statements guarded by CONFIG_ACPI_NFIT_DEBUG we use dynamic
> debugging as well as print_hex_dump_debug(). Change the print_hex_dump_debug()
> call to dynamic_hex_dump() so we can enable it on demand and at runtime, not
> dependend on a compile time option.
>
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> ---

Looks good to me, not sure how I missed dynamic_hex_dump() in the first place.

Patch
diff mbox

diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index b7e2e77..659fb1c 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -462,18 +462,6 @@  config ACPI_NFIT
 	  To compile this driver as a module, choose M here:
 	  the module will be called nfit.
 
-config ACPI_NFIT_DEBUG
-	bool "NFIT DSM debug"
-	depends on ACPI_NFIT
-	depends on DYNAMIC_DEBUG
-	default n
-	help
-	  Enabling this option causes the nfit driver to dump the
-	  input and output buffers of _DSM operations on the ACPI0012
-	  device and its children.  This can be very verbose, so leave
-	  it disabled unless you are debugging a hardware / firmware
-	  issue.
-
 source "drivers/acpi/apei/Kconfig"
 
 config ACPI_EXTLOG
diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index 1f0e060..ddff49d 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -246,14 +246,13 @@  static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc,
 		in_buf.buffer.length = call_pkg->nd_size_in;
 	}
 
-	if (IS_ENABLED(CONFIG_ACPI_NFIT_DEBUG)) {
-		dev_dbg(dev, "%s:%s cmd: %d: func: %d input length: %d\n",
-				__func__, dimm_name, cmd, func,
-				in_buf.buffer.length);
-		print_hex_dump_debug("nvdimm in  ", DUMP_PREFIX_OFFSET, 4, 4,
-			in_buf.buffer.pointer,
-			min_t(u32, 256, in_buf.buffer.length), true);
-	}
+	dev_dbg(dev, "%s:%s cmd: %d: func: %d input length: %d\n",
+		__func__, dimm_name, cmd, func,
+		in_buf.buffer.length);
+
+	dynamic_hex_dump("nvdimm in  ", DUMP_PREFIX_OFFSET, 4, 4,
+			     in_buf.buffer.pointer,
+			     min_t(u32, 256, in_buf.buffer.length), true);
 
 	out_obj = acpi_evaluate_dsm(handle, uuid, 1, func, &in_obj);
 	if (!out_obj) {
@@ -285,13 +284,12 @@  static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc,
 		goto out;
 	}
 
-	if (IS_ENABLED(CONFIG_ACPI_NFIT_DEBUG)) {
-		dev_dbg(dev, "%s:%s cmd: %s output length: %d\n", __func__,
-				dimm_name, cmd_name, out_obj->buffer.length);
-		print_hex_dump_debug(cmd_name, DUMP_PREFIX_OFFSET, 4,
-				4, out_obj->buffer.pointer, min_t(u32, 128,
-					out_obj->buffer.length), true);
-	}
+	dev_dbg(dev, "%s:%s cmd: %s output length: %d\n", __func__,
+		dimm_name, cmd_name, out_obj->buffer.length);
+
+	dynamic_hex_dump(cmd_name, DUMP_PREFIX_OFFSET, 4,
+			     4, out_obj->buffer.pointer,
+			     min_t(u32, 128, out_obj->buffer.length), true);
 
 	for (i = 0, offset = 0; i < desc->out_num; i++) {
 		u32 out_size = nd_cmd_out_size(nvdimm, cmd, desc, i, buf,