public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] md: fix 32-bit build warning
Date: Fri, 09 Oct 2015 14:12:36 +0200	[thread overview]
Message-ID: <5304496.D8N6u074t0@wuerfel> (raw)

On 32-bit architectures, the md code produces this warning when CONFIG_LDAF
is set:

drivers/md/md.c: In function 'check_sb_changes':
drivers/md/md.c:8990:10: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'sector_t {aka long long unsigned int}' [-Wformat=]
   pr_info("%s:%d recovery_cp changed from %lu to %lu\n", __func__,

The code was only recently introduced, and uses the wrong format string
for sector_t. As a workaround, this patch adds an explicit cast to 'u64'
so we can use the %llu format string on all architectures.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: e0212320066e ("md-cluster: Improve md_reload_sb to be less error prone")
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
---

I also noticed that some commmits in md/for-next including the one causing
the problem lack a Signed-off-by line. It might make sense to just fold this
patch and add the lines at the same time.

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 7fff1e6884d6..e13f72a3b561 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -8987,9 +8987,9 @@ static void check_sb_changes(struct mddev *mddev, struct md_rdev *rdev)
 
 	/* recovery_cp changed */
 	if (le64_to_cpu(sb->resync_offset) != mddev->recovery_cp) {
-		pr_info("%s:%d recovery_cp changed from %lu to %lu\n", __func__,
-				__LINE__, mddev->recovery_cp,
-				(unsigned long) le64_to_cpu(sb->resync_offset));
+		pr_info("%s:%d recovery_cp changed from %llu to %llu\n", __func__,
+				__LINE__, (u64)mddev->recovery_cp,
+				(u64) le64_to_cpu(sb->resync_offset));
 		mddev->recovery_cp = le64_to_cpu(sb->resync_offset);
 	}
 

             reply	other threads:[~2015-10-09 12:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09 12:12 Arnd Bergmann [this message]
2015-10-12  4:59 ` [PATCH] md: fix 32-bit build warning Neil Brown
2015-10-12  9:30   ` Arnd Bergmann
2015-10-14 22:11     ` Neil Brown

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=5304496.D8N6u074t0@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox