From patchwork Tue Dec 9 16:24:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 419171 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 D03F31400D5 for ; Wed, 10 Dec 2014 03:24:52 +1100 (AEDT) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id C10E01A04F2 for ; Wed, 10 Dec 2014 03:24:52 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e23smtp09.au.ibm.com (e23smtp09.au.ibm.com [202.81.31.142]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 437151A04EB for ; Wed, 10 Dec 2014 03:24:51 +1100 (AEDT) Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Dec 2014 02:24:49 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp09.au.ibm.com (202.81.31.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 10 Dec 2014 02:24:46 +1000 Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 74F462BB0061 for ; Wed, 10 Dec 2014 03:24:46 +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 sB9GOkOb39256198 for ; Wed, 10 Dec 2014 03:24:46 +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 sB9GOjq6031386 for ; Wed, 10 Dec 2014 03:24:45 +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 sB9GOfVZ031335; Wed, 10 Dec 2014 03:24:43 +1100 To: skiboot@lists.ozlabs.org From: Vasant Hegde Date: Tue, 09 Dec 2014 21:54:37 +0530 Message-ID: <20141209162435.27831.61582.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-0033-0000-0000-000000B43849 Subject: [Skiboot] [PATCH 3/6] SURV: Fix unused result warnings in surveillance code 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" From: Ananth N Mavinakayanahalli Fix Wunused_result Signed-off-by: Ananth N Mavinakayanahalli Signed-off-by: Vasant Hegde --- hw/fsp/fsp-surveillance.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/hw/fsp/fsp-surveillance.c b/hw/fsp/fsp-surveillance.c index ebe19d6..dab3f31 100644 --- a/hw/fsp/fsp-surveillance.c +++ b/hw/fsp/fsp-surveillance.c @@ -92,6 +92,7 @@ static void fsp_surv_check_timeout(void) static void fsp_surv_hbeat(void) { u64 now = mftb(); + struct fsp_msg *msg; /* Check if an ack is pending... if so, don't send the ping just yet */ if (fsp_surv_ack_pending) { @@ -111,12 +112,19 @@ static void fsp_surv_hbeat(void) (tb_compare(now, surv_timer) == TB_AEQUALB)) { prlog(PR_DEBUG, "SURV: Sending the hearbeat command to FSP\n"); - fsp_queue_msg(fsp_mkmsg(FSP_CMD_SURV_HBEAT, 1, 120), - fsp_surv_ack); - - fsp_surv_ack_pending = true; - surv_timer = now + secs_to_tb(60); - surv_ack_timer = now + secs_to_tb(FSP_SURV_ACK_TIMEOUT); + msg = fsp_mkmsg(FSP_CMD_SURV_HBEAT, 1, 120); + if (!msg) { + prerror("SURV: Failed to allocate hbeat msg\n"); + return; + } + if (fsp_queue_msg(msg, fsp_surv_ack)) { + fsp_freemsg(msg); + prerror("SURV: Failed to queue hbeat msg\n"); + } else { + fsp_surv_ack_pending = true; + surv_timer = now + secs_to_tb(60); + surv_ack_timer = now + secs_to_tb(FSP_SURV_ACK_TIMEOUT); + } } }