All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Linux NVDIMM Mailing List <linux-nvdimm@lists.01.org>
Subject: [PATCH] nfit: Get rid of CONFIG_ACPI_NFIT_DEBUG
Date: Thu, 28 Jul 2016 11:49:29 +0200	[thread overview]
Message-ID: <1469699369-70824-1-git-send-email-jthumshirn@suse.de> (raw)

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

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,
-- 
1.8.5.6

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

             reply	other threads:[~2016-07-28  9:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28  9:49 Johannes Thumshirn [this message]
2016-07-28 15:06 ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469699369-70824-1-git-send-email-jthumshirn@suse.de \
    --to=jthumshirn@suse.de \
    --cc=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    --subject='Re: [PATCH] nfit: Get rid of CONFIG_ACPI_NFIT_DEBUG' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.