From patchwork Wed May 30 00:47:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rodrigo Siqueira X-Patchwork-Id: 10437447 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 8206D602BF for ; Wed, 30 May 2018 00:47:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 716652811E for ; Wed, 30 May 2018 00:47:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62D7F286F9; Wed, 30 May 2018 00:47:21 +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 E00532811E for ; Wed, 30 May 2018 00:47:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FE5B6F57D; Wed, 30 May 2018 00:47:20 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qt0-x243.google.com (mail-qt0-x243.google.com [IPv6:2607:f8b0:400d:c0d::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 546886F57B; Wed, 30 May 2018 00:47:18 +0000 (UTC) Received: by mail-qt0-x243.google.com with SMTP id d3-v6so21149070qtp.11; Tue, 29 May 2018 17:47:18 -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=G/GC4y/37hhGQBpsuei4KrDWnp73I77kaMmzCWwjq9E=; b=t0qgcz1GchLtMeaPibYiuN8cOcfV7RTs8Q7vyslMbeTVsGwj67rtCW3HCqRchCTsea h9gckD7HlA99EntSGyk6/eTlKte5LcXDX9otZwTZgPdHchgc7vG4Kb7meyTjzP/X05X/ OcJOhqQpjfQG7K0/5DxpPktQXAF8gNlMW6egjM1VE94Xrm9NYxZGhQSMz26Dvxxv2KFG rMUSk+1bQ75m0ERvfi+SIcS/Dmxpp/1EGSBOj3FGrviZqpsn0daiNmwNdMJPHSeNTWZP thEpxZzu2NLGY8l7iLRQwIeb2ZO3ofdXtXgsEoajb+SGUA3EqJhwidDW+J3SKrS6sIBy 20VQ== X-Gm-Message-State: APt69E2IyigpmOPYWodm49j5Mn4997Tyyuo9qtfsgNxfXzVf1mBLNx5w iRiAtrGCc2Czz7rQcxPJAlhU0w== X-Google-Smtp-Source: ADUXVKLjWO9QLlNiu7Xl3fvMISgybw1U3rhvZwa7M5SM6RO68yCyrB4KVKm2hhsPdQ8jAvmCUl5veg== X-Received: by 2002:ac8:362b:: with SMTP id m40-v6mr570341qtb.379.1527641237306; Tue, 29 May 2018 17:47:17 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id x186-v6sm24392155qkc.10.2018.05.29.17.47.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 17:47:16 -0700 (PDT) Date: Tue, 29 May 2018 21:47:13 -0300 From: Rodrigo Siqueira To: Petri Latvala , Arkadiusz Hiler Message-ID: <491079aa8b1be2e1f6f79aee7b08aa5ca1d42098.1527639529.git.rodrigosiqueiramelo@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180512 Subject: [Intel-gfx] [PATCH 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 Reviewed-by: Arkadiusz Hiler --- 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);