From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C87B0A00BE; Mon, 28 Oct 2019 15:22:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7C97C1BF40; Mon, 28 Oct 2019 15:22:01 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id A569B1BF08 for ; Mon, 28 Oct 2019 15:21:57 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9SEKcut005712; Mon, 28 Oct 2019 07:21:57 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=Oo/f8X4wXkUlBUfEOVISYkkGRwFIZCc+9ekgdpPmvw4=; b=xSz4C5+Ixmhj3waaH9q7wrbN3VwXifOZfud2bcSBF/oDkUevr5uocYCkVmfrVem2g2by s0ruYKAjHp+Yggv21HEWSD48oAoEnvNLZJhvVTp1f4G15mHmoQ5c54fRsAd0hUefk0wV Npyv+nvzxEwcY4pef9H3LvGevBHkGGwjRDQmJzCXN8TgNq+sI5/A60A/+DQjomxWgW/m j53ypf6Nnh5znNKCo31JcTf/lFxS78S6VFP3Nxx4xuDJu58TSY+l3MN3RFmH6/er/vrl Y/NjxLpOxJMM8dOQ6L03XffUYfdmmxoInRaGA+v5awz4XM13vMzW1Zce4ZTG/QsoPu5l kw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2vvnnnwner-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 28 Oct 2019 07:21:57 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 28 Oct 2019 07:21:55 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Mon, 28 Oct 2019 07:21:55 -0700 Received: from amok.marvell.com (unknown [10.95.130.103]) by maili.marvell.com (Postfix) with ESMTP id E49BF3F7040; Mon, 28 Oct 2019 07:21:53 -0700 (PDT) From: Andrzej Ostruszka To: , Erik Gabriel Carrillo , "Jerin Jacob" CC: , Date: Mon, 28 Oct 2019 15:21:37 +0100 Message-ID: <20191028142145.3758-4-aostruszka@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191028142145.3758-1-aostruszka@marvell.com> References: <20191022115412.8837-1-aostruszka@marvell.com> <20191028142145.3758-1-aostruszka@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-28_05:2019-10-25,2019-10-28 signatures=0 Subject: [dpdk-dev] [PATCH v5 03/11] eventdev: fix possible use of uninitialized var X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fix the logic for the case of event queue allowing all schedule types. Compiler warning pointing to this error (with LTO enabled): error: ‘sched_type’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if ((ret < 0 && ret != -EOVERFLOW) || Fixes: 6750b21bd6af ("eventdev: add default software timer adapter") Signed-off-by: Andrzej Ostruszka --- lib/librte_eventdev/rte_event_timer_adapter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c index 5ce399eca..161e21a68 100644 --- a/lib/librte_eventdev/rte_event_timer_adapter.c +++ b/lib/librte_eventdev/rte_event_timer_adapter.c @@ -706,11 +706,11 @@ check_destination_event_queue(struct rte_event_timer *evtim, RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE, &sched_type); - if ((ret < 0 && ret != -EOVERFLOW) || - evtim->ev.sched_type != sched_type) - return -1; + if ((ret == 0 && evtim->ev.sched_type == sched_type) || + ret == -EOVERFLOW) + return 0; - return 0; + return -1; } static int -- 2.17.1