All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: matan@mellanox.com
Cc: dev@dpdk.org, Stephen Hemminger <stephen@networkplumber.org>,
	Stephen Hemminger <sthemmin@microsoft.com>
Subject: [PATCH 2/2] ethdev: make rte_eth_is_valid_owner_id return bool
Date: Thu, 16 Aug 2018 15:44:09 -0700	[thread overview]
Message-ID: <20180816224409.5719-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20180816224409.5719-1-stephen@networkplumber.org>

Function is boolean so use that.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 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

  parent reply	other threads:[~2018-08-16 22:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14  0:19 [PATCH] ethdev: fix rte_eth_dev_owner_unset Stephen Hemminger
2018-08-14  5:52 ` Matan Azrad
2018-08-14 16:55   ` Stephen Hemminger
2018-08-14 19:46     ` Matan Azrad
2018-08-24 13:55       ` Ferruh Yigit
2018-08-24 14:42         ` Stephen Hemminger
2018-08-16 22:44 ` [PATCH 0/2] ethdev: minor ownership changes Stephen Hemminger
2018-08-16 22:44   ` [PATCH 1/2] ethdev: silence error message on rte_eth_dev_owner_unset Stephen Hemminger
2018-08-21 10:04     ` Matan Azrad
2018-08-21 15:45     ` [PATCH v3] " Stephen Hemminger
2018-08-21 15:53       ` Matan Azrad
2018-08-27 13:01         ` Ferruh Yigit
2018-08-16 22:44   ` Stephen Hemminger [this message]
2018-08-21 10:20     ` [PATCH 2/2] ethdev: make rte_eth_is_valid_owner_id return bool Matan Azrad
2018-08-21 15:06       ` Stephen Hemminger
2018-08-21 15:48         ` Matan Azrad
2018-08-21 18:31           ` Stephen Hemminger
2018-08-26  7:49             ` Matan Azrad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180816224409.5719-3-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=sthemmin@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.