* [PATCH 1/2] apei/*.c: use pr_warn instead of pr_warning
@ 2015-06-15 9:57 ` Wang Long
0 siblings, 0 replies; 7+ messages in thread
From: Wang Long @ 2015-06-15 9:57 UTC (permalink / raw)
To: rjw, lenb, ying.huang
Cc: tony.luck, bp, gong.chen, long.wanglong, tomasz.nowicki,
lv.zheng, linux-acpi, linux-kernel, wanglong, peifeiyue
This patch can avoid the following WARNING when run
checkpatch.pl:
WARNING: Prefer pr_warn(... to pr_warning(...
#21: FILE: drivers/acpi/apei/erst-dbg.c:134:
+ pr_warning("Record (ID: 0x%llx) length is too long: %zd\n",
Signed-off-by: Wang Long <long.wanglong@huawei.com>
---
drivers/acpi/apei/apei-base.c | 12 ++++++------
drivers/acpi/apei/einj.c | 6 +++---
drivers/acpi/apei/erst-dbg.c | 2 +-
drivers/acpi/apei/ghes.c | 14 +++++++-------
drivers/acpi/apei/hest.c | 6 +++---
5 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c
index a85ac07..5e85af3 100644
--- a/drivers/acpi/apei/apei-base.c
+++ b/drivers/acpi/apei/apei-base.c
@@ -182,7 +182,7 @@ rewind:
if (ip == ctx->ip) {
if (entry->instruction >= ctx->instructions ||
!ctx->ins_table[entry->instruction].run) {
- pr_warning(FW_WARN APEI_PFX
+ pr_warn(FW_WARN APEI_PFX
"Invalid action table, unknown instruction type: %d\n",
entry->instruction);
return -EINVAL;
@@ -223,7 +223,7 @@ static int apei_exec_for_each_entry(struct apei_exec_context *ctx,
if (end)
*end = i;
if (ins >= ctx->instructions || !ins_table[ins].run) {
- pr_warning(FW_WARN APEI_PFX
+ pr_warn(FW_WARN APEI_PFX
"Invalid action table, unknown instruction type: %d\n",
ins);
return -EINVAL;
@@ -589,7 +589,7 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr,
space_id = reg->space_id;
*paddr = get_unaligned(®->address);
if (!*paddr) {
- pr_warning(FW_BUG APEI_PFX
+ pr_warn(FW_BUG APEI_PFX
"Invalid physical address in GAR [0x%llx/%u/%u/%u/%u]\n",
*paddr, bit_width, bit_offset, access_size_code,
space_id);
@@ -597,7 +597,7 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr,
}
if (access_size_code < 1 || access_size_code > 4) {
- pr_warning(FW_BUG APEI_PFX
+ pr_warn(FW_BUG APEI_PFX
"Invalid access size code in GAR [0x%llx/%u/%u/%u/%u]\n",
*paddr, bit_width, bit_offset, access_size_code,
space_id);
@@ -614,7 +614,7 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr,
*access_bit_width = 64;
if ((bit_width + bit_offset) > *access_bit_width) {
- pr_warning(FW_BUG APEI_PFX
+ pr_warn(FW_BUG APEI_PFX
"Invalid bit width + offset in GAR [0x%llx/%u/%u/%u/%u]\n",
*paddr, bit_width, bit_offset, access_size_code,
space_id);
@@ -623,7 +623,7 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr,
if (space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY &&
space_id != ACPI_ADR_SPACE_SYSTEM_IO) {
- pr_warning(FW_BUG APEI_PFX
+ pr_warn(FW_BUG APEI_PFX
"Invalid address space type in GAR [0x%llx/%u/%u/%u/%u]\n",
*paddr, bit_width, bit_offset, access_size_code,
space_id);
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index a095d4f..ff3daca 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -183,7 +183,7 @@ static int einj_get_available_error_type(u32 *type)
static int einj_timedout(u64 *t)
{
if ((s64)*t < SPIN_UNIT) {
- pr_warning(FW_WARN EINJ_PFX
+ pr_warn(FW_WARN EINJ_PFX
"Firmware does not respond in time\n");
return 1;
}
@@ -325,7 +325,7 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type,
}
rc = einj_check_trigger_header(trigger_tab);
if (rc) {
- pr_warning(FW_BUG EINJ_PFX
+ pr_warn(FW_BUG EINJ_PFX
"The trigger error action table is invalid\n");
goto out_rel_header;
}
@@ -707,7 +707,7 @@ static int __init einj_init(void)
rc = einj_check_table(einj_tab);
if (rc) {
- pr_warning(FW_BUG EINJ_PFX "EINJ table is invalid\n");
+ pr_warn(FW_BUG EINJ_PFX "EINJ table is invalid\n");
return -EINVAL;
}
diff --git a/drivers/acpi/apei/erst-dbg.c b/drivers/acpi/apei/erst-dbg.c
index 04ab5c9..3a57ffb 100644
--- a/drivers/acpi/apei/erst-dbg.c
+++ b/drivers/acpi/apei/erst-dbg.c
@@ -130,7 +130,7 @@ retry:
if (rc < 0)
goto out;
if (len > ERST_DBG_RECORD_LEN_MAX) {
- pr_warning(ERST_DBG_PFX
+ pr_warn(ERST_DBG_PFX
"Record (ID: 0x%llx) length is too long: %zd\n",
id, len);
rc = -EIO;
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index e82d097..1d4dd1c 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -249,7 +249,7 @@ static struct ghes *ghes_new(struct acpi_hest_generic *generic)
goto err_free;
error_block_length = generic->error_block_length;
if (error_block_length > GHES_ESTATUS_MAX_SIZE) {
- pr_warning(FW_WARN GHES_PFX
+ pr_warn(FW_WARN GHES_PFX
"Error status block length is too long: %u for "
"generic hardware error source: %d.\n",
error_block_length, generic->header.source_id);
@@ -340,7 +340,7 @@ static int ghes_read_estatus(struct ghes *ghes, int silent)
rc = apei_read(&buf_paddr, &g->error_status_address);
if (rc) {
if (!silent && printk_ratelimit())
- pr_warning(FW_WARN GHES_PFX
+ pr_warn(FW_WARN GHES_PFX
"Failed to read error status block address for hardware error source: %d.\n",
g->header.source_id);
return -EIO;
@@ -373,7 +373,7 @@ static int ghes_read_estatus(struct ghes *ghes, int silent)
err_read_block:
if (rc && !silent && printk_ratelimit())
- pr_warning(FW_WARN GHES_PFX
+ pr_warn(FW_WARN GHES_PFX
"Failed to read error status block!\n");
return rc;
}
@@ -666,7 +666,7 @@ static void ghes_add_timer(struct ghes *ghes)
unsigned long expire;
if (!g->notify.poll_interval) {
- pr_warning(FW_WARN GHES_PFX "Poll interval is 0 for generic hardware error source: %d, disabled.\n",
+ pr_warn(FW_WARN GHES_PFX "Poll interval is 0 for generic hardware error source: %d, disabled.\n",
g->header.source_id);
return;
}
@@ -966,11 +966,11 @@ static int ghes_probe(struct platform_device *ghes_dev)
}
break;
case ACPI_HEST_NOTIFY_LOCAL:
- pr_warning(GHES_PFX "Generic hardware error source: %d notified via local interrupt is not supported!\n",
+ pr_warn(GHES_PFX "Generic hardware error source: %d notified via local interrupt is not supported!\n",
generic->header.source_id);
goto err;
default:
- pr_warning(FW_WARN GHES_PFX "Unknown notification type: %u for generic hardware error source: %d\n",
+ pr_warn(FW_WARN GHES_PFX "Unknown notification type: %u for generic hardware error source: %d\n",
generic->notify.type, generic->header.source_id);
goto err;
}
@@ -978,7 +978,7 @@ static int ghes_probe(struct platform_device *ghes_dev)
rc = -EIO;
if (generic->error_block_length <
sizeof(struct acpi_hest_generic_status)) {
- pr_warning(FW_BUG GHES_PFX "Invalid error block length: %u for generic hardware error source: %d\n",
+ pr_warn(FW_BUG GHES_PFX "Invalid error block length: %u for generic hardware error source: %d\n",
generic->error_block_length,
generic->header.source_id);
goto err;
diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c
index 06e9b41..56f47fb 100644
--- a/drivers/acpi/apei/hest.c
+++ b/drivers/acpi/apei/hest.c
@@ -96,7 +96,7 @@ int apei_hest_parse(apei_hest_func_t func, void *data)
for (i = 0; i < hest_tab->error_source_count; i++) {
len = hest_esrc_len(hest_hdr);
if (!len) {
- pr_warning(FW_WARN HEST_PFX
+ pr_warn(FW_WARN HEST_PFX
"Unknown or unused hardware error source "
"type: %d for hardware error source: %d.\n",
hest_hdr->type, hest_hdr->source_id);
@@ -104,7 +104,7 @@ int apei_hest_parse(apei_hest_func_t func, void *data)
}
if ((void *)hest_hdr + len >
(void *)hest_tab + hest_tab->header.length) {
- pr_warning(FW_BUG HEST_PFX
+ pr_warn(FW_BUG HEST_PFX
"Table contents overflow for hardware error source: %d.\n",
hest_hdr->source_id);
return -EINVAL;
@@ -160,7 +160,7 @@ static int __init hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
ghes_dev = ghes_arr->ghes_devs[i];
hdr = *(struct acpi_hest_header **)ghes_dev->dev.platform_data;
if (hdr->source_id == hest_hdr->source_id) {
- pr_warning(FW_WARN HEST_PFX "Duplicated hardware error source ID: %d.\n",
+ pr_warn(FW_WARN HEST_PFX "Duplicated hardware error source ID: %d.\n",
hdr->source_id);
return -EIO;
}
--
1.8.3.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 1/2] apei/*.c: use pr_warn instead of pr_warning
@ 2015-06-15 9:57 ` Wang Long
0 siblings, 0 replies; 7+ messages in thread
From: Wang Long @ 2015-06-15 9:57 UTC (permalink / raw)
To: rjw, lenb, ying.huang
Cc: tony.luck, bp, gong.chen, long.wanglong, tomasz.nowicki,
lv.zheng, linux-acpi, linux-kernel, wanglong, peifeiyue
This patch can avoid the following WARNING when run
checkpatch.pl:
WARNING: Prefer pr_warn(... to pr_warning(...
#21: FILE: drivers/acpi/apei/erst-dbg.c:134:
+ pr_warning("Record (ID: 0x%llx) length is too long: %zd\n",
Signed-off-by: Wang Long <long.wanglong@huawei.com>
---
drivers/acpi/apei/apei-base.c | 12 ++++++------
drivers/acpi/apei/einj.c | 6 +++---
drivers/acpi/apei/erst-dbg.c | 2 +-
drivers/acpi/apei/ghes.c | 14 +++++++-------
drivers/acpi/apei/hest.c | 6 +++---
5 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c
index a85ac07..5e85af3 100644
--- a/drivers/acpi/apei/apei-base.c
+++ b/drivers/acpi/apei/apei-base.c
@@ -182,7 +182,7 @@ rewind:
if (ip == ctx->ip) {
if (entry->instruction >= ctx->instructions ||
!ctx->ins_table[entry->instruction].run) {
- pr_warning(FW_WARN APEI_PFX
+ pr_warn(FW_WARN APEI_PFX
"Invalid action table, unknown instruction type: %d\n",
entry->instruction);
return -EINVAL;
@@ -223,7 +223,7 @@ static int apei_exec_for_each_entry(struct apei_exec_context *ctx,
if (end)
*end = i;
if (ins >= ctx->instructions || !ins_table[ins].run) {
- pr_warning(FW_WARN APEI_PFX
+ pr_warn(FW_WARN APEI_PFX
"Invalid action table, unknown instruction type: %d\n",
ins);
return -EINVAL;
@@ -589,7 +589,7 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr,
space_id = reg->space_id;
*paddr = get_unaligned(®->address);
if (!*paddr) {
- pr_warning(FW_BUG APEI_PFX
+ pr_warn(FW_BUG APEI_PFX
"Invalid physical address in GAR [0x%llx/%u/%u/%u/%u]\n",
*paddr, bit_width, bit_offset, access_size_code,
space_id);
@@ -597,7 +597,7 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr,
}
if (access_size_code < 1 || access_size_code > 4) {
- pr_warning(FW_BUG APEI_PFX
+ pr_warn(FW_BUG APEI_PFX
"Invalid access size code in GAR [0x%llx/%u/%u/%u/%u]\n",
*paddr, bit_width, bit_offset, access_size_code,
space_id);
@@ -614,7 +614,7 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr,
*access_bit_width = 64;
if ((bit_width + bit_offset) > *access_bit_width) {
- pr_warning(FW_BUG APEI_PFX
+ pr_warn(FW_BUG APEI_PFX
"Invalid bit width + offset in GAR [0x%llx/%u/%u/%u/%u]\n",
*paddr, bit_width, bit_offset, access_size_code,
space_id);
@@ -623,7 +623,7 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr,
if (space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY &&
space_id != ACPI_ADR_SPACE_SYSTEM_IO) {
- pr_warning(FW_BUG APEI_PFX
+ pr_warn(FW_BUG APEI_PFX
"Invalid address space type in GAR [0x%llx/%u/%u/%u/%u]\n",
*paddr, bit_width, bit_offset, access_size_code,
space_id);
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index a095d4f..ff3daca 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -183,7 +183,7 @@ static int einj_get_available_error_type(u32 *type)
static int einj_timedout(u64 *t)
{
if ((s64)*t < SPIN_UNIT) {
- pr_warning(FW_WARN EINJ_PFX
+ pr_warn(FW_WARN EINJ_PFX
"Firmware does not respond in time\n");
return 1;
}
@@ -325,7 +325,7 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type,
}
rc = einj_check_trigger_header(trigger_tab);
if (rc) {
- pr_warning(FW_BUG EINJ_PFX
+ pr_warn(FW_BUG EINJ_PFX
"The trigger error action table is invalid\n");
goto out_rel_header;
}
@@ -707,7 +707,7 @@ static int __init einj_init(void)
rc = einj_check_table(einj_tab);
if (rc) {
- pr_warning(FW_BUG EINJ_PFX "EINJ table is invalid\n");
+ pr_warn(FW_BUG EINJ_PFX "EINJ table is invalid\n");
return -EINVAL;
}
diff --git a/drivers/acpi/apei/erst-dbg.c b/drivers/acpi/apei/erst-dbg.c
index 04ab5c9..3a57ffb 100644
--- a/drivers/acpi/apei/erst-dbg.c
+++ b/drivers/acpi/apei/erst-dbg.c
@@ -130,7 +130,7 @@ retry:
if (rc < 0)
goto out;
if (len > ERST_DBG_RECORD_LEN_MAX) {
- pr_warning(ERST_DBG_PFX
+ pr_warn(ERST_DBG_PFX
"Record (ID: 0x%llx) length is too long: %zd\n",
id, len);
rc = -EIO;
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index e82d097..1d4dd1c 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -249,7 +249,7 @@ static struct ghes *ghes_new(struct acpi_hest_generic *generic)
goto err_free;
error_block_length = generic->error_block_length;
if (error_block_length > GHES_ESTATUS_MAX_SIZE) {
- pr_warning(FW_WARN GHES_PFX
+ pr_warn(FW_WARN GHES_PFX
"Error status block length is too long: %u for "
"generic hardware error source: %d.\n",
error_block_length, generic->header.source_id);
@@ -340,7 +340,7 @@ static int ghes_read_estatus(struct ghes *ghes, int silent)
rc = apei_read(&buf_paddr, &g->error_status_address);
if (rc) {
if (!silent && printk_ratelimit())
- pr_warning(FW_WARN GHES_PFX
+ pr_warn(FW_WARN GHES_PFX
"Failed to read error status block address for hardware error source: %d.\n",
g->header.source_id);
return -EIO;
@@ -373,7 +373,7 @@ static int ghes_read_estatus(struct ghes *ghes, int silent)
err_read_block:
if (rc && !silent && printk_ratelimit())
- pr_warning(FW_WARN GHES_PFX
+ pr_warn(FW_WARN GHES_PFX
"Failed to read error status block!\n");
return rc;
}
@@ -666,7 +666,7 @@ static void ghes_add_timer(struct ghes *ghes)
unsigned long expire;
if (!g->notify.poll_interval) {
- pr_warning(FW_WARN GHES_PFX "Poll interval is 0 for generic hardware error source: %d, disabled.\n",
+ pr_warn(FW_WARN GHES_PFX "Poll interval is 0 for generic hardware error source: %d, disabled.\n",
g->header.source_id);
return;
}
@@ -966,11 +966,11 @@ static int ghes_probe(struct platform_device *ghes_dev)
}
break;
case ACPI_HEST_NOTIFY_LOCAL:
- pr_warning(GHES_PFX "Generic hardware error source: %d notified via local interrupt is not supported!\n",
+ pr_warn(GHES_PFX "Generic hardware error source: %d notified via local interrupt is not supported!\n",
generic->header.source_id);
goto err;
default:
- pr_warning(FW_WARN GHES_PFX "Unknown notification type: %u for generic hardware error source: %d\n",
+ pr_warn(FW_WARN GHES_PFX "Unknown notification type: %u for generic hardware error source: %d\n",
generic->notify.type, generic->header.source_id);
goto err;
}
@@ -978,7 +978,7 @@ static int ghes_probe(struct platform_device *ghes_dev)
rc = -EIO;
if (generic->error_block_length <
sizeof(struct acpi_hest_generic_status)) {
- pr_warning(FW_BUG GHES_PFX "Invalid error block length: %u for generic hardware error source: %d\n",
+ pr_warn(FW_BUG GHES_PFX "Invalid error block length: %u for generic hardware error source: %d\n",
generic->error_block_length,
generic->header.source_id);
goto err;
diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c
index 06e9b41..56f47fb 100644
--- a/drivers/acpi/apei/hest.c
+++ b/drivers/acpi/apei/hest.c
@@ -96,7 +96,7 @@ int apei_hest_parse(apei_hest_func_t func, void *data)
for (i = 0; i < hest_tab->error_source_count; i++) {
len = hest_esrc_len(hest_hdr);
if (!len) {
- pr_warning(FW_WARN HEST_PFX
+ pr_warn(FW_WARN HEST_PFX
"Unknown or unused hardware error source "
"type: %d for hardware error source: %d.\n",
hest_hdr->type, hest_hdr->source_id);
@@ -104,7 +104,7 @@ int apei_hest_parse(apei_hest_func_t func, void *data)
}
if ((void *)hest_hdr + len >
(void *)hest_tab + hest_tab->header.length) {
- pr_warning(FW_BUG HEST_PFX
+ pr_warn(FW_BUG HEST_PFX
"Table contents overflow for hardware error source: %d.\n",
hest_hdr->source_id);
return -EINVAL;
@@ -160,7 +160,7 @@ static int __init hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
ghes_dev = ghes_arr->ghes_devs[i];
hdr = *(struct acpi_hest_header **)ghes_dev->dev.platform_data;
if (hdr->source_id == hest_hdr->source_id) {
- pr_warning(FW_WARN HEST_PFX "Duplicated hardware error source ID: %d.\n",
+ pr_warn(FW_WARN HEST_PFX "Duplicated hardware error source ID: %d.\n",
hdr->source_id);
return -EIO;
}
--
1.8.3.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] apei/erst-dbg: Define pr_fmt macro to avoid the duplication of ERST_DBG_PFX
2015-06-15 9:57 ` Wang Long
@ 2015-06-15 9:57 ` Wang Long
-1 siblings, 0 replies; 7+ messages in thread
From: Wang Long @ 2015-06-15 9:57 UTC (permalink / raw)
To: rjw, lenb, ying.huang
Cc: tony.luck, bp, gong.chen, long.wanglong, tomasz.nowicki,
lv.zheng, linux-acpi, linux-kernel, wanglong, peifeiyue
Define pr_fmt macro with {ERST DBG: } prefix, then remove all use
of ERST_DBG_PFXin the pr_* functions.
Signed-off-by: Wang Long <long.wanglong@huawei.com>
---
drivers/acpi/apei/erst-dbg.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/apei/erst-dbg.c b/drivers/acpi/apei/erst-dbg.c
index 3a57ffb..48e9490 100644
--- a/drivers/acpi/apei/erst-dbg.c
+++ b/drivers/acpi/apei/erst-dbg.c
@@ -31,7 +31,8 @@
#include "apei-internal.h"
-#define ERST_DBG_PFX "ERST DBG: "
+#undef pr_fmt
+#define pr_fmt(fmt) "ERST DBG: " fmt
#define ERST_DBG_RECORD_LEN_MAX 0x4000
@@ -130,8 +131,7 @@ retry:
if (rc < 0)
goto out;
if (len > ERST_DBG_RECORD_LEN_MAX) {
- pr_warn(ERST_DBG_PFX
- "Record (ID: 0x%llx) length is too long: %zd\n",
+ pr_warn("Record (ID: 0x%llx) length is too long: %zd\n",
id, len);
rc = -EIO;
goto out;
@@ -171,7 +171,7 @@ static ssize_t erst_dbg_write(struct file *filp, const char __user *ubuf,
return -EPERM;
if (usize > ERST_DBG_RECORD_LEN_MAX) {
- pr_err(ERST_DBG_PFX "Too long record to be written\n");
+ pr_err("Too long record to be written\n");
return -EINVAL;
}
@@ -223,7 +223,7 @@ static struct miscdevice erst_dbg_dev = {
static __init int erst_dbg_init(void)
{
if (erst_disable) {
- pr_info(ERST_DBG_PFX "ERST support is disabled.\n");
+ pr_info("ERST support is disabled.\n");
return -ENODEV;
}
return misc_register(&erst_dbg_dev);
--
1.8.3.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] apei/erst-dbg: Define pr_fmt macro to avoid the duplication of ERST_DBG_PFX
@ 2015-06-15 9:57 ` Wang Long
0 siblings, 0 replies; 7+ messages in thread
From: Wang Long @ 2015-06-15 9:57 UTC (permalink / raw)
To: rjw, lenb, ying.huang
Cc: tony.luck, bp, gong.chen, long.wanglong, tomasz.nowicki,
lv.zheng, linux-acpi, linux-kernel, wanglong, peifeiyue
Define pr_fmt macro with {ERST DBG: } prefix, then remove all use
of ERST_DBG_PFXin the pr_* functions.
Signed-off-by: Wang Long <long.wanglong@huawei.com>
---
drivers/acpi/apei/erst-dbg.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/apei/erst-dbg.c b/drivers/acpi/apei/erst-dbg.c
index 3a57ffb..48e9490 100644
--- a/drivers/acpi/apei/erst-dbg.c
+++ b/drivers/acpi/apei/erst-dbg.c
@@ -31,7 +31,8 @@
#include "apei-internal.h"
-#define ERST_DBG_PFX "ERST DBG: "
+#undef pr_fmt
+#define pr_fmt(fmt) "ERST DBG: " fmt
#define ERST_DBG_RECORD_LEN_MAX 0x4000
@@ -130,8 +131,7 @@ retry:
if (rc < 0)
goto out;
if (len > ERST_DBG_RECORD_LEN_MAX) {
- pr_warn(ERST_DBG_PFX
- "Record (ID: 0x%llx) length is too long: %zd\n",
+ pr_warn("Record (ID: 0x%llx) length is too long: %zd\n",
id, len);
rc = -EIO;
goto out;
@@ -171,7 +171,7 @@ static ssize_t erst_dbg_write(struct file *filp, const char __user *ubuf,
return -EPERM;
if (usize > ERST_DBG_RECORD_LEN_MAX) {
- pr_err(ERST_DBG_PFX "Too long record to be written\n");
+ pr_err("Too long record to be written\n");
return -EINVAL;
}
@@ -223,7 +223,7 @@ static struct miscdevice erst_dbg_dev = {
static __init int erst_dbg_init(void)
{
if (erst_disable) {
- pr_info(ERST_DBG_PFX "ERST support is disabled.\n");
+ pr_info("ERST support is disabled.\n");
return -ENODEV;
}
return misc_register(&erst_dbg_dev);
--
1.8.3.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] apei/erst-dbg: Define pr_fmt macro to avoid the duplication of ERST_DBG_PFX
2015-06-15 9:57 ` Wang Long
(?)
@ 2015-06-15 14:42 ` Joe Perches
2015-06-17 1:31 ` long.wanglong
-1 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2015-06-15 14:42 UTC (permalink / raw)
To: Wang Long
Cc: rjw, lenb, ying.huang, tony.luck, bp, gong.chen, tomasz.nowicki,
lv.zheng, linux-acpi, linux-kernel, wanglong, peifeiyue
On Mon, 2015-06-15 at 09:57 +0000, Wang Long wrote:
> Define pr_fmt macro with {ERST DBG: } prefix, then remove all use
> of ERST_DBG_PFXin the pr_* functions.
[]
> diff --git a/drivers/acpi/apei/erst-dbg.c b/drivers/acpi/apei/erst-dbg.c
[]
> @@ -31,7 +31,8 @@
>
> #include "apei-internal.h"
>
> -#define ERST_DBG_PFX "ERST DBG: "
> +#undef pr_fmt
> +#define pr_fmt(fmt) "ERST DBG: " fmt
Moving this #define above the first #include is what's
generally done and doesn't require an #undef
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] apei/erst-dbg: Define pr_fmt macro to avoid the duplication of ERST_DBG_PFX
2015-06-15 14:42 ` Joe Perches
@ 2015-06-17 1:31 ` long.wanglong
0 siblings, 0 replies; 7+ messages in thread
From: long.wanglong @ 2015-06-17 1:31 UTC (permalink / raw)
To: Joe Perches
Cc: rjw, lenb, ying.huang, tony.luck, bp, gong.chen, tomasz.nowicki,
lv.zheng, linux-acpi, linux-kernel, wanglong, peifeiyue
On 2015/6/15 22:42, Joe Perches wrote:
> On Mon, 2015-06-15 at 09:57 +0000, Wang Long wrote:
>> Define pr_fmt macro with {ERST DBG: } prefix, then remove all use
>> of ERST_DBG_PFXin the pr_* functions.
> []
>> diff --git a/drivers/acpi/apei/erst-dbg.c b/drivers/acpi/apei/erst-dbg.c
> []
>> @@ -31,7 +31,8 @@
>>
>> #include "apei-internal.h"
>>
>> -#define ERST_DBG_PFX "ERST DBG: "
>> +#undef pr_fmt
>> +#define pr_fmt(fmt) "ERST DBG: " fmt
>
> Moving this #define above the first #include is what's
> generally done and doesn't require an #undef
>
OK, Thanks
>
>
> .
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] apei/erst-dbg: Define pr_fmt macro to avoid the duplication of ERST_DBG_PFX
@ 2015-06-17 1:31 ` long.wanglong
0 siblings, 0 replies; 7+ messages in thread
From: long.wanglong @ 2015-06-17 1:31 UTC (permalink / raw)
To: Joe Perches
Cc: rjw, lenb, ying.huang, tony.luck, bp, gong.chen, tomasz.nowicki,
lv.zheng, linux-acpi, linux-kernel, wanglong, peifeiyue
On 2015/6/15 22:42, Joe Perches wrote:
> On Mon, 2015-06-15 at 09:57 +0000, Wang Long wrote:
>> Define pr_fmt macro with {ERST DBG: } prefix, then remove all use
>> of ERST_DBG_PFXin the pr_* functions.
> []
>> diff --git a/drivers/acpi/apei/erst-dbg.c b/drivers/acpi/apei/erst-dbg.c
> []
>> @@ -31,7 +31,8 @@
>>
>> #include "apei-internal.h"
>>
>> -#define ERST_DBG_PFX "ERST DBG: "
>> +#undef pr_fmt
>> +#define pr_fmt(fmt) "ERST DBG: " fmt
>
> Moving this #define above the first #include is what's
> generally done and doesn't require an #undef
>
OK, Thanks
>
>
> .
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-06-17 1:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-15 9:57 [PATCH 1/2] apei/*.c: use pr_warn instead of pr_warning Wang Long
2015-06-15 9:57 ` Wang Long
2015-06-15 9:57 ` [PATCH 2/2] apei/erst-dbg: Define pr_fmt macro to avoid the duplication of ERST_DBG_PFX Wang Long
2015-06-15 9:57 ` Wang Long
2015-06-15 14:42 ` Joe Perches
2015-06-17 1:31 ` long.wanglong
2015-06-17 1:31 ` long.wanglong
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.