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 2AA4BA328D for ; Tue, 22 Oct 2019 13:54:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B5ACA1BED8; Tue, 22 Oct 2019 13:54:25 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 699111BECB for ; Tue, 22 Oct 2019 13:54:23 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9MBeB9j013979; Tue, 22 Oct 2019 04:54:22 -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=HYar7s5MsoNWItGqFKH6YSJRpfYtqUkGL9BN/Hl90oISl8jk3j6R7PAMqotYZSz6Yju8 qB/6Z4bBE4uu3f2Dr8hbH1DjDjWDbfCIwP85VWzidn4yOAL0YITrA6czG+KNEV6D8n8v FHcNf4Tbv1rQohsZmJ+faw/jz88oOgGMSPlZYJ4RP9JKohvDACeIjGEFXQg6MCbPUlKQ LL17QWmjJ35Tlgk0O3wCK1rfUX6uxAm/euKYUYVMhBWqrYqsPZr7DXmQacJepLQF3XZ3 Hx7dpaTz8JaS65ymj2qGgldc1lbJVHEbx5sI3GyDTkI3oTMG+hIvudDKV/TObMZ2Neju Tw== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2vsyjh8ac2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 04:54:22 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Oct 2019 04:54:20 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 Oct 2019 04:54:20 -0700 Received: from amok.marvell.com (unknown [10.95.130.40]) by maili.marvell.com (Postfix) with ESMTP id 293773F7040; Tue, 22 Oct 2019 04:54:18 -0700 (PDT) From: Andrzej Ostruszka To: , Erik Gabriel Carrillo , "Jerin Jacob" CC: , Date: Tue, 22 Oct 2019 13:54:04 +0200 Message-ID: <20191022115412.8837-3-aostruszka@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191022115412.8837-1-aostruszka@marvell.com> References: <20190917075754.8310-1-amo@semihalf.com> <20191022115412.8837-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-22_03:2019-10-22,2019-10-22 signatures=0 Subject: [dpdk-dev] [PATCH v4 02/10] 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