public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Erik Schmauss <erik.schmauss@intel.com>
To: "Rafael J . Wysocki" <rafael@kernel.org>, linux-acpi@vger.kernel.org
Cc: Erik Schmauss <erik.schmauss@intel.com>,
	Bob Moore <robert.moore@intel.com>
Subject: [PATCH 06/12] ACPICA: utilities: add flag to only display data when dumping buffers
Date: Thu, 24 Oct 2019 11:55:50 -0700	[thread overview]
Message-ID: <20191024185556.4606-7-erik.schmauss@intel.com> (raw)
In-Reply-To: <20191024185556.4606-1-erik.schmauss@intel.com>

ACPICA commit fb18935fcf940c5854a055975c6b9ee31f0e1a5a

Link: https://github.com/acpica/acpica/commit/fb18935f
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/acutils.h  |  9 +++---
 drivers/acpi/acpica/utbuffer.c | 52 +++++++++++++++++++---------------
 2 files changed, 34 insertions(+), 27 deletions(-)

diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index 601808be86d1..5fb50634e08e 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -142,10 +142,11 @@ struct acpi_pkg_info {
 
 /* acpi_ut_dump_buffer */
 
-#define DB_BYTE_DISPLAY     1
-#define DB_WORD_DISPLAY     2
-#define DB_DWORD_DISPLAY    4
-#define DB_QWORD_DISPLAY    8
+#define DB_BYTE_DISPLAY      0x01
+#define DB_WORD_DISPLAY      0x02
+#define DB_DWORD_DISPLAY     0x04
+#define DB_QWORD_DISPLAY     0x08
+#define DB_DISPLAY_DATA_ONLY 0x10
 
 /*
  * utascii - ASCII utilities
diff --git a/drivers/acpi/acpica/utbuffer.c b/drivers/acpi/acpica/utbuffer.c
index 61db9967ebe4..db897af1de05 100644
--- a/drivers/acpi/acpica/utbuffer.c
+++ b/drivers/acpi/acpica/utbuffer.c
@@ -37,7 +37,9 @@ void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 base_offset)
 	u32 j;
 	u32 temp32;
 	u8 buf_char;
+	u32 display_data_only = display & DB_DISPLAY_DATA_ONLY;
 
+	display &= ~DB_DISPLAY_DATA_ONLY;
 	if (!buffer) {
 		acpi_os_printf("Null Buffer Pointer in DumpBuffer!\n");
 		return;
@@ -53,7 +55,9 @@ void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 base_offset)
 
 		/* Print current offset */
 
-		acpi_os_printf("%8.4X: ", (base_offset + i));
+		if (!display_data_only) {
+			acpi_os_printf("%8.4X: ", (base_offset + i));
+		}
 
 		/* Print 16 hex chars */
 
@@ -109,32 +113,34 @@ void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 base_offset)
 		 * Print the ASCII equivalent characters but watch out for the bad
 		 * unprintable ones (printable chars are 0x20 through 0x7E)
 		 */
-		acpi_os_printf(" ");
-		for (j = 0; j < 16; j++) {
-			if (i + j >= count) {
-				acpi_os_printf("\n");
-				return;
+		if (!display_data_only) {
+			acpi_os_printf(" ");
+			for (j = 0; j < 16; j++) {
+				if (i + j >= count) {
+					acpi_os_printf("\n");
+					return;
+				}
+
+				/*
+				 * Add comment characters so rest of line is ignored when
+				 * compiled
+				 */
+				if (j == 0) {
+					acpi_os_printf("// ");
+				}
+
+				buf_char = buffer[(acpi_size)i + j];
+				if (isprint(buf_char)) {
+					acpi_os_printf("%c", buf_char);
+				} else {
+					acpi_os_printf(".");
+				}
 			}
 
-			/*
-			 * Add comment characters so rest of line is ignored when
-			 * compiled
-			 */
-			if (j == 0) {
-				acpi_os_printf("// ");
-			}
+			/* Done with that line. */
 
-			buf_char = buffer[(acpi_size)i + j];
-			if (isprint(buf_char)) {
-				acpi_os_printf("%c", buf_char);
-			} else {
-				acpi_os_printf(".");
-			}
+			acpi_os_printf("\n");
 		}
-
-		/* Done with that line. */
-
-		acpi_os_printf("\n");
 		i += 16;
 	}
 
-- 
2.21.0


  parent reply	other threads:[~2019-10-24 19:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24 18:55 [PATCH 00/12] ACPICA version 20191018 Erik Schmauss
2019-10-24 18:55 ` [PATCH 01/12] ACPICA: Results from Clang changes/fixes From Clang V5.0.1. Mostly "set but never read" warnings Erik Schmauss
2019-10-24 18:55 ` [PATCH 02/12] ACPICA: Win OSL: Replace get_tick_count with get_tick_count64 Erik Schmauss
2019-10-24 18:55 ` [PATCH 03/12] ACPICA: More Clang changes - V8.0.1 Fixed all "dead assignment" warnings Erik Schmauss
2019-10-24 18:55 ` [PATCH 04/12] ACPICA: Add new external interface, acpi_unload_table Erik Schmauss
2019-10-24 18:55 ` [PATCH 05/12] ACPICA: make acpi_load_table() return table index Erik Schmauss
2019-10-25  8:19   ` Andy Shevchenko
2019-10-25  8:22     ` Rafael J. Wysocki
2019-10-24 18:55 ` Erik Schmauss [this message]
2019-10-24 18:55 ` [PATCH 07/12] ACPICA: Debugger: add command to dump all fields of a particular subtype Erik Schmauss
2019-10-27 20:57   ` kbuild test robot
2019-10-27 21:33   ` kbuild test robot
2019-10-24 18:55 ` [PATCH 08/12] ACPICA: debugger: surround field unit output with braces '{' Erik Schmauss
2019-10-24 18:55 ` [PATCH 09/12] ACPICA: debugger: add field unit support for acpi_db_get_next_token Erik Schmauss
2019-10-24 18:55 ` [PATCH 10/12] ACPICA: acpiexec: initialize all simple types and field units from user input Erik Schmauss
2019-10-24 18:55 ` [PATCH 11/12] ACPICA: debugger: remove leading whitespaces when converting a string to a buffer Erik Schmauss
2019-10-24 18:55 ` [PATCH 12/12] ACPICA: Update version to 20191018 Erik Schmauss
2019-10-25  9:19 ` [PATCH 00/12] ACPICA version 20191018 Rafael J. Wysocki
2019-10-25 17:08   ` Schmauss, Erik
2019-10-28 15:08     ` Rafael J. Wysocki

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=20191024185556.4606-7-erik.schmauss@intel.com \
    --to=erik.schmauss@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robert.moore@intel.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox