From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emea01-db3-obe.outbound.protection.outlook.com (mail-db3on0091.outbound.protection.outlook.com [157.55.234.91]) by dpdk.org (Postfix) with ESMTP id 682263792 for ; Mon, 6 Jul 2015 10:52:44 +0200 (CEST) Received: from DB5PR02MB0807.eurprd02.prod.outlook.com (10.161.243.153) by DB5PR02MB0742.eurprd02.prod.outlook.com (10.161.239.22) with Microsoft SMTP Server (TLS) id 15.1.201.16; Mon, 6 Jul 2015 08:52:43 +0000 Received: from HE1PR02CA0036.eurprd02.prod.outlook.com (10.162.33.46) by DB5PR02MB0807.eurprd02.prod.outlook.com (10.161.243.153) with Microsoft SMTP Server (TLS) id 15.1.207.19; Mon, 6 Jul 2015 08:52:43 +0000 Received: from DB3FFO11FD028.protection.gbl (2a01:111:f400:7e04::100) by HE1PR02CA0036.outlook.office365.com (2a01:111:e400:5149::46) with Microsoft SMTP Server (TLS) id 15.1.207.19 via Frontend Transport; Mon, 6 Jul 2015 08:52:42 +0000 Authentication-Results: spf=fail (sender IP is 124.207.145.166) smtp.mailfrom=ezchip.com; ezchip.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of ezchip.com does not designate 124.207.145.166 as permitted sender) receiver=protection.outlook.com; client-ip=124.207.145.166; helo=bjgfarm-1.internal.tilera.com; Received: from bjgfarm-1.internal.tilera.com (124.207.145.166) by DB3FFO11FD028.mail.protection.outlook.com (10.47.217.59) with Microsoft SMTP Server (TLS) id 15.1.201.10 via Frontend Transport; Mon, 6 Jul 2015 08:52:40 +0000 Received: (from zlu@localhost) by bjgfarm-1.internal.tilera.com (8.14.4/8.14.4/Submit) id t668qb2c024529; Mon, 6 Jul 2015 16:52:37 +0800 From: Zhigang Lu To: Date: Mon, 6 Jul 2015 16:51:29 +0800 Message-ID: <1436172698-21749-5-git-send-email-zlu@ezchip.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1436172698-21749-1-git-send-email-zlu@ezchip.com> References: <1436172698-21749-1-git-send-email-zlu@ezchip.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD028; 1:Uz2KYdJ9QwxjaaCUwo4xAP2yU4HNRWnZrKYANid0aYhNL1SZKoonx9BPmY2p70P2J0PNPjhHJx3tzro62I9xNacyVQoV5VXGjLqLd8oIVpiy9XFCUSZqLuRvfN+AODbpxAUxQoeKVBnWHufefNLGA+2ofeEgeGTklSa+Sp5cPpWrjvxtjcZwH0Yl501U1JCBXhj15uWwlaOH1BK/HIJrUAqL1r4YZqH88y62rvJoOKmOgb1Zn4NiseISHKXo8KxYe4ZM7ttYFYVoyWwk4Or1VIi6VaAbnEATHEkWCucIGilR3izvgd7q/Raa7UXiu85VAoWyFGeAIni5RThr3EDpFQ== X-Forefront-Antispam-Report: CIP:124.207.145.166; CTRY:CN; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(339900001)(189002)(199003)(46102003)(189998001)(36756003)(19580395003)(47776003)(107886002)(76176999)(62966003)(5001960100002)(85426001)(87936001)(86362001)(105606002)(42186005)(2950100001)(50466002)(6806004)(48376002)(110136002)(575784001)(229853001)(2351001)(106466001)(92566002)(50986999)(450100001)(104016003)(50226001)(33646002)(19580405001)(77156002)(4001430100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR02MB0807; H:bjgfarm-1.internal.tilera.com; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1; DB5PR02MB0807; 2:6eGvE8J9IBqEywoRlq1Uv7nFrgWzEPA1S+OkRD/KFaHbAK31N7g33NhebckCQ/Bs; 3:KAhq5L1IuvR+Q5J1isJk4YTAOIC4+1BZgBtpmPCuoRaYr7M4KoPg853o8e38CNVd5z0PBdWCtcHqvv7QztejtTJZwtwTGBuxdRaqkAXKqJqNteGX4A6vEh7lO2VTxS5ROSa0CbEaEqACGIQDKguxQCjnYnVzDlQyx3ZoaRTFzBp9bxjjLez9AtIdixZ6rJXrwT1YBZHVcD7LbjQaT+4H52mxI749ia8n1yRSv2o1BOOMGDlzRU/8bP1Jeb8Y9RZA; 25:kGZGut5VUUp5b/pplMWRxuzCjKcCGSaGzo70/hIEB9rKfp9MqUninKTc9rCjvIVe3/rB5v0Z17psntUoZnXqCjyap7D6vJSR+IVPg8oHGiVQWur2wVvflLFuE+WsZbSEeNTHXzNrKl4Kc4TVB7A2n0MSoSDSjhrr9rSG4E2iOIWygbEPEWr9XbijjW7FeSNfJ+QikEHnU7zl+bFlMdZjquU53QGsHn2+3nvSj/bieImw+BrWNBaYVy8V8BZwp/0UDzyHZ9y3e/X1cejPJghPYg==; 20:FptM4IkHPCSfeLj92R+m4AmStFtPQWGi9tPD2iqABIwcqqd2bSYDhyMX9D8FuHd+WV2Y+1tCsoUOKT4rD5dpeldZmD9YVD7VS/CKOuYjJ+CgDlLsFEUiI9GwdnYIIxFAY8qBhG7N0RJDmKPGgkXb0jrNZtMSPvB5t3Pq8kl/1ME= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:DB5PR02MB0807; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:DB5PR02MB0742; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:DB5PR02MB0807; BCL:0; PCL:0; RULEID:; SRVR:DB5PR02MB0807; X-Microsoft-Exchange-Diagnostics: 1; DB5PR02MB0807; 4:dW6jVlj+avXCWHMlhMuZaKC0O7FvaQ/+gf8wAjPQXUZ9ALy1/KtYfCtGdGB9g5bh4f/An6wUS8CYzWlB+MyTzrqS5OcNzzW+0IfHQks1LgvFLcmfis6kfoRCVUhsi8TbH+9omlF55KhFF3z5/ms1qjkt6xYS+S2vxqE9FkRcHL0GsdTTRERw/x98iCToOEc2JfNTZ42IeWukfbF/fcTjoej0aJladvFzt78YuSIv9Zc8s9RPVkWGNhTs/7kUm23tm+iJ+WT/YKSXfyK8lHBCnyiCpOvT1FmfQRUh6jjLQZk= X-Forefront-PRVS: 06290ECA9D X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB5PR02MB0807; 23:IcnbUHupiySn7cBHt0U9QY2JTwbJFoevdyn1vMkRB?= =?us-ascii?Q?4VlkiEHUHtllxLO/paX4JiFVy2OZWJyX/LleAMB0dZ/H8E4EUUcEbaSYaSyy?= =?us-ascii?Q?bnWtYhsvxLHt5EhID5TZQGMovlI+QrneFx+VQEWYflBbk1LeXZ4aSI4LcRyv?= =?us-ascii?Q?WRHqZGqcWmRGOIjoi4TiKI7mgMJxwsw/SFbSqPTsXkTOsbIbr+CG9BdaawvQ?= =?us-ascii?Q?ES3gEpadNcV6WPUCSLIEWLUe+tFJalKvZe8Veg/Jzfxr6um02/esVgW+X8fp?= =?us-ascii?Q?wpn05IHgcr+HN3kusbn8qEVS5e6dEMLXon/1TF9+bgsT6rUYFdOmaJdC2Cop?= =?us-ascii?Q?0jMtjK6/igLUxV/OHk9VfAuymxmAmIaTjTDsAXXWUgJFwJTYZ5gyv/hczE+t?= =?us-ascii?Q?vwd4WAco9z353hVUODIcL2A6M2l+sb7W+xYmGV+zOL9AafaTdmwe52dKO4Lf?= =?us-ascii?Q?nYaAHUyX72B631lthgk+Q1fxrS2WJtN+cyWI5341AkDYepscsZETpc7HW36W?= =?us-ascii?Q?80ippBQjuySO27B+LEa0HBk37Ow9ksJxWT8zCqigoO4lbBEREkYFy1omix2j?= =?us-ascii?Q?QD6E4DNK2wh049awzqQhGiXes3ssIxzJUOVz7TpxLhY26TJCAG8QcgtH+rXA?= =?us-ascii?Q?bhmfc0he3kQtOowqTYB5ontbJke//XU6+9sj6+Om7dSRiUQU5NHnArWPx3AW?= =?us-ascii?Q?akcfkY4/VpG4Ftf7l6WzSEq5tCF1ao2uTVIZQ9q0TIj4VSmBLahEj0Aa2qC4?= =?us-ascii?Q?dYR8xm+Woy3SQcGlVoP7buROLc+/Ikx6aEGgceTbYVCqk5Wy6TY1qYPQorWn?= =?us-ascii?Q?JQvV3qzmn/+bpU/LWmgvBKNR8NJGZistmrR/+swGmOA55aRPpVgZcyj73OCw?= =?us-ascii?Q?3wRoXj3H9bdr/99QUvn7YHmeOnZLPfDugoHbx2FB+YAcqmey/DPIIknM/KGi?= =?us-ascii?Q?7YHQwb1ZdzepX2oFh3FACbdAkuUMmqpTf/rS+swcpDgZBUIA+QcW6NxvN4At?= =?us-ascii?Q?mk=3D?= X-Microsoft-Exchange-Diagnostics: 1; DB5PR02MB0807; 5:WsnhUIyzGuj7wddu4keKtWZS2cp2ADCvH3p5Wc9W49drPi6LPJ8UZRjQCck73FOCsB+MPcLFeT/v5wNV9zMVqVd6HK8N/1WE6XP2jwn3Oz1T1JgMeWOjw3syyGDoRwUsIqaP9WeU83cFY69B+nm5nA==; 24:xHH5YnlOEw3rDXuEhNFrIkkxQg2yf27h5xCUpNPVbYjRQNfIcu8LG13aEPHUeiZeWYMRbxEThZGxBbkeKhw++bxhYMoUxPEQkoTHBsTCKQA=; 20:T/xRXoSBajUVcPkzGji6lOs3UCqwUJGvJXq/mjd47sAfyUI0s94VVM75zTlnzsQr37UfCRiqScB6LhN/yOEuIQ== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2015 08:52:40.8275 (UTC) X-MS-Exchange-CrossTenant-Id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3; Ip=[124.207.145.166]; Helo=[bjgfarm-1.internal.tilera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR02MB0807 X-Microsoft-Exchange-Diagnostics: 1; DB5PR02MB0742; 2:UC71oI/hTBCXClydeprWX2rOPZhebUdBEIgmGflMYaqQtZeFJDrgHENMvXiMXhd6; 3:RgeH0Lo1P/PMOZa+RzvLiO+gmboLzW2MOWIaCg/lRQtZaVQhP4PAm7LwsqgV9DLVBMY5XR/icestlCN3FEieTh7eN8fV/NRbzES2HAwhVsJvrTK/Ar/+zpNSr2BqKtvVu/Aew4U3uqW0NbAprJRWeoMrUsVIy69QLN8bvZe5FC8LN/Jumpp5e8QlfxeGHI/30FpNHd1mJfhPcJDlFg4Pgx0efO8QaLQK60bd/f7CW52yyRNOXrUfoDW3kUUdNWEX; 25:dt23xobleOdDO60NAJBPp9veRER1bmfIvupKZXs4iutNtFK0SQyJI2kL46L6WRrq/lMGy5zn7kS3QDza9A28qMs6GVMDOtkbe+PGI1tZOA8RVZYZLnp/yTEXbY3FBq+daoR1AdZjMJIs5Xm7zmsroD954tnjaYX0ml/lBKUOw+f46oirqi2xqzf3VfzketuHj/qk6GiDA8iB1v52vbN78xc6ksxZnas4D9gvRtPuiYrd4pgwyxsFoub34Pxcx/yv+EGTOnVLSo7uV1O7B8tHew==; 23:FKolIeiTn4xH3nFpUj0+qw/mPC8RnzHUGrrZZK4MIzgrCt56+E0JJ70sfKwt3t5tIqAeJ0brM0GCD8fvZvKF7pMkPA4gOr6KOLXsU3T8D1vwytSsjSqOJrJH/SFUf1R5M2Y4W3yxgjwLTYGQa8Ts5vaXVln8sAYUE5etDahI/ElAltCTRq4wZbPuSHOkSEzZULQu/QLKlswwoki5MJ/y7mbCbIZ3rmTTMeTOiPrQoOVvDnrovKdFR2qxek2lVfgW X-OriginatorOrg: ezchip.com Subject: [dpdk-dev] [PATCH v3 04/12] eal: allow empty compile time flags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2015 08:52:44 -0000 The rte_cpu_check_supported() code breaks with a "comparison is always false due to limited range of data type" when the compile_time_flags[] array is empty. Assigning the array dimension to a local variable apparently solves this. Change-Id: I0ae21f529cf7b6dd9cf0f4532dce9198f4bf4230 Signed-off-by: Zhigang Lu --- lib/librte_eal/common/eal_common_cpuflags.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/eal_common_cpuflags.c b/lib/librte_eal/common/eal_common_cpuflags.c index 6fd360c..8ba7b30 100644 --- a/lib/librte_eal/common/eal_common_cpuflags.c +++ b/lib/librte_eal/common/eal_common_cpuflags.c @@ -30,6 +30,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include /* @@ -62,10 +63,10 @@ rte_cpu_check_supported(void) static const enum rte_cpu_flag_t compile_time_flags[] = { RTE_COMPILE_TIME_CPUFLAGS }; - unsigned i; + unsigned count = RTE_DIM(compile_time_flags), i; int ret; - for (i = 0; i < sizeof(compile_time_flags)/sizeof(compile_time_flags[0]); i++) { + for (i = 0; i < count; i++) { ret = rte_cpu_get_flag_enabled(compile_time_flags[i]); if (ret < 0) { -- 2.1.2