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

52 lines
1.6 KiB
Diff
Raw Normal View History

From ee7fabed859d07809dc3cfe6b23b7ad3b0c6cd73 Mon Sep 17 00:00:00 2001
From: Dan Williams <dan.j.williams@intel.com>
Date: Tue, 12 Jan 2021 23:14:58 -0800
Subject: [PATCH 003/217] ndctl/test: Fix btt expect table compile warning
../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>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Link: https://lore.kernel.org/r/161052209839.1804207.11951679046842122849.stgit@dwillia2-desk3.amr.corp.intel.com
---
test/libndctl.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/test/libndctl.c b/test/libndctl.c
index 24d72b3..fc65149 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)
--
2.27.0