|
|
dfabe0 |
From d37eed24b07da16719ce969f119b4c636e0e2d96 Mon Sep 17 00:00:00 2001
|
|
|
dfabe0 |
From: Jean Delvare <jdelvare@suse.de>
|
|
|
dfabe0 |
Date: Wed, 1 Apr 2020 09:51:57 +0200
|
|
|
dfabe0 |
Subject: [PATCH 12/23] dmidecode: Add helper function pr_handle
|
|
|
dfabe0 |
|
|
|
dfabe0 |
Print the handle information through a helper function pr_handle.
|
|
|
dfabe0 |
|
|
|
dfabe0 |
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
dfabe0 |
---
|
|
|
dfabe0 |
dmidecode.c | 3 +--
|
|
|
dfabe0 |
dmioutput.c | 6 ++++++
|
|
|
dfabe0 |
dmioutput.h | 3 +++
|
|
|
dfabe0 |
3 files changed, 10 insertions(+), 2 deletions(-)
|
|
|
dfabe0 |
|
|
|
dfabe0 |
diff --git a/dmidecode.c b/dmidecode.c
|
|
|
dfabe0 |
index e3f6e300efc2..8ba8d078614e 100644
|
|
|
dfabe0 |
--- a/dmidecode.c
|
|
|
dfabe0 |
+++ b/dmidecode.c
|
|
|
dfabe0 |
@@ -5212,8 +5212,7 @@ static void dmi_table_decode(u8 *buf, u32 len, u16 num, u16 ver, u32 flags)
|
|
|
dfabe0 |
|
|
|
dfabe0 |
if (display
|
|
|
dfabe0 |
&& (!(opt.flags & FLAG_QUIET) || (opt.flags & FLAG_DUMP)))
|
|
|
dfabe0 |
- printf("Handle 0x%04X, DMI type %d, %d bytes\n",
|
|
|
dfabe0 |
- h.handle, h.type, h.length);
|
|
|
dfabe0 |
+ pr_handle(&h);
|
|
|
dfabe0 |
|
|
|
dfabe0 |
/* Look for the next handle */
|
|
|
dfabe0 |
next = data + h.length;
|
|
|
dfabe0 |
diff --git a/dmioutput.c b/dmioutput.c
|
|
|
dfabe0 |
index e702f114bb4a..ad3b0398c446 100644
|
|
|
dfabe0 |
--- a/dmioutput.c
|
|
|
dfabe0 |
+++ b/dmioutput.c
|
|
|
dfabe0 |
@@ -43,3 +43,9 @@ void pr_info(const char *format, ...)
|
|
|
dfabe0 |
va_end(args);
|
|
|
dfabe0 |
printf("\n");
|
|
|
dfabe0 |
}
|
|
|
dfabe0 |
+
|
|
|
dfabe0 |
+void pr_handle(const struct dmi_header *h)
|
|
|
dfabe0 |
+{
|
|
|
dfabe0 |
+ printf("Handle 0x%04X, DMI type %d, %d bytes\n",
|
|
|
dfabe0 |
+ h->handle, h->type, h->length);
|
|
|
dfabe0 |
+}
|
|
|
dfabe0 |
diff --git a/dmioutput.h b/dmioutput.h
|
|
|
dfabe0 |
index 0dd8f0811934..6ef60f0ee3cd 100644
|
|
|
dfabe0 |
--- a/dmioutput.h
|
|
|
dfabe0 |
+++ b/dmioutput.h
|
|
|
dfabe0 |
@@ -19,5 +19,8 @@
|
|
|
dfabe0 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
dfabe0 |
*/
|
|
|
dfabe0 |
|
|
|
dfabe0 |
+#include "dmidecode.h"
|
|
|
dfabe0 |
+
|
|
|
dfabe0 |
void pr_comment(const char *format, ...);
|
|
|
dfabe0 |
void pr_info(const char *format, ...);
|
|
|
dfabe0 |
+void pr_handle(const struct dmi_header *h);
|
|
|
dfabe0 |
--
|
|
|
dfabe0 |
2.17.1
|
|
|
dfabe0 |
|