From: Jeff Garzik <jeff@garzik.org>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Mark Lord <liml@rtr.ca>, Tejun Heo <tj@kernel.org>,
axboe@kernel.dk, linux-kernel@vger.kernel.org,
donari75@gmail.com, linux-ide@vger.kernel.org,
alan@lxorguk.ukuu.org.uk
Subject: Re: [PATCH 2/3] mg_disk: fix CONFIG_LBD=y warning
Date: Tue, 28 Apr 2009 14:09:54 -0400 [thread overview]
Message-ID: <49F74672.2090407@garzik.org> (raw)
In-Reply-To: <200904281728.58209.bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz wrote:
> On Tuesday 28 April 2009 17:19:34 Mark Lord wrote:
>> Tejun Heo wrote:
>>> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
>>>
>>> drivers/block/mg_disk.c: In function ‘mg_dump_status’:
>>> drivers/block/mg_disk.c:265: warning: format ‘%ld’ expects type ‘long int’, but
>>> argument 2 has type ‘sector_t’
>>>
>>> [ Impact: kill build warning ]
>>>
>>> Cc: unsik Kim <donari75@gmail.com>
>>> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
>>> Signed-off-by: Tejun Heo <tj@kernel.org>
>>> ---
>>> drivers/block/mg_disk.c | 2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
>>> index d3e72ad..f389835 100644
>>> --- a/drivers/block/mg_disk.c
>>> +++ b/drivers/block/mg_disk.c
>>> @@ -79,7 +79,7 @@ static void mg_dump_status(const char *msg, unsigned int stat,
>>> if (host->breq) {
>>> req = elv_next_request(host->breq);
>>> if (req)
>>> - printk(", sector=%ld", req->sector);
>>> + printk(", sector=%u", (u32)req->sector);
>> ..
>>
>> Eh? Shouldn't that be fixed the other way around, like this:
>>
>> + printk(", sector=%llu", (u64)req->sector);
>>
>> This way, it will still give correct data when sector_t is a u64.
>
> shouldn't matter, req->sector is never > u32 for mg_disk
It never matters... until the code gets copied elsewhere. IMO wrong
code should never be kept -- "impossible to hit" just means it is low
priority :)
Jeff
next prev parent reply other threads:[~2009-04-28 18:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-28 3:52 [GIT PATCH linux-2.6-block#for-linus] block: fix hd and mg_disk Tejun Heo
2009-04-28 3:52 ` [PATCH 1/3] mg_disk: fix locking Tejun Heo
2009-04-28 3:52 ` [PATCH 2/3] mg_disk: fix CONFIG_LBD=y warning Tejun Heo
2009-04-28 15:19 ` Mark Lord
2009-04-28 15:28 ` Bartlomiej Zolnierkiewicz
2009-04-28 18:09 ` Jeff Garzik [this message]
2009-04-28 18:28 ` Bartlomiej Zolnierkiewicz
2009-04-28 3:52 ` [PATCH 3/3] hd: fix locking Tejun Heo
2009-04-28 5:36 ` [GIT PATCH linux-2.6-block#for-linus] block: fix hd and mg_disk Jens Axboe
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=49F74672.2090407@garzik.org \
--to=jeff@garzik.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=axboe@kernel.dk \
--cc=bzolnier@gmail.com \
--cc=donari75@gmail.com \
--cc=liml@rtr.ca \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.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;
as well as URLs for NNTP newsgroup(s).