From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40052.outbound.protection.outlook.com [40.107.4.52]) by dpdk.org (Postfix) with ESMTP id 051672C5 for ; Tue, 21 Aug 2018 12:20:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hm75jz3uSuGnJ24ZVaeQFcSQkRPYwm7j9TJ9tdo7KuI=; b=ytB56Ted+Ytu9I6NULracXqyqtLjvCqkKLgQT9DJNRpt9Q+dj4Zhtpxc9ovIZuitSQ197QpHXfFwnzqI2BQXwvJ1EuYwt5OAvWW1RFM5nBKgc5lI9/4ZJ+F1Z00HYkcuf1hK8ikJ1hWxtdCiQfwhLDxPux1uv1MlEXeRdPnUaqc= Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com (52.133.41.11) by AM0PR0502MB3684.eurprd05.prod.outlook.com (52.133.46.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.20; Tue, 21 Aug 2018 10:20:43 +0000 Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::88fa:4498:85a5:9e5a]) by AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::88fa:4498:85a5:9e5a%3]) with mapi id 15.20.1080.010; Tue, 21 Aug 2018 10:20:43 +0000 From: Matan Azrad To: Stephen Hemminger CC: "dev@dpdk.org" , Stephen Hemminger Thread-Topic: [PATCH 2/2] ethdev: make rte_eth_is_valid_owner_id return bool Thread-Index: AQHUNbKq3SjE2Sv8E0Sncjc15GRqW6TKAXNw Date: Tue, 21 Aug 2018 10:20:43 +0000 Message-ID: References: <20180814001926.19630-1-stephen@networkplumber.org> <20180816224409.5719-1-stephen@networkplumber.org> <20180816224409.5719-3-stephen@networkplumber.org> In-Reply-To: <20180816224409.5719-3-stephen@networkplumber.org> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR0502MB3684; 6:KPvf1ds/mK4oefLgifG0Tvcu6ZhKhO1QT1LoY35hxoVNWNpRXiRvwcuXHWNHvllkyJdpKY9yE/SSOTee4AYJ71GdAScuvQ2EvP2BFrrsLhu+iqr4FoW4tZKjriHKEEYpTGvI0Dn5GD/dud9ok/Kh+/FA6WHt6wJyjNPaHj5WS+oKTdNPoJ63zDM4JKvjEiqVuZj9O2NsAfu+M9O8ECxZIhAMJGwRV3j9brXxl01p+yiycuebiskqq3Stj8pI2dLxszd0p1QNcC/hEjX+R3o8Tk8GqUsRCRBTD0mUDEuFCL3Ya4aYIIOBNYddbMAerUpNkq+LugwD2necEmNOE+Qxu117/WQ5YPcgHOVZjYsnJtAKh1s5xjoz2/RjPMiLjjiDIWhsQzmdP8s14Jpwoo1qRTheZ+YwbK+LmRluneQ8ozw36YvAC07SgQupBgOrMwb5hQo51UiEUK8NgaGAlR4LKw==; 5:3f9TNn7h+pw0DISdWNwY9B/Y/fsjuGAp9jq2bGU24Y1Ked2jf6gtpHzM0w4+WkocC/I7J0Syi9eHY35vkcbiZoJJZ3uKnJhcolcqA7thhSZcEBKp/kd9F3G3yrZ7tRcD2hyKFvQMHoLzVvrBW84YySDqc0RYDi1QDH1cRObyTOA=; 7:4kFjYyaIGdPQI9JkYdgPa9oBgjYjxNmqdRjfvONivel2HTiv3Vf425kWG1Fv/CxlpfPZHsofY0HDl+0KnqfmIfXEIzmt9Y1iUzkP30ymCrryFOutAknK01/GNmP3MsoMczPvagivNP7mg1+yKCgP3LEbtGzJrfyKEEXk/WjdxS1DJEX0Aik6BLLImYjMJdeWbzSAeoBkv+kJV0Bx5mZxpwSQ/ZiUIGypRmGtIftklpg+124/gds0gGdYfkWlJiTA x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 21aa2f41-f801-420a-7121-08d6074fc08f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR0502MB3684; x-ms-traffictypediagnostic: AM0PR0502MB3684: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(201708071742011)(7699016); SRVR:AM0PR0502MB3684; BCL:0; PCL:0; RULEID:; SRVR:AM0PR0502MB3684; x-forefront-prvs: 0771670921 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(366004)(39860400002)(376002)(396003)(136003)(189003)(199004)(478600001)(9686003)(229853002)(186003)(6506007)(6436002)(7736002)(256004)(446003)(5250100002)(305945005)(2900100001)(2906002)(6116002)(86362001)(66066001)(5660300001)(102836004)(14454004)(74316002)(26005)(8936002)(316002)(53936002)(4326008)(106356001)(486006)(105586002)(81166006)(6916009)(68736007)(7696005)(97736004)(81156014)(76176011)(11346002)(476003)(8676002)(3846002)(6246003)(55016002)(25786009)(99286004)(54906003)(33656002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3684; H:AM0PR0502MB4019.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: IoJlLdVqAC3z4Sq5DAUWqeoR8SYTBJNND7CRAS9OYDKNodi/CJRHDPyIJo+57ZWmOMuWnmClKuOWKNRYTBoZK9SR+jIrNgCqYnhFRhNpjwIoiVWkJ4dkQI2qzA0ucw6wO9y4wT/HRjECgtzswU/YOP/RSShXZcg1WI/IYjztFfqKVK7sbsaEq9Ys/UzRx1HqGcfO8bDfHjDcTW+/nUKz2NLiCCgaETiYnHXkBawmM7SugFT8w6rWDUM7O5suZO/qYZjoAV/ZFiuFGC9G14iyvhdZ+pYmkdCczqXUIda15Hld4cLszim8Z8ob1akRNfpQmSdSlUh6gPl3jjSvRFzC3UhUIEFLxpt7v83trhG/hF4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21aa2f41-f801-420a-7121-08d6074fc08f X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Aug 2018 10:20:43.3159 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3684 Subject: Re: [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: Tue, 21 Aug 2018 10:20:45 -0000 From: Stephen Hemminger > Function is boolean so use that. Ethdev is not using bool type, see also: rte_eth_dev_is_valid_port rte_eth_dev_is_removed rte_eth_dev_pool_ops_supported I think it should be a full solution to all. =20 > Signed-off-by: Stephen Hemminger > --- > lib/librte_ethdev/rte_ethdev.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) >=20 > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethde= v.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; > } >=20 > -static int > +static bool > rte_eth_is_valid_owner_id(uint64_t owner_id) { > - if (owner_id =3D=3D RTE_ETH_DEV_NO_OWNER || > - rte_eth_dev_shared_data->next_owner_id <=3D owner_id) > - return 0; > - return 1; > + return !(owner_id =3D=3D RTE_ETH_DEV_NO_OWNER || > + rte_eth_dev_shared_data->next_owner_id <=3D owner_id); > } >=20 > uint64_t > -- > 2.18.0