From patchwork Wed May 17 09:26:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qiang Yu X-Patchwork-Id: 9730825 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7EAE160138 for ; Wed, 17 May 2017 10:56:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7656B28616 for ; Wed, 17 May 2017 10:56:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69319286F4; Wed, 17 May 2017 10:56:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A3E2D28616 for ; Wed, 17 May 2017 10:56:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B6FC989020; Wed, 17 May 2017 10:56:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 3604 seconds by postgrey-1.35 at gabe; Wed, 17 May 2017 10:56:53 UTC Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0070.outbound.protection.outlook.com [104.47.34.70]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1737D89020 for ; Wed, 17 May 2017 10:56:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=qaAPEHE/XS4sgvKPiKN4plpxLW2crx6rEpu3go7rKpk=; b=cbQSiOwU4QZE84qmNwxLEUpNsqoEDACViQj0BMHxACK4NU0IgtvLI/JuRb+Uwa4ahn1JXtzKxyZcxfYniOjXZVuPShIr3yCEvwyI6cxcDZKDkAqwkii+U88/PhXNxXlH7s8fw3Zz9ayesH5cEYaFrIDWKKWNh6wObolMvhmoesQ= Received: from CY4PR12CA0048.namprd12.prod.outlook.com (10.175.82.162) by CY1PR12MB0309.namprd12.prod.outlook.com (10.161.174.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Wed, 17 May 2017 09:24:28 +0000 Received: from DM3NAM03FT062.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::207) by CY4PR12CA0048.outlook.office365.com (2603:10b6:903:129::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14 via Frontend Transport; Wed, 17 May 2017 09:24:28 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by DM3NAM03FT062.mail.protection.outlook.com (10.152.83.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1075.5 via Frontend Transport; Wed, 17 May 2017 09:24:27 +0000 Received: from SATLEXDAG04.amd.com (10.181.40.9) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server (TLS) id 14.3.339.0; Wed, 17 May 2017 04:24:27 -0500 Received: from SCYBEXDAG04.amd.com (10.34.11.14) by satlexdag04.amd.com (10.181.40.9) with Microsoft SMTP Server (TLS) id 14.3.339.0; Wed, 17 May 2017 05:24:26 -0400 Received: from shlnxcqesrv2.amd.com (10.237.70.153) by SCYBEXDAG04.amd.com (10.34.11.14) with Microsoft SMTP Server id 14.3.339.0; Wed, 17 May 2017 17:24:22 +0800 From: Qiang Yu To: Subject: [PATCH libdrm] xf86drm: fix compile error for declare i in for loop Date: Wed, 17 May 2017 17:26:04 +0800 Message-ID: <1495013164-2939-1-git-send-email-Qiang.Yu@amd.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39410400002)(39400400002)(39850400002)(39860400002)(39840400002)(39450400003)(2980300002)(428002)(199003)(189002)(9170700003)(47776003)(5660300001)(4326008)(110136004)(53416004)(305945005)(81166006)(50986999)(189998001)(8676002)(50226002)(72206003)(106466001)(356003)(105586002)(2906002)(53936002)(8936002)(478600001)(38730400002)(2351001)(6666003)(86362001)(48376002)(36756003)(101416001)(5003940100001)(77096006)(50466002)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0309; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT062; 1:sH4hx5Kmb3XKSaWdgthsd+OqfiBqZ9xWIipFyLsEnxQCPvr7Qi5DfefRqNq7GTSoBVSdEhBBwUTmunfm7skGlHpSuxTkJOz8IBvKAWOHdK4D3WqjzkYXFpOhe7YUXM24Pxmetw8GoutxaLWNbD75b7n3S1V5DCpZGO6qmFVSwkXqp5caIqbHKxhPh/G0WfOQUEsNt4IfHWEalcwvG1f5hQH3nZlMEIqK1kiV1dhgP6lg+zrDuwIVjj6RFgEe7z/IjBzPmF1/+LDecswE55BKkYiWQZlfwT+ddAfu5QsR2RbriBzWqHsvaGkITlZlWieeQQOJMRRO8e2+099fHVXe/rgWMvAUXUNNXL+ZUpHPYC3GHmVSL9+A1CjusW514iuIHNSM6uX63NvtcFHjMehvhoKUtI7lc5mlqDGTgZQnaYePeecSoLk+lPFBHkPaos7QVJbgORHs5Rh5dYC1IwDN5Fd3i5HYttBzC/kpm6IRuoLA1jPg7BrkvpjDciTU+iDb X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5017d4db-7847-480a-1131-08d49d068440 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:CY1PR12MB0309; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0309; 3:8EtvwqwDkv5vEDeryotrym0gxwB0CEOdld+fTr8wjIp1XdRkwxQ8121MuRcXQREH6TK+CyKAqqbxLeYw3SIWt9MJ4+5GG5kWXPFVWyEOn+vI/CjNnaV98G+q76dhy+yAjGZ98cN7/JrHQIWbRtRO8hmqs0IkoqT67CXu8lBQ9wK++Q5xsY3qeqwV1X0py8r6AZjM7ZfVw5W82wvme2tx4Np30/bdpKWVP6Kb39NEob5bqS5lGcVWyFP2aBDHz8Tpxiu6nnQEsTSG6Vn+2j2vkaIlOahG1dqHm0GDsBZpuy43UpmX4lfi8VCpePkvLVAXB6au9thDszPlkHMQ0Aac2tio/5r0VQNG4wlJAzVluoRGJzM2hFPUeNqJ+YeDphop7JCUTKJJL3hpqCTSl6NWSJaI0D7YX+dxeLAKB1YuP71iSwb0VLRam9GmikdntDdg0ufEshNMVIRvlPs30bpzdQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0309; 25:zWTcKKlHnilUpIRRX1nBFJNw/WLJCy02ZiVvOosrA40TucfOT9bYvBGbdZbU5jlHVzBNO4suHdZqO6ls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FWBLY/UmWsoaZvnrBy/v+Bphy44iIZZoIy8XSAgGhS/MrfQMxqbZMvrkLfQxDKbj3pf1Djzwg+wRDWffhHEHNQ+z5HpbAdg4lZm5MHIvuxamYovtGVozdHyUY1k/euRKpW2xWy7PTR/fcX3+h9LTWki4ldrckkC8Uu3rrUfwLaB6Emw/hwB+5ZwzgPCbXILeJf46A8 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(10201501046)(3002001)(93006095)(93003095)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123555025)(20161123558100)(6072148); SRVR:CY1PR12MB0309; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0309; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0309; 4:65ECK2yZhu+/7yVxFeeKfzr++t2CthYK1yFLiLU30JjhMNW7UR6SNvxRIoAYdN5mpEXgFcmd9F4Yxz/jXnARHJ94fNr6bcHPhAPVloOgr41yXajLsEY4M8U4YByIoUatrvxojhpUV1SvBuLZHWdBSF5b8qqTkHGuGnGbeRSlWH7UZECny2wEpJVVgZg9gBsGI0HrU+3AEJvAPwp3qHOWZvDxKoyXqdZcwhWdIWnh4Pgx/2Lg5QTL5W8LgISGxT3Y4iL+WFOOROEMvQPWkom9UU5Dghw+dW66gkL6y9EABcJwubRs7zrwzWEE2jv37JI8p6gbrjD3GEJhrUQ+2aYHq+qJtku91cYQEEQMKiiM4dPbxJ7L3ifn35Z9Zt+0EHA+MkjZNmx4cXKT7TVMIOizV7z7EKujKzDQM0Ze0TJljParGy7sWZRA2y/pQ99289hi7+zIR0uOcWu568aAiCbm56ZBAMeiS/dn0gZXNz/5Yf04DwvoU8q1ZRhMR/tUcP5fWVagkSofY3gYN5iy7UipUbf0ymNMKBL7u7wLvcuP2e93S4tjn69oA0IDDzHeFrwRycHHL0SizO2HR0ueVeN0lT0Tt50tsSXdpSSvkLdB5AZXW8idfbC8dzb+3qQrT8J5B4zx0Gi4wImms490JEYmlOqFpFzkhN6vqzQbglRLBO1h9/gPwAr0LvITCkatkLb3AkJ3x8bYvrhwPsnbJsTnIg+Hp1rgZAGaObqzlGCszOx/sTUwi0G/IG99mG9SOXKdFY3n0vWiWmuugx7JJXh4X3c9wTVrRHDmh2jyhQz+aBzmM+ps6Ys88TcrBi7TY2KGmvWGIM/0UjThbnqZ6q9Op/DgeyES70ETHBXFiZuvdljYDFcxzd1QywcYVc1XndlB X-Forefront-PRVS: 0310C78181 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR12MB0309; 23:sv+PVczncUkvDRs1xJt3wFGAzHnpMyBGLPkO27wr5?= =?us-ascii?Q?SxM746ZCyWiAE87nHRASoUXEUIVauFEIHUcN2zCkZangi2MfdRVVnzlqeuNS?= =?us-ascii?Q?GqqsVOTfGBWy/29NyeANoeXOA01UZMw80oySirRPzztgAGjAd2OL5gnDnHj7?= =?us-ascii?Q?jQ3nIJcIdYVvtGnnH7jWjwNCFhI6xF87hAn/vzw+KGNp5+0cn2yYGOq4MT7y?= =?us-ascii?Q?tgNnNFPpPGS4f7nK5XcEz/7GZ9LAlg7TuZKTS2Me6fwl2ujL441Ks/GZBEJV?= =?us-ascii?Q?eCiXNky6nkChytXLGa5901CgjnY1s4WYPxeZTZDZZ8ASBf0jzAfS24wMGBpH?= =?us-ascii?Q?CS2kV69eQ6GXVNThiUapXQO61dDKIjWjY9rtH530OtMP8scsprafN9GB0y7W?= =?us-ascii?Q?8LHB+Kqu02d1xq84GFx5DVd3tFFGHL7u7b9LYA7p4L/XEGQTYXzvcOFdkdxD?= =?us-ascii?Q?vXR+sO2WmOPIJTrMUVLfd0iSq2fSuKWgP6LDZt0olXLg+ROr69PbOpC3qr4J?= =?us-ascii?Q?WdIvgJb/u0/HBTOUphNz70semluscS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nTYdN2uKsl9o6u0Jx/REGWWKH7p1la X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2017 09:24:27.8988 (UTC) X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0309 Cc: Qiang Yu X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP error log: xf86drm.c: In function 'parse_separate_sysfs_files': xf86drm.c:3104:5: error: 'for' loop initial declarations are only allowed in C99 mode for (unsigned i = ignore_revision ? 1 : 0; i < ARRAY_SIZE(attrs); i++) { ^ xf86drm.c:3104:5: note: use option -std=c99 or -std=gnu99 to compile your code make[4]: *** [libdrm_la-xf86drm.lo] Error 1 Signed-off-by: Qiang Yu --- xf86drm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xf86drm.c b/xf86drm.c index 728ac78..dc028cc 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -3100,8 +3100,9 @@ static int parse_separate_sysfs_files(int maj, int min, unsigned int data[ARRAY_SIZE(attrs)]; FILE *fp; int ret; + unsigned i; - for (unsigned i = ignore_revision ? 1 : 0; i < ARRAY_SIZE(attrs); i++) { + for (i = ignore_revision ? 1 : 0; i < ARRAY_SIZE(attrs); i++) { snprintf(path, PATH_MAX, "/sys/dev/char/%d:%d/device/%s", maj, min, attrs[i]); fp = fopen(path, "r");