From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emea01-db3-obe.outbound.protection.outlook.com (mail-db3on0082.outbound.protection.outlook.com [157.55.234.82]) by dpdk.org (Postfix) with ESMTP id 7D03E68A5 for ; Thu, 9 Jul 2015 10:26:04 +0200 (CEST) Received: from DB5PR02MB0807.eurprd02.prod.outlook.com (10.161.243.153) by DB5PR02MB1096.eurprd02.prod.outlook.com (10.162.162.150) with Microsoft SMTP Server (TLS) id 15.1.213.14; Thu, 9 Jul 2015 08:26:03 +0000 Received: from HE1PR02CA0024.eurprd02.prod.outlook.com (10.162.33.34) by DB5PR02MB0807.eurprd02.prod.outlook.com (10.161.243.153) with Microsoft SMTP Server (TLS) id 15.1.207.19; Thu, 9 Jul 2015 08:26:03 +0000 Received: from AM1FFO11FD013.protection.gbl (2a01:111:f400:7e00::107) by HE1PR02CA0024.outlook.office365.com (2a01:111:e400:5149::34) with Microsoft SMTP Server (TLS) id 15.1.213.14 via Frontend Transport; Thu, 9 Jul 2015 08:26:02 +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 AM1FFO11FD013.mail.protection.outlook.com (10.174.64.91) with Microsoft SMTP Server (TLS) id 15.1.213.8 via Frontend Transport; Thu, 9 Jul 2015 08:26:00 +0000 Received: (from zlu@localhost) by bjgfarm-1.internal.tilera.com (8.14.4/8.14.4/Submit) id t698PuBx003919; Thu, 9 Jul 2015 16:25:56 +0800 From: Zhigang Lu To: Date: Thu, 9 Jul 2015 16:25:12 +0800 Message-ID: <1436430321-3864-4-git-send-email-zlu@ezchip.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1436430321-3864-1-git-send-email-zlu@ezchip.com> References: <1436430321-3864-1-git-send-email-zlu@ezchip.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD013; 1:JVkjWWW7QqFCLlRQMcsBxl0boYiTBSd2mO2AJn1EETAQtCNak4Wicc/kh01U18JC7PM2za8aieBXLU8ayTx70bepM8VCjUsHkZS2dICzogY1DedkQUrSrlFgBBvj82izNbXIC+F3NUW/SZXscnjvvgmIN3mnh8eSPZv6ZPEYelBO0SsSEHbVft1kuKSYaa64dCC+gamy88S50+AUZ9A7MtpOfyEg2msmLXOnGNb6wrU5V636pxpl81rq0RCaNdVzhbd/uqKU6Eo+ot8KGe0xC797rI9XEartxkqWkRtZcux2UZdZeKMREhQQIPwvRSqFJpZNmlc55S5WTAZet3xY/SIYeEmhMUS6i0EK5cE/VsTnf+AFLqswUIVJMIV7faknJFi8XdRh4UeQZatxqQX3iGygV2WeOCfSsplzgtT3J1JoVuQcofxi5PDg3U+esdPW X-Forefront-Antispam-Report: CIP:124.207.145.166; CTRY:CN; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(339900001)(189002)(199003)(50466002)(6806004)(76176999)(107886002)(85426001)(36756003)(46102003)(2950100001)(5001960100002)(105606002)(42186005)(19580395003)(189998001)(86362001)(110136002)(48376002)(47776003)(87936001)(62966003)(33646002)(92566002)(50226001)(229853001)(2351001)(106466001)(50986999)(19580405001)(450100001)(5003940100001)(104016003)(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:WwlVVcJD+amlmin8Y+4QOKeT8e3eDAB2Ag0kOYK583WqFcG4CPM0SP+g+BVyN12y; 3:9/5oLHAmJ9yNq2/e6CC6vKCL+s4luuYTubczWYmM0FVvqYRDmyhvV9Z0mZT+BynEH7gciv9j7Zz6ayUEJQWIcHes+YqQooc2Z3D4lyWMD4AqMEsbuUL9hP+yCVVgmZuf6jlAZ/3Ta7yZAYcPwLEsTFGcbZMPfcUS0Phb7DJaaialhTmd82drve/6XwV8bo65slk+HQ5b9ScdyIP8auslMoubXrNtLZq74KElg3gpUq4lj/w3iK33bVKeD5XJKz5v; 25:EhhAV58QgOIoo0QZk3p7+e9fB5Lu9vmyqiuVCfpTzMH0kAH0Szm6KjxVp56AILvchvjU0FRS7lwqeo7WVBo7mz+aPHlLU5XcppEAa081agLHZEgR0cCHN+2nV7Q55/28vKzGxiaZxI8YJ+bdqJN3isVX0zhQ/6bLwgoMNCu/2W0BZ53SFSpSLdAjUUDUarNijAGObjWI98tmLfXaOickrYQyHTknLhNJEAsFjMEneTmrHotj1RO+l8WU5SS9rfAB92MOl9R37/ZMiyAt83SrOQ==; 20:CQEEq10ojwQPtoRiveiy9KEXm82qAOPRcyrJ2zD301HBo/WXgPTgJcNHFbKIykFxFKNFAH1MiCkT5Kg1GalF6IBe/8vwJS8fWUhBI4yLDmk/EGmZsSiYimNrL0tlMa68ivYMq3wkciFKJ3b0ywOymXCYAeUSczNtaurOB1WpI0g= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:DB5PR02MB0807; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:DB5PR02MB1096; 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:1X/1g8XeLSz00eKNosceH+3V0XLE9MugHXrPEPxNYxmUfaHbJw7/M9dG6tUUWJDjTOnHjscDiWSAnNfEfJiTsCvFC3VWmfF//WcNgXZ9UV/lntYLOyOEYxmmE8FLrUwT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EPvtbluY1AhJNzg+p4QqoNiQwmZzpBTy6?= =?us-ascii?Q?tKm7xLVWI9cBNSnjDU9DF95OH+5OrOcwwwKnfohxdsA56O0qllK+ZYsI/LFb?= =?us-ascii?Q?6f9AVLrVUKQrQ/sfn5cDpnw8ASDqXZqTL7SYt+PRIXwu3rB6J1mX4A8GzEuq?= =?us-ascii?Q?9ceVOZUOGvRkuX8vG22XT6cKuFV+oCtq3IDtsBCOxjT9+z1yrHN6pmut0Jk3?= =?us-ascii?Q?673E4Uv5m9Hlgf+uEavw3QJIZjmzZvuzQyYeFRjb7l/l85Yxkh2acLHi33S8?= =?us-ascii?Q?74vw+u4dRWaj5YL/sCVmGyfItfEWhC9D6IJvV7zNhbjLT6vo18ZG8cInKkl4?= =?us-ascii?Q?fQ=3D?= X-Microsoft-Exchange-Diagnostics: 1; DB5PR02MB0807; 5:WSoynT7GOWfROzCOOsbUrQI9F1Mnu+RqnlU4XJWmpkU/wVH5OEAzB4I5xLqaFwMfr8iRTPXl/cYbV9CmZOKmfdgK6njUHHbaozz+GZ02bOky8DlF/BidPwLrIIizFG03sHNcMUha1coxgHTfdVoEpQ==; 24:fTNPKBcMoZrHowwqMhJbjMHC6zHs8LTCi4ZdTpdNUZzPTeMz9oyywlY+lgEe/2gJBoOV8SPSzFbORh5jyqyI3ehuPcx2fCkWg3TU8lZLV4g=; 20:Daf2qLSY2lFZjaU14g+w/JFK/dJ3QgWTemyoA567h0Aj/K4kVZ5POTAllBGPFbTllxxvkAzktIPTxqZDsAS2uA== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2015 08:26:00.9193 (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; DB5PR02MB1096; 2:vTtTgxk1+61LfTnEbsBeD1ceYdsEyTKQE74KXRY/cAJGNMCd7axmffPPk3D8SdLL; 3:Kqms/1GJ3+7X4A4nuzESLfbdZnFNghH0kC0xMrtyLv9h9bujK2fnGdI4obMGpmQ//2N03+D/LKOWFChAAu2cuG8QWct214p8LHikcESyhsqzEKFQbPRRdF1bfu7TnWlS8nzCHUNILbK+DGZlBiD4GPrON9HZgg5JJN1ErUmoz3NtVFVybOCEz3ieYi46eV85N4LMy2XQMAMqg0JjY94cEc3GO2V+gJwOjMNRVSVEMfKArvhax1OfD9Zbd97o5XPu; 25:rxzSTlpP3TNsxQu/C92ZszWIv2L4dfVugQ9r+fj3GdZyJs3hwwf0ULdhcqP/vVCtk49p37Wz17TbQtdMcYFMkFd7E2WG1RMJP2r2grNpIgz9jOQqTo6rO3Q4gUXyJj1djYhEFeUsZMCOH7yZC54WuOzHq6tUpUHHHp1VYqwE6CiyoOF37u2kSu4b6AN+xcx6pNy4cKN2/clXZADgxTMOvP3CkTsr+Dc6sAQYd7pwJnOoqYt/CnXGmNGw0pQTbPeHbGTxccHsMZoxgVcrTGMOUg==; 23:BrUOQdBGDrmjtK1f48zRIqBEYbIfwPPHGqAys5D61AdDcdvpul1LcT44tcVlxZNzbZFoOGs0ghTNt85AxxHdneTEbNsouQGiUhgTBsGz0T5AKtRTrI94u03hvvZA2C0jjQZa3VnqIwMXtr+t2uLY336V5OTYGYSo3QzKFIgZYdE3Ba8FY479Czmg9fA2OjNP4XU9S1V7OFavYpufh5oS2VK6pU3EYbehp/6DcqDbDixb+q6N2g40KCWkIIdDLFr/ X-OriginatorOrg: ezchip.com Cc: Cyril Chemparathy Subject: [dpdk-dev] [PATCH v5 03/11] eal: allow empty compile time flags RTE_COMPILE_TIME_CPUFLAGS 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: Thu, 09 Jul 2015 08:26:04 -0000 When RTE_COMPILE_TIME_CPUFLAGS is empty, the rte_cpu_check_supported() code breaks with a "comparison is always false due to limited range of data type". This is because the compile_time_flags[] array is empty. Assigning the array dimension to a local variable apparently solves this. Signed-off-by: Cyril Chemparathy Signed-off-by: Zhigang Lu Acked-by: Bruce Richardson --- 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