|
|
f877e3 |
From 9c7db76f373a1d25e52177b81e97bb9e0f9c32b5 Mon Sep 17 00:00:00 2001
|
|
|
f877e3 |
From: Jean Delvare <jdelvare@suse.de>
|
|
|
f877e3 |
Date: Wed, 1 Apr 2020 10:00:33 +0200
|
|
|
f877e3 |
Subject: [PATCH 18/23] dmidecode: Add helper function for separators
|
|
|
f877e3 |
|
|
|
f877e3 |
A simple helper function to print a blank line between records.
|
|
|
f877e3 |
|
|
|
f877e3 |
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
f877e3 |
---
|
|
|
f877e3 |
dmidecode.c | 9 +++++----
|
|
|
f877e3 |
dmioutput.c | 5 +++++
|
|
|
f877e3 |
dmioutput.h | 1 +
|
|
|
f877e3 |
3 files changed, 11 insertions(+), 4 deletions(-)
|
|
|
f877e3 |
|
|
|
f877e3 |
diff --git a/dmidecode.c b/dmidecode.c
|
|
|
f877e3 |
index 5e9b9899ec1f..3551637e7b16 100644
|
|
|
f877e3 |
--- a/dmidecode.c
|
|
|
f877e3 |
+++ b/dmidecode.c
|
|
|
f877e3 |
@@ -5068,7 +5068,7 @@ static void dmi_decode(const struct dmi_header *h, u16 ver)
|
|
|
f877e3 |
h->type >= 128 ? "OEM-specific" : "Unknown");
|
|
|
f877e3 |
dmi_dump(h);
|
|
|
f877e3 |
}
|
|
|
f877e3 |
- printf("\n");
|
|
|
f877e3 |
+ pr_sep();
|
|
|
f877e3 |
}
|
|
|
f877e3 |
|
|
|
f877e3 |
static void to_dmi_header(struct dmi_header *h, u8 *data)
|
|
|
f877e3 |
@@ -5195,7 +5195,8 @@ static void dmi_table_decode(u8 *buf, u32 len, u16 num, u16 ver, u32 flags)
|
|
|
f877e3 |
if ((unsigned long)(next - buf) > len)
|
|
|
f877e3 |
{
|
|
|
f877e3 |
if (display && !(opt.flags & FLAG_QUIET))
|
|
|
f877e3 |
- printf("\t<TRUNCATED>\n\n");
|
|
|
f877e3 |
+ printf("\t<TRUNCATED>\n");
|
|
|
f877e3 |
+ pr_sep();
|
|
|
f877e3 |
data = next;
|
|
|
f877e3 |
break;
|
|
|
f877e3 |
}
|
|
|
f877e3 |
@@ -5213,7 +5214,7 @@ static void dmi_table_decode(u8 *buf, u32 len, u16 num, u16 ver, u32 flags)
|
|
|
f877e3 |
if (opt.flags & FLAG_DUMP)
|
|
|
f877e3 |
{
|
|
|
f877e3 |
dmi_dump(&h);
|
|
|
f877e3 |
- printf("\n");
|
|
|
f877e3 |
+ pr_sep();
|
|
|
f877e3 |
}
|
|
|
f877e3 |
else
|
|
|
f877e3 |
dmi_decode(&h, ver);
|
|
|
f877e3 |
@@ -5271,7 +5272,7 @@ static void dmi_table(off_t base, u32 len, u16 num, u32 ver, const char *devmem,
|
|
|
f877e3 |
pr_info("Table at 0x%08llX.",
|
|
|
f877e3 |
(unsigned long long)base);
|
|
|
f877e3 |
}
|
|
|
f877e3 |
- printf("\n");
|
|
|
f877e3 |
+ pr_sep();
|
|
|
f877e3 |
}
|
|
|
f877e3 |
|
|
|
f877e3 |
if ((flags & FLAG_NO_FILE_OFFSET) || (opt.flags & FLAG_FROM_DUMP))
|
|
|
f877e3 |
diff --git a/dmioutput.c b/dmioutput.c
|
|
|
f877e3 |
index da04450494f7..ef1c41b2f94e 100644
|
|
|
f877e3 |
--- a/dmioutput.c
|
|
|
f877e3 |
+++ b/dmioutput.c
|
|
|
f877e3 |
@@ -118,3 +118,8 @@ void pr_list_end(void)
|
|
|
f877e3 |
{
|
|
|
f877e3 |
/* a no-op for text output */
|
|
|
f877e3 |
}
|
|
|
f877e3 |
+
|
|
|
f877e3 |
+void pr_sep(void)
|
|
|
f877e3 |
+{
|
|
|
f877e3 |
+ printf("\n");
|
|
|
f877e3 |
+}
|
|
|
f877e3 |
diff --git a/dmioutput.h b/dmioutput.h
|
|
|
f877e3 |
index 58ca5a854a79..6b5f0e0e92c5 100644
|
|
|
f877e3 |
--- a/dmioutput.h
|
|
|
f877e3 |
+++ b/dmioutput.h
|
|
|
f877e3 |
@@ -30,3 +30,4 @@ void pr_subattr(const char *name, const char *format, ...);
|
|
|
f877e3 |
void pr_list_start(const char *name, const char *format, ...);
|
|
|
f877e3 |
void pr_list_item(const char *format, ...);
|
|
|
f877e3 |
void pr_list_end(void);
|
|
|
f877e3 |
+void pr_sep(void);
|
|
|
f877e3 |
--
|
|
|
f877e3 |
2.17.1
|
|
|
f877e3 |
|