diff mbox series

[ndctl,1/4] ndctl/test: Fix btt expect table compile warning

Message ID 161052209839.1804207.11951679046842122849.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State New
Headers show
Series ndctl/test: softoffline, mremap, and misc fixups | expand

Commit Message

Williams, Dan J Jan. 13, 2021, 7:14 a.m. UTC
../test/libndctl.c:989:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  989 |  unsigned long long expect_table[][2] = {
      |  ^~~~~~~~

...just move the declaration a few lines up.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 test/libndctl.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/test/libndctl.c b/test/libndctl.c
index 24d72b382239..fc651499cc86 100644
--- a/test/libndctl.c
+++ b/test/libndctl.c
@@ -980,12 +980,6 @@  static int check_btt_size(struct ndctl_btt *btt)
 	struct ndctl_ctx *ctx = ndctl_btt_get_ctx(btt);
 	struct ndctl_test *test = ndctl_get_private_data(ctx);
 	struct ndctl_namespace *ndns = ndctl_btt_get_namespace(btt);
-
-	if (!ndns)
-		return -ENXIO;
-
-	ns_size = ndctl_namespace_get_size(ndns);
-	sect_size = ndctl_btt_get_sector_size(btt);
 	unsigned long long expect_table[][2] = {
 		[0] = {
 			[0] = 0x11b5400,
@@ -1001,6 +995,12 @@  static int check_btt_size(struct ndctl_btt *btt)
 		},
 	};
 
+	if (!ndns)
+		return -ENXIO;
+
+	ns_size = ndctl_namespace_get_size(ndns);
+	sect_size = ndctl_btt_get_sector_size(btt);
+
 	if (sect_size >= SZ_4K)
 		sect_select = 1;
 	else if (sect_size >= 512)