From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by dpdk.org (Postfix) with ESMTP id 12E4C4C95 for ; Fri, 17 Aug 2018 00:44:14 +0200 (CEST) Received: by mail-pf1-f195.google.com with SMTP id d4-v6so2657842pfn.0 for ; Thu, 16 Aug 2018 15:44:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XG4EJ5tce9abA2evfStY+CNwBStbbZD23UtPLnfxzG4=; b=sy86aO5twsEiSxefhxSmboL9uj3oXjyQyx5x2VO3+xXhmFqhFlNMW6DmS+KCw9XWfF NGoPxQ9yszoG9JCeWl5mK3VcHXX0DpG7Bn0Vtc6srkbR+lMveLUmARPU46EIgwawSUpv sBJ2KXsMa2owja9MIfs8u7R49iMvnzM2MQZ9/iIH8cNbs8/TeChsZvOr9E3M64+gOowl Nn9hdjFOIb9e+pyT9oYiChXrkYL9wbUseeEqBpbeY2+Jwsd4cB8yC0VefES7gwhTymic PXE3aylBajnRqokzY8HxPEGfevoAi7wOutEMybo0OnQFOZK+fBjzmbpFLjVtQMGnB/W+ Steg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XG4EJ5tce9abA2evfStY+CNwBStbbZD23UtPLnfxzG4=; b=gcgloL320vCS5FgGJ+nssNIITpirGRpRJMxKqz8gSit7mS0cnGVzAsdmjLzfH6cl8I GMphIshNh9ymrrsiz0HbJFCRmY2EWQy2eyG8Q08S/kwRVorbZbw5WHCz3zn5y+fl2cNv jGxMonA/4X3EyhGw49ZJlbKiTvLbC+0Uynd+XviiOoKVJWwBcVzWdgJPIsMELGJsLCXF ug7G04v/jWG+6No86FIy/NfRuhTrQnqGd6BZ2FpV7cEBxFrjb9w/7uEfSkhl+hPspCw0 ep+97XxhsiS1j1+vKwz5VFtJtseuweBk6ld7bCGsKI9wFIrs00YG+ppgewE1TOlr28Dv Bp1Q== X-Gm-Message-State: AOUpUlEPLJDVZODsB4z3IbFKwKcK5qE+T3aDBWahzfLAvHq2nZwAufji KdpKqFHibbz9TQYxX7FgUg1usg== X-Google-Smtp-Source: AA+uWPxQWmUVLUShuqmlDGu94ohgOgq4lBGKl+eqVf0ObnID0rKzTRNI8aIVkIcdAuiLYvR58PnAHQ== X-Received: by 2002:a62:4b48:: with SMTP id y69-v6mr34103681pfa.93.1534459454214; Thu, 16 Aug 2018 15:44:14 -0700 (PDT) Received: from xeon-e3.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id n9-v6sm426666pfg.21.2018.08.16.15.44.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Aug 2018 15:44:13 -0700 (PDT) From: Stephen Hemminger To: matan@mellanox.com Cc: dev@dpdk.org, Stephen Hemminger , Stephen Hemminger Date: Thu, 16 Aug 2018 15:44:09 -0700 Message-Id: <20180816224409.5719-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180816224409.5719-1-stephen@networkplumber.org> References: <20180814001926.19630-1-stephen@networkplumber.org> <20180816224409.5719-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH 2/2] ethdev: make rte_eth_is_valid_owner_id return bool 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: , X-List-Received-Date: Thu, 16 Aug 2018 22:44:15 -0000 Function is boolean so use that. Signed-off-by: Stephen Hemminger --- lib/librte_ethdev/rte_ethdev.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index f09bf8bc8b01..f0336736b7c1 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -389,13 +389,11 @@ rte_eth_dev_is_valid_port(uint16_t port_id) return 1; } -static int +static bool rte_eth_is_valid_owner_id(uint64_t owner_id) { - if (owner_id == RTE_ETH_DEV_NO_OWNER || - rte_eth_dev_shared_data->next_owner_id <= owner_id) - return 0; - return 1; + return !(owner_id == RTE_ETH_DEV_NO_OWNER || + rte_eth_dev_shared_data->next_owner_id <= owner_id); } uint64_t -- 2.18.0