linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
	Goldwyn Rodrigues <rgoldwyn@suse.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] md: fix 32-bit build warning
Date: Thu, 15 Oct 2015 09:11:28 +1100	[thread overview]
Message-ID: <876129xfqn.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <11281560.gJ28rX782P@wuerfel>

[-- Attachment #1: Type: text/plain, Size: 1838 bytes --]

Arnd Bergmann <arnd@arndb.de> writes:

> On Monday 12 October 2015 15:59:27 Neil Brown wrote:
>> > 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);
>> >       }
>> >  
>> 
>> Thanks, but is this really right?
>> I think u64 is "unsigned long" on 64bit.
>> I have always used (unsigned long long) when I want to use %llu on
>> sector_t.
>> 
>> How confident are you of using "u64" ?
>
> Very confident ;-)
>
> This used to not work until some linux-2.6 version when we changed all
> architectures to use asm-generic/int-ll64.h in the kernel, because
> a lot of code relied on printing u64 variables using %lld.
>
> I tend to use u64 for things like this because it's shorter than
> 'unsigned long long'.
>

Ahh.. good to know - thanks.

It seems that we've since removed those 'pr_info' lines, so there is
nothing to fix any more.  I'll remember that about using "u64" though -
using "unsigned long long" always felt so clumsy.

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

      reply	other threads:[~2015-10-14 22:11 UTC|newest]

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

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=876129xfqn.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=rgoldwyn@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).