Blame SOURCES/0003-ndctl-test-Fix-btt-expect-table-compile-warning.patch

e0018b
From ee7fabed859d07809dc3cfe6b23b7ad3b0c6cd73 Mon Sep 17 00:00:00 2001
e0018b
From: Dan Williams <dan.j.williams@intel.com>
e0018b
Date: Tue, 12 Jan 2021 23:14:58 -0800
e0018b
Subject: [PATCH 003/217] ndctl/test: Fix btt expect table compile warning
e0018b
e0018b
../test/libndctl.c:989:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
e0018b
  989 |  unsigned long long expect_table[][2] = {
e0018b
      |  ^~~~~~~~
e0018b
e0018b
...just move the declaration a few lines up.
e0018b
e0018b
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
e0018b
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
e0018b
Link: https://lore.kernel.org/r/161052209839.1804207.11951679046842122849.stgit@dwillia2-desk3.amr.corp.intel.com
e0018b
---
e0018b
 test/libndctl.c | 12 ++++++------
e0018b
 1 file changed, 6 insertions(+), 6 deletions(-)
e0018b
e0018b
diff --git a/test/libndctl.c b/test/libndctl.c
e0018b
index 24d72b3..fc65149 100644
e0018b
--- a/test/libndctl.c
e0018b
+++ b/test/libndctl.c
e0018b
@@ -980,12 +980,6 @@ static int check_btt_size(struct ndctl_btt *btt)
e0018b
 	struct ndctl_ctx *ctx = ndctl_btt_get_ctx(btt);
e0018b
 	struct ndctl_test *test = ndctl_get_private_data(ctx);
e0018b
 	struct ndctl_namespace *ndns = ndctl_btt_get_namespace(btt);
e0018b
-
e0018b
-	if (!ndns)
e0018b
-		return -ENXIO;
e0018b
-
e0018b
-	ns_size = ndctl_namespace_get_size(ndns);
e0018b
-	sect_size = ndctl_btt_get_sector_size(btt);
e0018b
 	unsigned long long expect_table[][2] = {
e0018b
 		[0] = {
e0018b
 			[0] = 0x11b5400,
e0018b
@@ -1001,6 +995,12 @@ static int check_btt_size(struct ndctl_btt *btt)
e0018b
 		},
e0018b
 	};
e0018b
 
e0018b
+	if (!ndns)
e0018b
+		return -ENXIO;
e0018b
+
e0018b
+	ns_size = ndctl_namespace_get_size(ndns);
e0018b
+	sect_size = ndctl_btt_get_sector_size(btt);
e0018b
+
e0018b
 	if (sect_size >= SZ_4K)
e0018b
 		sect_select = 1;
e0018b
 	else if (sect_size >= 512)
e0018b
-- 
e0018b
2.27.0
e0018b