All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: vishal.l.verma@intel.com
Cc: linux-nvdimm@lists.01.org
Subject: [ndctl PATCH 1/4] ndctl/test: Fix btt expect table compile warning
Date: Tue, 12 Jan 2021 23:14:58 -0800	[thread overview]
Message-ID: <161052209839.1804207.11951679046842122849.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <161052209289.1804207.11599120961607513911.stgit@dwillia2-desk3.amr.corp.intel.com>

../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 --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)
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

  reply	other threads:[~2021-01-13  7:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  7:14 [ndctl PATCH 0/4] ndctl/test: softoffline, mremap, and misc fixups Dan Williams
2021-01-13  7:14 ` Dan Williams [this message]
2021-01-13  7:15 ` [ndctl PATCH 2/4] ndctl/test: Cleanup unnecessary out label Dan Williams
2021-01-13  7:15 ` [ndctl PATCH 3/4] ndctl/test: Fix device-dax mremap() test Dan Williams
2021-01-13  7:15 ` [ndctl PATCH 4/4] ndctl/test: Exercise soft_offline_page() corner cases Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=161052209839.1804207.11951679046842122849.stgit@dwillia2-desk3.amr.corp.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.