Linux-EDAC Archive on lore.kernel.org
 help / color / Atom feed
From: Xiaofei Tan <tanxiaofei@huawei.com>
To: <mchehab+huawei@kernel.org>, <linux-edac@vger.kernel.org>
Cc: <linuxarm@huawei.com>, <shiju.jose@huawei.com>,
	<jonathan.cameron@huawei.com>,
	Xiaofei Tan <tanxiaofei@huawei.com>
Subject: [PATCH rasdaemon 1/3] rasdaemon: delete the duplicate code about the definition of hip08 DB fields
Date: Mon, 27 Jul 2020 15:38:37 +0800
Message-ID: <1595835519-32039-2-git-send-email-tanxiaofei@huawei.com> (raw)
In-Reply-To: <1595835519-32039-1-git-send-email-tanxiaofei@huawei.com>

Delete the duplicate code about the definition of DB fields for hip08 OEM
event format1 and format2. Because the two OEM event format is the same.

Signed-off-By: Xiaofei Tan <tanxiaofei@huawei.com>
---
 non-standard-hisi_hip08.c | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)

diff --git a/non-standard-hisi_hip08.c b/non-standard-hisi_hip08.c
index 8bf10c1..7fc6939 100644
--- a/non-standard-hisi_hip08.c
+++ b/non-standard-hisi_hip08.c
@@ -504,7 +504,7 @@ static char *pcie_local_sub_module_name(uint8_t id)
 }
 
 #ifdef HAVE_SQLITE3
-static const struct db_fields hip08_oem_type1_event_fields[] = {
+static const struct db_fields hip08_oem_event_fields[] = {
 	{ .name = "id",			.type = "INTEGER PRIMARY KEY" },
 	{ .name = "timestamp",          .type = "TEXT" },
 	{ .name = "version",		.type = "INTEGER" },
@@ -519,27 +519,14 @@ static const struct db_fields hip08_oem_type1_event_fields[] = {
 
 static const struct db_table_descriptor hip08_oem_type1_event_tab = {
 	.name = "hip08_oem_type1_event_v2",
-	.fields = hip08_oem_type1_event_fields,
-	.num_fields = ARRAY_SIZE(hip08_oem_type1_event_fields),
-};
-
-static const struct db_fields hip08_oem_type2_event_fields[] = {
-	{ .name = "id",                 .type = "INTEGER PRIMARY KEY" },
-	{ .name = "timestamp",          .type = "TEXT" },
-	{ .name = "version",            .type = "INTEGER" },
-	{ .name = "soc_id",             .type = "INTEGER" },
-	{ .name = "socket_id",          .type = "INTEGER" },
-	{ .name = "nimbus_id",          .type = "INTEGER" },
-	{ .name = "module_id",          .type = "TEXT" },
-	{ .name = "sub_module_id",      .type = "TEXT" },
-	{ .name = "err_severity",       .type = "TEXT" },
-	{ .name = "regs_dump",		.type = "TEXT" },
+	.fields = hip08_oem_event_fields,
+	.num_fields = ARRAY_SIZE(hip08_oem_event_fields),
 };
 
 static const struct db_table_descriptor hip08_oem_type2_event_tab = {
 	.name = "hip08_oem_type2_event_v2",
-	.fields = hip08_oem_type2_event_fields,
-	.num_fields = ARRAY_SIZE(hip08_oem_type2_event_fields),
+	.fields = hip08_oem_event_fields,
+	.num_fields = ARRAY_SIZE(hip08_oem_event_fields),
 };
 
 static const struct db_fields hip08_pcie_local_event_fields[] = {
-- 
2.8.1


  reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27  7:38 [PATCH rasdaemon 0/3] add support for hisilicon common section decoder Xiaofei Tan
2020-07-27  7:38 ` Xiaofei Tan [this message]
2020-07-27  7:38 ` [PATCH rasdaemon 2/3] rasdaemon: delete the code of non-standard error decoder for hip07 Xiaofei Tan
2020-07-27  7:38 ` [PATCH rasdaemon 3/3] rasdaemon: add support for hisilicon common section decoder Xiaofei Tan
2020-09-01  6:31 ` [PATCH rasdaemon 0/3] " Mauro Carvalho Chehab

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=1595835519-32039-2-git-send-email-tanxiaofei@huawei.com \
    --to=tanxiaofei@huawei.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mchehab+huawei@kernel.org \
    --cc=shiju.jose@huawei.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

Linux-EDAC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-edac/0 linux-edac/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-edac linux-edac/ https://lore.kernel.org/linux-edac \
		linux-edac@vger.kernel.org
	public-inbox-index linux-edac

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-edac


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git