anitazha / rpms / ndctl

Forked from rpms/ndctl 2 years ago
Clone

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

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