aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powernv/opal-hmi.c
diff options
context:
space:
mode:
authorRussell Currey <ruscur@russell.cc>2016-03-15 21:14:12 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2016-04-11 20:30:40 +1000
commitf8a25db47ebc11fe228735d916e480d4b2ebe611 (patch)
tree48a733c9fc45a9b3e6ca228cc2f9caaeafe48491 /arch/powerpc/platforms/powernv/opal-hmi.c
parentcxl: Remove dead code (diff)
downloadlinux-dev-f8a25db47ebc11fe228735d916e480d4b2ebe611.tar.xz
linux-dev-f8a25db47ebc11fe228735d916e480d4b2ebe611.zip
powerpc/powernv: Use the "unknown" checkstop type as a fallback
The HMI code knows about three types of errors: CORE, NX and UNKNOWN. If OPAL were to add a new type, it would not be handled at all since there is no fallback case. Instead of explicitly checking for UNKNOWN, treat any checkstop type without a handler as unknown. Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/powernv/opal-hmi.c')
-rw-r--r--arch/powerpc/platforms/powernv/opal-hmi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-hmi.c b/arch/powerpc/platforms/powernv/opal-hmi.c
index d000f4e21981..c0a8201cb4d9 100644
--- a/arch/powerpc/platforms/powernv/opal-hmi.c
+++ b/arch/powerpc/platforms/powernv/opal-hmi.c
@@ -150,15 +150,17 @@ static void print_nx_checkstop_reason(const char *level,
static void print_checkstop_reason(const char *level,
struct OpalHMIEvent *hmi_evt)
{
- switch (hmi_evt->u.xstop_error.xstop_type) {
+ uint8_t type = hmi_evt->u.xstop_error.xstop_type;
+ switch (type) {
case CHECKSTOP_TYPE_CORE:
print_core_checkstop_reason(level, hmi_evt);
break;
case CHECKSTOP_TYPE_NX:
print_nx_checkstop_reason(level, hmi_evt);
break;
- case CHECKSTOP_TYPE_UNKNOWN:
- printk("%s Unknown Malfunction Alert.\n", level);
+ default:
+ printk("%s Unknown Malfunction Alert of type %d\n",
+ level, type);
break;
}
}