From: Xiaofei Tan <tanxiaofei@huawei.com>
To: <mchehab@kernel.org>, <linux-edac@vger.kernel.org>
Cc: Xiaofei Tan <tanxiaofei@huawei.com>, <linuxarm@huawei.com>,
<shiju.jose@huawei.com>, <jonathan.cameron@huawei.com>
Subject: [PATCH v2 8/9] rasdaemon: fix case style issues for enum constant
Date: Tue, 26 Nov 2019 20:12:35 +0800 [thread overview]
Message-ID: <1574770356-129510-9-git-send-email-tanxiaofei@huawei.com> (raw)
In-Reply-To: <1574770356-129510-1-git-send-email-tanxiaofei@huawei.com>
Change lowercase letters of enum constant to uppercase ones.
Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
---
non-standard-hisi_hip08.c | 192 +++++++++++++++++++++++-----------------------
1 file changed, 96 insertions(+), 96 deletions(-)
diff --git a/non-standard-hisi_hip08.c b/non-standard-hisi_hip08.c
index 3ac5a70..f8f8e1d 100644
--- a/non-standard-hisi_hip08.c
+++ b/non-standard-hisi_hip08.c
@@ -144,50 +144,50 @@ struct hisi_pcie_local_err_sec {
};
enum hisi_oem_data_type {
- hisi_oem_data_type_int,
- hisi_oem_data_type_int64,
- hisi_oem_data_type_text,
+ HISI_OEM_DATA_TYPE_INT,
+ HISI_OEM_DATA_TYPE_INT64,
+ HISI_OEM_DATA_TYPE_TEXT,
};
enum {
- hip08_oem_type1_field_id,
- hip08_oem_type1_field_timestamp,
- hip08_oem_type1_field_version,
- hip08_oem_type1_field_soc_id,
- hip08_oem_type1_field_socket_id,
- hip08_oem_type1_field_nimbus_id,
- hip08_oem_type1_field_module_id,
- hip08_oem_type1_field_sub_module_id,
- hip08_oem_type1_field_err_sev,
- hip08_oem_type1_field_regs_dump,
+ HIP08_OEM_TYPE1_FIELD_ID,
+ HIP08_OEM_TYPE1_FIELD_TIMESTAMP,
+ HIP08_OEM_TYPE1_FIELD_VERSION,
+ HIP08_OEM_TYPE1_FIELD_SOC_ID,
+ HIP08_OEM_TYPE1_FIELD_SOCKET_ID,
+ HIP08_OEM_TYPE1_FIELD_NIMBUS_ID,
+ HIP08_OEM_TYPE1_FIELD_MODULE_ID,
+ HIP08_OEM_TYPE1_FIELD_SUB_MODULE_ID,
+ HIP08_OEM_TYPE1_FIELD_ERR_SEV,
+ HIP08_OEM_TYPE1_FIELD_REGS_DUMP,
};
enum {
- hip08_oem_type2_field_id,
- hip08_oem_type2_field_timestamp,
- hip08_oem_type2_field_version,
- hip08_oem_type2_field_soc_id,
- hip08_oem_type2_field_socket_id,
- hip08_oem_type2_field_nimbus_id,
- hip08_oem_type2_field_module_id,
- hip08_oem_type2_field_sub_module_id,
- hip08_oem_type2_field_err_sev,
- hip08_oem_type2_field_regs_dump,
+ HIP08_OEM_TYPE2_FIELD_ID,
+ HIP08_OEM_TYPE2_FIELD_TIMESTAMP,
+ HIP08_OEM_TYPE2_FIELD_VERSION,
+ HIP08_OEM_TYPE2_FIELD_SOC_ID,
+ HIP08_OEM_TYPE2_FIELD_SOCKET_ID,
+ HIP08_OEM_TYPE2_FIELD_NIMBUS_ID,
+ HIP08_OEM_TYPE2_FIELD_MODULE_ID,
+ HIP08_OEM_TYPE2_FIELD_SUB_MODULE_ID,
+ HIP08_OEM_TYPE2_FIELD_ERR_SEV,
+ HIP08_OEM_TYPE2_FIELD_REGS_DUMP,
};
enum {
- hip08_pcie_local_field_id,
- hip08_pcie_local_field_timestamp,
- hip08_pcie_local_field_version,
- hip08_pcie_local_field_soc_id,
- hip08_pcie_local_field_socket_id,
- hip08_pcie_local_field_nimbus_id,
- hip08_pcie_local_field_sub_module_id,
- hip08_pcie_local_field_core_id,
- hip08_pcie_local_field_port_id,
- hip08_pcie_local_field_err_sev,
- hip08_pcie_local_field_err_type,
- hip08_pcie_local_field_regs_dump,
+ HIP08_PCIE_LOCAL_FIELD_ID,
+ HIP08_PCIE_LOCAL_FIELD_TIMESTAMP,
+ HIP08_PCIE_LOCAL_FIELD_VERSION,
+ HIP08_PCIE_LOCAL_FIELD_SOC_ID,
+ HIP08_PCIE_LOCAL_FIELD_SOCKET_ID,
+ HIP08_PCIE_LOCAL_FIELD_NIMBUS_ID,
+ HIP08_PCIE_LOCAL_FIELD_SUB_MODULE_ID,
+ HIP08_PCIE_LOCAL_FIELD_CORE_ID,
+ HIP08_PCIE_LOCAL_FIELD_PORT_ID,
+ HIP08_PCIE_LOCAL_FIELD_ERR_SEV,
+ HIP08_PCIE_LOCAL_FIELD_ERR_TYPE,
+ HIP08_PCIE_LOCAL_FIELD_REGS_DUMP,
};
struct hisi_module_info {
@@ -520,13 +520,13 @@ static void record_vendor_data(struct ras_ns_dec_tab *dec_tab,
int id, int64_t data, const char *text)
{
switch (data_type) {
- case hisi_oem_data_type_int:
+ case HISI_OEM_DATA_TYPE_INT:
sqlite3_bind_int(dec_tab->stmt_dec_record, id, data);
break;
- case hisi_oem_data_type_int64:
+ case HISI_OEM_DATA_TYPE_INT64:
sqlite3_bind_int64(dec_tab->stmt_dec_record, id, data);
break;
- case hisi_oem_data_type_text:
+ case HISI_OEM_DATA_TYPE_TEXT:
sqlite3_bind_text(dec_tab->stmt_dec_record, id, text, -1, NULL);
break;
default:
@@ -579,27 +579,27 @@ static void decode_oem_type1_err_hdr(struct ras_ns_dec_tab *dec_tab,
char *end = buf + HISI_BUF_LEN;
p += snprintf(p, end - p, "[ table_version=%d ", err->version);
- record_vendor_data(dec_tab, hisi_oem_data_type_int,
- hip08_oem_type1_field_version, err->version, NULL);
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_INT,
+ HIP08_OEM_TYPE1_FIELD_VERSION, err->version, NULL);
if (err->val_bits & HISI_OEM_VALID_SOC_ID && IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "SOC_ID=%d ", err->soc_id);
- record_vendor_data(dec_tab, hisi_oem_data_type_int,
- hip08_oem_type1_field_soc_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_INT,
+ HIP08_OEM_TYPE1_FIELD_SOC_ID,
err->soc_id, NULL);
}
if (err->val_bits & HISI_OEM_VALID_SOCKET_ID && IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "socket_ID=%d ", err->socket_id);
- record_vendor_data(dec_tab, hisi_oem_data_type_int,
- hip08_oem_type1_field_socket_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_INT,
+ HIP08_OEM_TYPE1_FIELD_SOCKET_ID,
err->socket_id, NULL);
}
if (err->val_bits & HISI_OEM_VALID_NIMBUS_ID && IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "nimbus_ID=%d ", err->nimbus_id);
- record_vendor_data(dec_tab, hisi_oem_data_type_int,
- hip08_oem_type1_field_nimbus_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_INT,
+ HIP08_OEM_TYPE1_FIELD_NIMBUS_ID,
err->nimbus_id, NULL);
}
@@ -608,8 +608,8 @@ static void decode_oem_type1_err_hdr(struct ras_ns_dec_tab *dec_tab,
err->module_id);
p += snprintf(p, end - p, "module=%s ", str);
- record_vendor_data(dec_tab, hisi_oem_data_type_text,
- hip08_oem_type1_field_module_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_TEXT,
+ HIP08_OEM_TYPE1_FIELD_MODULE_ID,
0, str);
}
@@ -620,8 +620,8 @@ static void decode_oem_type1_err_hdr(struct ras_ns_dec_tab *dec_tab,
err->sub_module_id);
p += snprintf(p, end - p, "submodule=%s ", str);
- record_vendor_data(dec_tab, hisi_oem_data_type_text,
- hip08_oem_type1_field_sub_module_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_TEXT,
+ HIP08_OEM_TYPE1_FIELD_SUB_MODULE_ID,
0, str);
}
@@ -629,8 +629,8 @@ static void decode_oem_type1_err_hdr(struct ras_ns_dec_tab *dec_tab,
IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "error_severity=%s ",
err_severity(err->err_severity));
- record_vendor_data(dec_tab, hisi_oem_data_type_text,
- hip08_oem_type1_field_err_sev,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_TEXT,
+ HIP08_OEM_TYPE1_FIELD_ERR_SEV,
0, err_severity(err->err_severity));
}
@@ -691,8 +691,8 @@ static void decode_oem_type1_err_regs(struct ras_ns_dec_tab *dec_tab,
*p = '\0';
}
- record_vendor_data(dec_tab, hisi_oem_data_type_text,
- hip08_oem_type1_field_regs_dump, 0, buf);
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_TEXT,
+ HIP08_OEM_TYPE1_FIELD_REGS_DUMP, 0, buf);
step_vendor_data_tab(dec_tab, "hip08_oem_type1_event_tab");
}
@@ -722,8 +722,8 @@ static int decode_hip08_oem_type1_error(struct ras_events *ras,
}
}
#endif
- record_vendor_data(dec_tab, hisi_oem_data_type_text,
- hip08_oem_type1_field_timestamp,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_TEXT,
+ HIP08_OEM_TYPE1_FIELD_TIMESTAMP,
0, event->timestamp);
trace_seq_printf(s, "\nHISI HIP08: OEM Type-1 Error\n");
@@ -742,27 +742,27 @@ static void decode_oem_type2_err_hdr(struct ras_ns_dec_tab *dec_tab,
char *end = buf + HISI_BUF_LEN;
p += snprintf(p, end - p, "[ table_version=%d ", err->version);
- record_vendor_data(dec_tab, hisi_oem_data_type_int,
- hip08_oem_type2_field_version, err->version, NULL);
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_INT,
+ HIP08_OEM_TYPE2_FIELD_VERSION, err->version, NULL);
if (err->val_bits & HISI_OEM_VALID_SOC_ID && IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "SOC_ID=%d ", err->soc_id);
- record_vendor_data(dec_tab, hisi_oem_data_type_int,
- hip08_oem_type2_field_soc_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_INT,
+ HIP08_OEM_TYPE2_FIELD_SOC_ID,
err->soc_id, NULL);
}
if (err->val_bits & HISI_OEM_VALID_SOCKET_ID && IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "socket_ID=%d ", err->socket_id);
- record_vendor_data(dec_tab, hisi_oem_data_type_int,
- hip08_oem_type2_field_socket_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_INT,
+ HIP08_OEM_TYPE2_FIELD_SOCKET_ID,
err->socket_id, NULL);
}
if (err->val_bits & HISI_OEM_VALID_NIMBUS_ID && IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "nimbus_ID=%d ", err->nimbus_id);
- record_vendor_data(dec_tab, hisi_oem_data_type_int,
- hip08_oem_type2_field_nimbus_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_INT,
+ HIP08_OEM_TYPE2_FIELD_NIMBUS_ID,
err->nimbus_id, NULL);
}
@@ -771,8 +771,8 @@ static void decode_oem_type2_err_hdr(struct ras_ns_dec_tab *dec_tab,
err->module_id);
p += snprintf(p, end - p, "module=%s ", str);
- record_vendor_data(dec_tab, hisi_oem_data_type_text,
- hip08_oem_type2_field_module_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_TEXT,
+ HIP08_OEM_TYPE2_FIELD_MODULE_ID,
0, str);
}
@@ -783,8 +783,8 @@ static void decode_oem_type2_err_hdr(struct ras_ns_dec_tab *dec_tab,
err->sub_module_id);
p += snprintf(p, end - p, "submodule=%s ", str);
- record_vendor_data(dec_tab, hisi_oem_data_type_text,
- hip08_oem_type2_field_sub_module_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_TEXT,
+ HIP08_OEM_TYPE2_FIELD_SUB_MODULE_ID,
0, str);
}
@@ -792,8 +792,8 @@ static void decode_oem_type2_err_hdr(struct ras_ns_dec_tab *dec_tab,
IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "error_severity=%s ",
err_severity(err->err_severity));
- record_vendor_data(dec_tab, hisi_oem_data_type_text,
- hip08_oem_type2_field_err_sev,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_TEXT,
+ HIP08_OEM_TYPE2_FIELD_ERR_SEV,
0, err_severity(err->err_severity));
}
@@ -864,8 +864,8 @@ static void decode_oem_type2_err_regs(struct ras_ns_dec_tab *dec_tab,
*p = '\0';
}
- record_vendor_data(dec_tab, hisi_oem_data_type_text,
- hip08_oem_type2_field_regs_dump, 0, buf);
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_TEXT,
+ HIP08_OEM_TYPE2_FIELD_REGS_DUMP, 0, buf);
step_vendor_data_tab(dec_tab, "hip08_oem_type2_event_tab");
}
@@ -893,8 +893,8 @@ static int decode_hip08_oem_type2_error(struct ras_events *ras,
}
}
#endif
- record_vendor_data(dec_tab, hisi_oem_data_type_text,
- hip08_oem_type2_field_timestamp,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_TEXT,
+ HIP08_OEM_TYPE2_FIELD_TIMESTAMP,
0, event->timestamp);
trace_seq_printf(s, "\nHISI HIP08: OEM Type-2 Error\n");
@@ -913,31 +913,31 @@ static void decode_pcie_local_err_hdr(struct ras_ns_dec_tab *dec_tab,
char *end = buf + HISI_BUF_LEN;
p += snprintf(p, end - p, "[ table_version=%d ", err->version);
- record_vendor_data(dec_tab, hisi_oem_data_type_int,
- hip08_pcie_local_field_version,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_INT,
+ HIP08_PCIE_LOCAL_FIELD_VERSION,
err->version, NULL);
if (err->val_bits & HISI_PCIE_LOCAL_VALID_SOC_ID &&
IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "SOC_ID=%d ", err->soc_id);
- record_vendor_data(dec_tab, hisi_oem_data_type_int,
- hip08_pcie_local_field_soc_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_INT,
+ HIP08_PCIE_LOCAL_FIELD_SOC_ID,
err->soc_id, NULL);
}
if (err->val_bits & HISI_PCIE_LOCAL_VALID_SOCKET_ID &&
IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "socket_ID=%d ", err->socket_id);
- record_vendor_data(dec_tab, hisi_oem_data_type_int,
- hip08_pcie_local_field_socket_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_INT,
+ HIP08_PCIE_LOCAL_FIELD_SOCKET_ID,
err->socket_id, NULL);
}
if (err->val_bits & HISI_PCIE_LOCAL_VALID_NIMBUS_ID &&
IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "nimbus_ID=%d ", err->nimbus_id);
- record_vendor_data(dec_tab, hisi_oem_data_type_int,
- hip08_pcie_local_field_nimbus_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_INT,
+ HIP08_PCIE_LOCAL_FIELD_NIMBUS_ID,
err->nimbus_id, NULL);
}
@@ -945,24 +945,24 @@ static void decode_pcie_local_err_hdr(struct ras_ns_dec_tab *dec_tab,
IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "submodule=%s ",
pcie_local_sub_module_name(err->sub_module_id));
- record_vendor_data(dec_tab, hisi_oem_data_type_text,
- hip08_pcie_local_field_sub_module_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_TEXT,
+ HIP08_PCIE_LOCAL_FIELD_SUB_MODULE_ID,
0, pcie_local_sub_module_name(err->sub_module_id));
}
if (err->val_bits & HISI_PCIE_LOCAL_VALID_CORE_ID &&
IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "core_ID=core%d ", err->core_id);
- record_vendor_data(dec_tab, hisi_oem_data_type_int,
- hip08_pcie_local_field_core_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_INT,
+ HIP08_PCIE_LOCAL_FIELD_CORE_ID,
err->core_id, NULL);
}
if (err->val_bits & HISI_PCIE_LOCAL_VALID_PORT_ID &&
IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "port_ID=port%d ", err->port_id);
- record_vendor_data(dec_tab, hisi_oem_data_type_int,
- hip08_pcie_local_field_port_id,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_INT,
+ HIP08_PCIE_LOCAL_FIELD_PORT_ID,
err->port_id, NULL);
}
@@ -970,16 +970,16 @@ static void decode_pcie_local_err_hdr(struct ras_ns_dec_tab *dec_tab,
IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "error_severity=%s ",
err_severity(err->err_severity));
- record_vendor_data(dec_tab, hisi_oem_data_type_text,
- hip08_pcie_local_field_err_sev,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_TEXT,
+ HIP08_PCIE_LOCAL_FIELD_ERR_SEV,
0, err_severity(err->err_severity));
}
if (err->val_bits & HISI_PCIE_LOCAL_VALID_ERR_TYPE &&
IN_RANGE(p, buf, end)) {
p += snprintf(p, end - p, "error_type=0x%x ", err->err_type);
- record_vendor_data(dec_tab, hisi_oem_data_type_int,
- hip08_pcie_local_field_err_type,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_INT,
+ HIP08_PCIE_LOCAL_FIELD_ERR_TYPE,
err->err_type, NULL);
}
@@ -1014,8 +1014,8 @@ static void decode_pcie_local_err_regs(struct ras_ns_dec_tab *dec_tab,
*p = '\0';
}
- record_vendor_data(dec_tab, hisi_oem_data_type_text,
- hip08_pcie_local_field_regs_dump, 0, buf);
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_TEXT,
+ HIP08_PCIE_LOCAL_FIELD_REGS_DUMP, 0, buf);
step_vendor_data_tab(dec_tab, "hip08_pcie_local_event_tab");
}
@@ -1043,8 +1043,8 @@ static int decode_hip08_pcie_local_error(struct ras_events *ras,
}
}
#endif
- record_vendor_data(dec_tab, hisi_oem_data_type_text,
- hip08_pcie_local_field_timestamp,
+ record_vendor_data(dec_tab, HISI_OEM_DATA_TYPE_TEXT,
+ HIP08_PCIE_LOCAL_FIELD_TIMESTAMP,
0, event->timestamp);
trace_seq_printf(s, "\nHISI HIP08: PCIe local error\n");
--
2.8.1
next prev parent reply other threads:[~2019-11-26 12:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-26 12:12 [PATCH v2 0/9] rasdaemon: fix some issues reported by static code analysis Xiaofei Tan
2019-11-26 12:12 ` [PATCH v2 1/9] rasdaemon: decode submodule of OEM type1 for hip08 Xiaofei Tan
2019-11-26 12:12 ` [PATCH v2 2/9] rasdaemon: fix sub module name of HHA and DDRC " Xiaofei Tan
2019-11-26 12:12 ` [PATCH v2 3/9] rasdaemon: split OEM type1 table decode function to reduce length Xiaofei Tan
2019-11-26 12:12 ` [PATCH v2 4/9] rasdaemon: split OEM type2 " Xiaofei Tan
2019-11-26 12:12 ` [PATCH v2 5/9] rasdaemon: split PCIe local " Xiaofei Tan
2019-11-26 12:12 ` [PATCH v2 6/9] rasdaemon: fix magic number issues reported by static code analysis for hip08 Xiaofei Tan
2019-11-26 12:12 ` [PATCH v2 7/9] rasdaemon: replace sprintf with snprintf " Xiaofei Tan
2019-11-26 12:12 ` Xiaofei Tan [this message]
2019-11-26 12:12 ` [PATCH v2 9/9] rasdaemon: add default branch for switch statement Xiaofei Tan
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=1574770356-129510-9-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@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
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;
as well as URLs for NNTP newsgroup(s).