Commit 24f9a7fe authored by Borislav Petkov's avatar Borislav Petkov

amd64_edac: Rework printk macros

Add a macro per printk level, shorten up error messages. Add relevant
information to KERN_INFO level. No functional change.
Signed-off-by: default avatarBorislav Petkov <borislav.petkov@amd.com>
parent 8d5b5d9c
This diff is collapsed.
...@@ -74,11 +74,26 @@ ...@@ -74,11 +74,26 @@
#include "edac_core.h" #include "edac_core.h"
#include "mce_amd.h" #include "mce_amd.h"
#define amd64_printk(level, fmt, arg...) \ #define amd64_debug(fmt, arg...) \
edac_printk(level, "amd64", fmt, ##arg) edac_printk(KERN_DEBUG, "amd64", fmt, ##arg)
#define amd64_mc_printk(mci, level, fmt, arg...) \ #define amd64_info(fmt, arg...) \
edac_mc_chipset_printk(mci, level, "amd64", fmt, ##arg) edac_printk(KERN_INFO, "amd64", fmt, ##arg)
#define amd64_notice(fmt, arg...) \
edac_printk(KERN_NOTICE, "amd64", fmt, ##arg)
#define amd64_warn(fmt, arg...) \
edac_printk(KERN_WARNING, "amd64", fmt, ##arg)
#define amd64_err(fmt, arg...) \
edac_printk(KERN_ERR, "amd64", fmt, ##arg)
#define amd64_mc_warn(mci, fmt, arg...) \
edac_mc_chipset_printk(mci, KERN_WARNING, "amd64", fmt, ##arg)
#define amd64_mc_err(mci, fmt, arg...) \
edac_mc_chipset_printk(mci, KERN_ERR, "amd64", fmt, ##arg)
/* /*
* Throughout the comments in this code, the following terms are used: * Throughout the comments in this code, the following terms are used:
...@@ -129,7 +144,7 @@ ...@@ -129,7 +144,7 @@
* sections 3.5.4 and 3.5.5 for more information. * sections 3.5.4 and 3.5.5 for more information.
*/ */
#define EDAC_AMD64_VERSION " Ver: 3.3.0 " __DATE__ #define EDAC_AMD64_VERSION "v3.3.0"
#define EDAC_MOD_STR "amd64_edac" #define EDAC_MOD_STR "amd64_edac"
#define EDAC_MAX_NUMNODES 8 #define EDAC_MAX_NUMNODES 8
...@@ -527,8 +542,8 @@ static inline int amd64_read_pci_cfg_dword(struct pci_dev *pdev, int offset, ...@@ -527,8 +542,8 @@ static inline int amd64_read_pci_cfg_dword(struct pci_dev *pdev, int offset,
err = pci_read_config_dword(pdev, offset, val); err = pci_read_config_dword(pdev, offset, val);
if (err) if (err)
amd64_printk(KERN_WARNING, "%s: error reading F%dx%x.\n", amd64_warn("%s: error reading F%dx%x.\n",
func, PCI_FUNC(pdev->devfn), offset); func, PCI_FUNC(pdev->devfn), offset);
return err; return err;
} }
......
...@@ -23,9 +23,7 @@ static ssize_t amd64_inject_section_store(struct mem_ctl_info *mci, ...@@ -23,9 +23,7 @@ static ssize_t amd64_inject_section_store(struct mem_ctl_info *mci,
if (ret != -EINVAL) { if (ret != -EINVAL) {
if (value > 3) { if (value > 3) {
amd64_printk(KERN_WARNING, amd64_warn("%s: invalid section 0x%lx\n", __func__, value);
"%s: invalid section 0x%lx\n",
__func__, value);
return -EINVAL; return -EINVAL;
} }
...@@ -58,9 +56,7 @@ static ssize_t amd64_inject_word_store(struct mem_ctl_info *mci, ...@@ -58,9 +56,7 @@ static ssize_t amd64_inject_word_store(struct mem_ctl_info *mci,
if (ret != -EINVAL) { if (ret != -EINVAL) {
if (value > 8) { if (value > 8) {
amd64_printk(KERN_WARNING, amd64_warn("%s: invalid word 0x%lx\n", __func__, value);
"%s: invalid word 0x%lx\n",
__func__, value);
return -EINVAL; return -EINVAL;
} }
...@@ -92,9 +88,8 @@ static ssize_t amd64_inject_ecc_vector_store(struct mem_ctl_info *mci, ...@@ -92,9 +88,8 @@ static ssize_t amd64_inject_ecc_vector_store(struct mem_ctl_info *mci,
if (ret != -EINVAL) { if (ret != -EINVAL) {
if (value & 0xFFFF0000) { if (value & 0xFFFF0000) {
amd64_printk(KERN_WARNING, amd64_warn("%s: invalid EccVector: 0x%lx\n",
"%s: invalid EccVector: 0x%lx\n", __func__, value);
__func__, value);
return -EINVAL; return -EINVAL;
} }
......
...@@ -68,9 +68,10 @@ ...@@ -68,9 +68,10 @@
#define EDAC_PCI "PCI" #define EDAC_PCI "PCI"
#define EDAC_DEBUG "DEBUG" #define EDAC_DEBUG "DEBUG"
extern const char *edac_mem_types[];
#ifdef CONFIG_EDAC_DEBUG #ifdef CONFIG_EDAC_DEBUG
extern int edac_debug_level; extern int edac_debug_level;
extern const char *edac_mem_types[];
#define edac_debug_printk(level, fmt, arg...) \ #define edac_debug_printk(level, fmt, arg...) \
do { \ do { \
......
...@@ -76,6 +76,8 @@ static void edac_mc_dump_mci(struct mem_ctl_info *mci) ...@@ -76,6 +76,8 @@ static void edac_mc_dump_mci(struct mem_ctl_info *mci)
debugf3("\tpvt_info = %p\n\n", mci->pvt_info); debugf3("\tpvt_info = %p\n\n", mci->pvt_info);
} }
#endif /* CONFIG_EDAC_DEBUG */
/* /*
* keep those in sync with the enum mem_type * keep those in sync with the enum mem_type
*/ */
...@@ -100,8 +102,6 @@ const char *edac_mem_types[] = { ...@@ -100,8 +102,6 @@ const char *edac_mem_types[] = {
}; };
EXPORT_SYMBOL_GPL(edac_mem_types); EXPORT_SYMBOL_GPL(edac_mem_types);
#endif /* CONFIG_EDAC_DEBUG */
/* 'ptr' points to a possibly unaligned item X such that sizeof(X) is 'size'. /* 'ptr' points to a possibly unaligned item X such that sizeof(X) is 'size'.
* Adjust 'ptr' so that its alignment is at least as stringent as what the * Adjust 'ptr' so that its alignment is at least as stringent as what the
* compiler would provide for X and return the aligned result. * compiler would provide for X and return the aligned result.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment