From patchwork Tue Dec 9 16:24:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 419172 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 94BD91400D5 for ; Wed, 10 Dec 2014 03:25:10 +1100 (AEDT) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 838171A04F6 for ; Wed, 10 Dec 2014 03:25:10 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id C11191A04EB for ; Wed, 10 Dec 2014 03:25:08 +1100 (AEDT) Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Dec 2014 02:25:08 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 10 Dec 2014 02:25:06 +1000 Received: from d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id E0E0B2BB0060 for ; Wed, 10 Dec 2014 03:25:05 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sB9GP5IY38141984 for ; Wed, 10 Dec 2014 03:25:05 +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 sB9GP485031730 for ; Wed, 10 Dec 2014 03:25:05 +1100 Received: from hegdevasant.in.ibm.com ([9.80.67.90]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id sB9GP08T031579; Wed, 10 Dec 2014 03:25:02 +1100 To: skiboot@lists.ozlabs.org From: Vasant Hegde Date: Tue, 09 Dec 2014 21:54:56 +0530 Message-ID: <20141209162450.27831.57036.stgit@hegdevasant.in.ibm.com> In-Reply-To: <20141209162404.27831.77597.stgit@hegdevasant.in.ibm.com> References: <20141209162404.27831.77597.stgit@hegdevasant.in.ibm.com> User-Agent: StGit/0.16 MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14120916-0029-0000-0000-000000C7A44C Subject: [Skiboot] [PATCH 4/6] FSP/DPO: Fix unused result warnings in DPO driver 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" Commit c36c5607 added warn_unused_result compilation flag to fsp_queue_msg function....which resulted in multiple warnings in DPO driver. This patch fixes those warnings. Signed-off-by: Vasant Hegde --- hw/fsp/fsp-dpo.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/hw/fsp/fsp-dpo.c b/hw/fsp/fsp-dpo.c index ad2659d..610c7c3 100644 --- a/hw/fsp/fsp-dpo.c +++ b/hw/fsp/fsp-dpo.c @@ -55,6 +55,7 @@ static int64_t fsp_opal_get_dpo_status(int64_t *dpo_timeout) /* Process FSP DPO init message */ static void fsp_process_dpo(struct fsp_msg *msg) { + struct fsp_msg *resp; u32 cmd = FSP_RSP_INIT_DPO; int rc; @@ -63,7 +64,17 @@ static void fsp_process_dpo(struct fsp_msg *msg) || (msg->data.bytes[1] != DPO_CMD_SGN_BYTE1)) { prlog(PR_ERR, PREFIX "Message signatures did not match\n"); cmd |= FSP_STATUS_INVALID_CMD; - fsp_queue_msg(fsp_mkmsg(cmd, 0), fsp_freemsg); + resp = fsp_mkmsg(cmd, 0); + if (resp == NULL) { + prerror(PREFIX "%s : Message allocation failed\n", + __func__); + return; + } + if (fsp_queue_msg(resp, fsp_freemsg)) { + fsp_freemsg(resp); + prerror(PREFIX "%s : Failed to queue response " + "message\n", __func__); + } return; } @@ -71,7 +82,17 @@ static void fsp_process_dpo(struct fsp_msg *msg) if (fsp_dpo_pending) { prlog(PR_ERR, PREFIX "OPAL is already in DPO pending state\n"); cmd |= FSP_STATUS_INVALID_DPOSTATE; - fsp_queue_msg(fsp_mkmsg(cmd, 0), fsp_freemsg); + resp = fsp_mkmsg(cmd, 0); + if (resp == NULL) { + prerror(PREFIX "%s : Message allocation failed\n", + __func__); + return; + } + if (fsp_queue_msg(resp, fsp_freemsg)) { + fsp_freemsg(resp); + prerror(PREFIX "%s : Failed to queue response " + "message\n", __func__); + } return; } @@ -83,13 +104,34 @@ static void fsp_process_dpo(struct fsp_msg *msg) if (rc) { prlog(PR_ERR, PREFIX "OPAL message queuing failed\n"); cmd |= FSP_STATUS_GENERIC_ERROR; - fsp_queue_msg(fsp_mkmsg(cmd, 0), fsp_freemsg); + resp = fsp_mkmsg(cmd, 0); + if (resp == NULL) { + prerror(PREFIX "%s : Message allocation failed\n", + __func__); + return; + } + if (fsp_queue_msg(resp, fsp_freemsg)) { + fsp_freemsg(resp); + prerror(PREFIX "%s : Failed to queue response " + "message\n", __func__); + } return; } /* Acknowledge the FSP on DPO */ - fsp_queue_msg(fsp_mkmsg(cmd, 0), fsp_freemsg); + resp = fsp_mkmsg(cmd, 0); + if (resp == NULL) { + prerror(PREFIX "%s : Message allocation failed\n", __func__); + return; + } + if (fsp_queue_msg(resp, fsp_freemsg)) { + fsp_freemsg(resp); + prerror(PREFIX "%s : Failed to queue response message\n", + __func__); + } + fsp_dpo_pending = true; + /* * Sapphire is now in DPO pending state. After first detecting DPO * condition from Sapphire, the host will have 45 minutes to prepare