From patchwork Sun Jun 17 00:34:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rodrigo Siqueira X-Patchwork-Id: 10468119 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 6A031600CC for ; Sun, 17 Jun 2018 00:34:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57AA128ADE for ; Sun, 17 Jun 2018 00:34:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C36928AEC; Sun, 17 Jun 2018 00:34:49 +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=-5.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 0775128ADE for ; Sun, 17 Jun 2018 00:34:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B91E6E319; Sun, 17 Jun 2018 00:34:48 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 206D16E318; Sun, 17 Jun 2018 00:34:46 +0000 (UTC) Received: by mail-qt0-x244.google.com with SMTP id l10-v6so12389774qtj.0; Sat, 16 Jun 2018 17:34:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Uk01qNzfucRW+dxUL3GYC+HssNRVLXmczphcm3+k9O4=; b=hV5QFDsjEwhu9ST5eoJ54w3dG4E/u/iPujrpdocvc5VjUIC0qu4oGZmLRTyZIPXJs6 hYwR38vCC2+FtT0AWh7eXtyZUyqDEoyrNammhcl2k8X8HOoQyrKDnw00Oh3rVJ7W5INw rp1VD95H98LBPU/eCTjn6UYPxC5GA+Hu7U1gkPleBxkpoZIwcSWGYXLhRmuDy1UHeLID 9tCa6jP8pjFte7JuMgTQ336i6J9MTUtWhHePvIGJZmAZQdmG6BSSYiHvQ8ldqytInr1I Xz+0XkMvEPkXWRMqvFKCNtz26DfzbPtJ6wtvrY6X6Ze4mT+5GE5k0XQ24RNRlZ2U8TZT ILAA== X-Gm-Message-State: APt69E08j8Ud2KAzlKeCKBLgQ9ZcFt2xG8ImeiSA4xJJYPw65nzs6cgN PLmO3Mx+wmM69gWyBz/VjTI= X-Google-Smtp-Source: ADUXVKIRjAF8BnVllPejYCp/rSIKcsOkvO8slPlw331i1GrC3S2Zeuxa33+MwaB/ZNsNG1Jit0P6GQ== X-Received: by 2002:ac8:1704:: with SMTP id w4-v6mr6530419qtj.217.1529195685168; Sat, 16 Jun 2018 17:34:45 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id j190-v6sm7817340qkd.59.2018.06.16.17.34.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Jun 2018 17:34:44 -0700 (PDT) Date: Sat, 16 Jun 2018 21:34:41 -0300 From: Rodrigo Siqueira To: Petri Latvala , Arkadiusz Hiler Message-ID: <7e686bada7d2292f5c0cc0ab824540a5eb076803.1529175003.git.rodrigosiqueiramelo@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180512 Subject: [Intel-gfx] [PATCH V2 i-g-t 3/3] Move declaration to the top of the code X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP This patch fix the following gcc warnings: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] [..] igt_color_encoding.c:45:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] [..] igt_color_encoding.c: In function ‘ycbcr_to_rgb_matrix’: igt_color_encoding.c:72:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] [..] Signed-off-by: Rodrigo Siqueira --- lib/igt_color_encoding.c | 16 ++++++---------- tests/kms_frontbuffer_tracking.c | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/igt_color_encoding.c b/lib/igt_color_encoding.c index b1648a74..1a89bb46 100644 --- a/lib/igt_color_encoding.c +++ b/lib/igt_color_encoding.c @@ -36,11 +36,9 @@ static const struct color_encoding color_encodings[IGT_NUM_COLOR_ENCODINGS] = { static struct igt_mat4 rgb_to_ycbcr_matrix(const struct color_encoding *e) { - float kr, kg, kb; - - kr = e->kr; - kb = e->kb; - kg = 1.0f - kr - kb; + float kr = e->kr; + float kb = e->kb; + float kg = 1.0f - kr - kb; struct igt_mat4 ret = { .d[0 * 4 + 0] = kr, @@ -63,11 +61,9 @@ static struct igt_mat4 rgb_to_ycbcr_matrix(const struct color_encoding *e) static struct igt_mat4 ycbcr_to_rgb_matrix(const struct color_encoding *e) { - float kr, kg, kb; - - kr = e->kr; - kb = e->kb; - kg = 1.0f - kr - kb; + float kr = e->kr; + float kb = e->kb; + float kg = 1.0f - kr - kb; struct igt_mat4 ret = { .d[0 * 4 + 0] = 1.0f, diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 8754cc46..dbb8ba62 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -1770,8 +1770,8 @@ static void do_status_assertions(int flags) static void __do_assertions(const struct test_mode *t, int flags, int line) { - flags = adjust_assertion_flags(t, flags); bool mandatory_sink_crc = t->feature & FEATURE_PSR; + flags = adjust_assertion_flags(t, flags); igt_debug("checking asserts in line %i\n", line);