diff options
author | Anshuman Khandual <khandual@linux.vnet.ibm.com> | 2014-09-29 20:15:33 +0530 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-09-30 14:44:54 +1000 |
commit | 57357e73f37659210da035c135b8d1a6a1d9bbb9 (patch) | |
tree | 71cc58433d966eb36af920aeb3941c8bc443b6be | |
parent | 22766a6661b1cd2ce8c54a11a4be62d9149f6f77 (diff) | |
download | skiboot-57357e73f37659210da035c135b8d1a6a1d9bbb9.zip skiboot-57357e73f37659210da035c135b8d1a6a1d9bbb9.tar.gz skiboot-57357e73f37659210da035c135b8d1a6a1d9bbb9.tar.bz2 |
dpo: Minor code cleanup
This patch cleans up multiple printf statements and also
introduces couple of defines to reflect the byte position
signatures present on the FSP DPO initiation command.
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | hw/fsp/fsp-dpo.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/hw/fsp/fsp-dpo.c b/hw/fsp/fsp-dpo.c index 94a705e..dc443a1 100644 --- a/hw/fsp/fsp-dpo.c +++ b/hw/fsp/fsp-dpo.c @@ -27,7 +27,10 @@ #define PREFIX "FSPDPO: " -#define DPO_TIMEOUT 2700 /* 45 minutes in seconds */ +#define DPO_CMD_SGN_BYTE0 0xf4 /* Byte[0] signature */ +#define DPO_CMD_SGN_BYTE1 0x20 /* Byte[1] signature */ +#define DPO_TIMEOUT 2700 /* 45 minutes in seconds */ + static bool fsp_dpo_pending = false; unsigned long fsp_dpo_init_tb = 0; @@ -56,8 +59,9 @@ static void fsp_process_dpo(struct fsp_msg *msg) int rc; /* DPO message does not have the correct signatures */ - if ((msg->data.bytes[0] != 0xf4) || (msg->data.bytes[1] != 0x20)) { - printf("DPO: Message signatures did not match\n"); + if ((msg->data.bytes[0] != DPO_CMD_SGN_BYTE0) + || (msg->data.bytes[1] != DPO_CMD_SGN_BYTE1)) { + printf(PREFIX "Message signatures did not match\n"); cmd |= FSP_STATUS_INVALID_CMD; fsp_queue_msg(fsp_mkmsg(cmd, 0), fsp_freemsg); return; @@ -65,7 +69,7 @@ static void fsp_process_dpo(struct fsp_msg *msg) /* Sapphire is already in "DPO pending" state */ if (fsp_dpo_pending) { - printf("DPO: Sapphire is already in DPO pending state\n"); + printf(PREFIX "OPAL is already in DPO pending state\n"); cmd |= FSP_STATUS_INVALID_DPOSTATE; fsp_queue_msg(fsp_mkmsg(cmd, 0), fsp_freemsg); return; @@ -77,7 +81,7 @@ static void fsp_process_dpo(struct fsp_msg *msg) /* Inform the host about DPO */ rc = opal_queue_msg(OPAL_MSG_DPO, NULL, NULL); if (rc) { - printf("DPO: OPAL message queuing failed\n"); + printf(PREFIX "OPAL message queuing failed\n"); return; } |