From patchwork Thu Feb 5 08:38:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 436681 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1FC4D1401DE for ; Thu, 5 Feb 2015 19:39:51 +1100 (AEDT) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 10C881A0E2A for ; Thu, 5 Feb 2015 19:39:51 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e23smtp02.au.ibm.com (e23smtp02.au.ibm.com [202.81.31.144]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 979CC1A0DEA for ; Thu, 5 Feb 2015 19:39:48 +1100 (AEDT) Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Feb 2015 18:39:46 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp02.au.ibm.com (202.81.31.208) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 5 Feb 2015 18:39:45 +1000 Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id C769F3578048 for ; Thu, 5 Feb 2015 19:39:44 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t158dawU43581692 for ; Thu, 5 Feb 2015 19:39:44 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t158dB38019555 for ; Thu, 5 Feb 2015 19:39:11 +1100 Received: from localhost.localdomain ([9.124.35.64]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t158dAAt019205 for ; Thu, 5 Feb 2015 19:39:10 +1100 From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Thu, 05 Feb 2015 14:08:54 +0530 Message-ID: <20150205083854.12859.39626.stgit@localhost.localdomain> In-Reply-To: <20150205083611.12859.41225.stgit@localhost.localdomain> References: <20150205083611.12859.41225.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15020508-0005-0000-0000-0000014B3B7D Subject: [Skiboot] [PATCH 07/22] FSP/LEDS: Use consistent prefix X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Presently errors logged into FSP starts with prefix "LED" and rest starts with FSPLED. Lets use consistent prefix (FSPLED). No change in functionality. Signed-off-by: Vasant Hegde --- hw/fsp/fsp-leds.c | 87 +++++++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 40 deletions(-) diff --git a/hw/fsp/fsp-leds.c b/hw/fsp/fsp-leds.c index 56f7b71..b17ca01 100644 --- a/hw/fsp/fsp-leds.c +++ b/hw/fsp/fsp-leds.c @@ -27,7 +27,7 @@ #include "fsp-leds.h" -/* Debug prefix */ +/* LED prefix */ #define PREFIX "FSPLED: " #define buf_write(p, type, val) do { *(type *)(p) = val;\ @@ -192,7 +192,7 @@ static void update_led_list(char *loc_code, u32 led_state) led = fsp_find_cec_led(loc_code); if (!led) { log_simple_error(&e_info(OPAL_RC_LED_LC), - "LED: Could not find descendent LED in CEC LC=%s\n", + PREFIX "Could not find descendent LED in CEC LC=%s\n", loc_code); return; } @@ -203,7 +203,7 @@ enclosure: encl_cec_led = fsp_find_encl_cec_led(loc_code); if (!encl_cec_led) { log_simple_error(&e_info(OPAL_RC_LED_LC), - "LED: Could not find enclosure LED in CEC LC=%s\n", + PREFIX "Could not find enclosure LED in CEC LC=%s\n", loc_code); return; } @@ -212,7 +212,7 @@ enclosure: encl_led = fsp_find_encl_encl_led(loc_code); if (!encl_led) { log_simple_error(&e_info(OPAL_RC_LED_LC), - "LED: Could not find enclosure LED in ENCL LC=%s\n", + PREFIX "Could not find enclosure LED in ENCL LC=%s\n", loc_code); return; } @@ -253,7 +253,7 @@ static void fsp_spcn_set_led_completion(struct fsp_msg *msg) /* SPCN command failed: Identify the command and roll back changes */ if (fail) { log_simple_error(&e_info(OPAL_RC_LED_SPCN), - "LED: Last SPCN command failed, status=%02x\n", + PREFIX "Last SPCN command failed, status=%02x\n", status); cmd |= FSP_STATUS_GENERIC_ERROR; @@ -271,11 +271,11 @@ static void fsp_spcn_set_led_completion(struct fsp_msg *msg) smsg = fsp_mkmsg(cmd, 0); if (!smsg) { - prerror("LED: Failed to allocate FSP_RSP_SET_LED_STATE\n"); + prerror(PREFIX "Failed to allocate FSP_RSP_SET_LED_STATE\n"); } else { if (fsp_queue_msg(smsg, fsp_freemsg)) { fsp_freemsg(smsg); - prerror("LED: Failed to queue FSP_RSP_SET_LED_STATE\n"); + prerror(PREFIX "Failed to queue FSP_RSP_SET_LED_STATE\n"); } } fsp_freemsg(msg); @@ -326,12 +326,13 @@ static int fsp_msg_set_led_state(char *loc_code, bool command, bool state) cmd = FSP_RSP_SET_LED_STATE | FSP_STATUS_INVALID_LC; msg = fsp_mkmsg(cmd, 0); if (!msg) { - prerror("LED: Could not allocate " - "FSP_RSP_SET_LED_STATE|FSP_STATUS_INVALID_LC\n"); + prerror(PREFIX "Could not allocate " + "FSP_RSP_SET_LED_STATE | " + "FSP_STATUS_INVALID_LC\n"); } else { if (fsp_queue_msg(msg, fsp_freemsg)) { fsp_freemsg(msg); - prerror("LED: Couldn't queue " + prerror(PREFIX "Couldn't queue " "FSP_RSP_SET_LED_STATE" "|FSP_STATUS_INVALID_LC\n"); } @@ -543,11 +544,12 @@ static void fsp_ret_loc_code_list(u16 req_type, char *loc_code) msg = fsp_mkmsg(FSP_RSP_GET_LED_LIST, 3, 0, PSI_DMA_LOC_COD_BUF, total_size); if (!msg) { - prerror("LED: Failed to allocate FSP_RSP_GET_LED_LIST.\n"); + prerror(PREFIX "Failed to allocate FSP_RSP_GET_LED_LIST.\n"); } else { if (fsp_queue_msg(msg, fsp_freemsg)) { fsp_freemsg(msg); - prerror("LED: Failed to queue FSP_RSP_GET_LED_LIST\n"); + prerror(PREFIX + "Failed to queue FSP_RSP_GET_LED_LIST\n"); } } } @@ -579,12 +581,12 @@ void fsp_get_led_list(struct fsp_msg *msg) msg = fsp_mkmsg(FSP_RSP_GET_LED_LIST | FSP_STATUS_INVALID_DATA, 0); if (!msg) { - prerror("LED: Failed to allocate FSP_RSP_GET_LED_LIST" + prerror(PREFIX "Failed to allocate FSP_RSP_GET_LED_LIST" " | FSP_STATUS_INVALID_DATA\n"); } else { if (fsp_queue_msg(msg, fsp_freemsg)) { fsp_freemsg(msg); - prerror("LED: Failed to queue " + prerror(PREFIX "Failed to queue " "FSP_RSP_GET_LED_LIST |" " FSP_STATUS_INVALID_DATA\n"); } @@ -616,18 +618,19 @@ void fsp_free_led_list_buf(struct fsp_msg *msg) /* Token does not point to outbound buffer */ if (tce_token != PSI_DMA_LOC_COD_BUF) { log_simple_error(&e_info(OPAL_RC_LED_BUFF), - "LED: Invalid tce token from FSP\n"); + PREFIX "Invalid tce token from FSP\n"); cmd |= FSP_STATUS_GENERIC_ERROR; resp = fsp_mkmsg(cmd, 0); if (!resp) { - prerror("LED: Failed to allocate FSP_RSP_RET_LED_BUFFER" - "|FSP_STATUS_GENERIC_ERROR\n"); + prerror(PREFIX "Failed to allocate FSP_RSP_RET_LED_BUFFER" + "| FSP_STATUS_GENERIC_ERROR\n"); return; } if (fsp_queue_msg(resp, fsp_freemsg)) { fsp_freemsg(resp); - prerror("LED: Failed to queue RET_LED_BUFFER|ERROR\n"); + prerror(PREFIX "Failed to queue " + "RET_LED_BUFFER|ERROR\n"); } return; } @@ -637,12 +640,12 @@ void fsp_free_led_list_buf(struct fsp_msg *msg) resp = fsp_mkmsg(cmd, 0); if (!resp) { - prerror("LED: Failed to allocate FSP_RSP_RET_LED_BUFFER\n"); + prerror(PREFIX "Failed to allocate FSP_RSP_RET_LED_BUFFER\n"); return; } if (fsp_queue_msg(resp, fsp_freemsg)) { fsp_freemsg(resp); - prerror("LED: Failed to queue FSP_RSP_RET_LED_BUFFER\n"); + prerror(PREFIX "Failed to queue FSP_RSP_RET_LED_BUFFER\n"); } } @@ -663,29 +666,31 @@ static void fsp_ret_led_state(char *loc_code) ind_state |= FSP_IND_FAULT_ACTV; msg = fsp_mkmsg(FSP_RSP_GET_LED_STATE, 1, ind_state); if (!msg) { - prerror("LED: Couldn't alloc FSP_RSP_GET_LED_STATE\n"); + prerror(PREFIX + "Couldn't alloc FSP_RSP_GET_LED_STATE\n"); return; } if (fsp_queue_msg(msg, fsp_freemsg)) { fsp_freemsg(msg); - prerror("LED: Couldn't queue FSP_RSP_GET_LED_STATE\n"); + prerror(PREFIX + "Couldn't queue FSP_RSP_GET_LED_STATE\n"); } return; } /* Location code not found */ log_simple_error(&e_info(OPAL_RC_LED_LC), - "LED: Could not find the location code LC=%s\n", loc_code); + PREFIX "Could not find the location code LC=%s\n", loc_code); msg = fsp_mkmsg(FSP_RSP_GET_LED_STATE | FSP_STATUS_INVALID_LC, 1, 0xff); if (!msg) { - prerror("LED: Failed to alloc FSP_RSP_GET_LED_STATE " + prerror(PREFIX "Failed to alloc FSP_RSP_GET_LED_STATE " "| FSP_STATUS_INVALID_LC\n"); return; } if (fsp_queue_msg(msg, fsp_freemsg)) { fsp_freemsg(msg); - prerror("LED: Failed to queue FSP_RSP_GET_LED_STATE " + prerror(PREFIX "Failed to queue FSP_RSP_GET_LED_STATE " "| FSP_STATUS_INVALID_LC\n"); } } @@ -708,14 +713,14 @@ void fsp_get_led_state(struct fsp_msg *msg) msg = fsp_mkmsg(FSP_RSP_GET_LED_STATE | FSP_STATUS_INVALID_DATA, 0); if (!msg) { - prerror("LED: Failed to allocate FSP_RSP_GET_LED_STATE" - "|FSP_STATUS_INVALID_DATA\n"); + prerror(PREFIX "Failed to allocate FSP_RSP_GET_LED_STATE" + " | FSP_STATUS_INVALID_DATA\n"); return; } if (fsp_queue_msg(msg, fsp_freemsg)) { fsp_freemsg(msg); - prerror("LED: Failed to queue FSP_RSP_GET_LED_STATE" - "|FSP_STATUS_INVALID_DATA\n"); + prerror(PREFIX "Failed to queue FSP_RSP_GET_LED_STATE" + " | FSP_STATUS_INVALID_DATA\n"); } return; } @@ -730,7 +735,7 @@ void fsp_get_led_state(struct fsp_msg *msg) /* Bound check */ if (req.lc_len >= LOC_CODE_SIZE) { log_simple_error(&e_info(OPAL_RC_LED_LC), - "LED: Loc code too large in %s: %d bytes\n", + PREFIX "Loc code too large in %s: %d bytes\n", __func__, req.lc_len); req.lc_len = LOC_CODE_SIZE - 1; } @@ -763,13 +768,13 @@ void fsp_set_led_state(struct fsp_msg *msg) FSP_STATUS_INVALID_DATA, 0); if (!msg) { - prerror("LED: Couldn't allocate FSP_RSP_SET_LED_STATE |" + prerror(PREFIX "Couldn't allocate FSP_RSP_SET_LED_STATE |" " FSP_STATUS_INVALID_DATA\n"); return; } if (fsp_queue_msg(msg, fsp_freemsg)) { fsp_freemsg(msg); - prerror("LED: Couldn't queue FSP_RSP_SET_LED_STATE |" + prerror(PREFIX "Couldn't queue FSP_RSP_SET_LED_STATE |" " FSP_STATUS_INVALID_DATA\n"); } return; @@ -786,7 +791,7 @@ void fsp_set_led_state(struct fsp_msg *msg) /* Bound check */ if (req.lc_len >= LOC_CODE_SIZE) { log_simple_error(&e_info(OPAL_RC_LED_LC), - "LED: Loc code too large in %s: %d bytes\n", + PREFIX "Loc code too large in %s: %d bytes\n", __func__, req.lc_len); req.lc_len = LOC_CODE_SIZE - 1; } @@ -814,7 +819,7 @@ void fsp_set_led_state(struct fsp_msg *msg) if (fsp_msg_set_led_state(led->loc_code, command, state)) log_simple_error(&e_info(OPAL_RC_LED_STATE), - "LED: Set led state failed at LC=%s\n", + PREFIX "Set led state failed at LC=%s\n", led->loc_code); } break; @@ -822,20 +827,20 @@ void fsp_set_led_state(struct fsp_msg *msg) /* Set led state for single descendent led */ if (fsp_msg_set_led_state(req.loc_code, command, state)) log_simple_error(&e_info(OPAL_RC_LED_STATE), - "LED: Set led state failed at LC=%s\n", + PREFIX "Set led state failed at LC=%s\n", req.loc_code); break; default: resp = fsp_mkmsg(FSP_RSP_SET_LED_STATE | FSP_STATUS_NOT_SUPPORTED, 0); if (!resp) { - prerror("LED: Unable to alloc FSP_RSP_SET_LED_STATE |" + prerror(PREFIX "Unable to alloc FSP_RSP_SET_LED_STATE |" " FSP_STATUS_NOT_SUPPORTED\n"); break; } if (fsp_queue_msg(resp, fsp_freemsg)) { fsp_freemsg(resp); - prerror("LED: Failed to queue FSP_RSP_SET_LED_STATE |" + prerror(PREFIX "Failed to queue FSP_RSP_SET_LED_STATE |" " FSP_STATUS_NOT_SUPPORTED\n"); } } @@ -939,12 +944,14 @@ static bool fsp_indicator_message(u32 cmd_sub_mod, struct fsp_msg *msg) cmd |= FSP_STATUS_GENERIC_ERROR; resp = fsp_mkmsg(cmd, 0); if (!resp) { - prerror("LED: Failed to allocate FSP_STATUS_GENERIC_ERROR\n"); + prerror(PREFIX + "Failed to allocate FSP_STATUS_GENERIC_ERROR\n"); return false; } if (fsp_queue_msg(resp, fsp_freemsg)) { fsp_freemsg(resp); - prerror("LED: Failed to queue FSP_STATUS_GENERIC_ERROR\n"); + prerror(PREFIX + "Failed to queue FSP_STATUS_GENERIC_ERROR\n"); return false; } return true; @@ -1100,7 +1107,7 @@ static void fsp_read_leds_data_complete(struct fsp_msg *msg) if (msg_status != FSP_STATUS_SUCCESS) { log_simple_error(&e_info(OPAL_RC_LED_SUPPORT), - "LED: FSP returned error %x LED not supported\n", + PREFIX "FSP returned error %x LED not supported\n", msg_status); /* LED support not available */ led_support = false;