public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] raid: fix printk format warnings
@ 2006-10-21 18:34 Randy Dunlap
  2006-10-22  4:06 ` Neil Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2006-10-21 18:34 UTC (permalink / raw)
  To: lkml; +Cc: akpm

From: Randy Dunlap <randy.dunlap@oracle.com>

Fix printk format warnings, seen on powerpc64:
drivers/md/raid1.c:1479: warning: long long unsigned int format, long unsigned int arg (arg 4)
drivers/md/raid10.c:1475: warning: long long unsigned int format, long unsigned int arg (arg 4)

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---

 drivers/md/raid1.c  |    4 ++--
 drivers/md/raid10.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff -Naurp linux-2619-rc2g4/drivers/md/raid1.c~raid_printk linux-2619-rc2g4/drivers/md/raid1.c
--- linux-2619-rc2g4/drivers/md/raid1.c~raid_printk	2006-10-21 11:16:30.066109000 -0700
+++ linux-2619-rc2g4/drivers/md/raid1.c	2006-10-21 11:20:57.288004000 -0700
@@ -1474,8 +1474,8 @@ static void fix_read_error(conf_t *conf,
 					       "raid1:%s: read error corrected "
 					       "(%d sectors at %llu on %s)\n",
 					       mdname(mddev), s,
-					       (unsigned long long)sect +
-					           rdev->data_offset,
+					       (unsigned long long)(sect +
+					           rdev->data_offset),
 					       bdevname(rdev->bdev, b));
 				}
 			}
diff -Naurp linux-2619-rc2g4/drivers/md/raid10.c~raid_printk linux-2619-rc2g4/drivers/md/raid10.c
--- linux-2619-rc2g4/drivers/md/raid10.c~raid_printk	2006-10-20 17:38:02.799707000 -0700
+++ linux-2619-rc2g4/drivers/md/raid10.c	2006-10-21 11:21:13.430834000 -0700
@@ -1470,8 +1470,8 @@ static void fix_read_error(conf_t *conf,
 					       "raid10:%s: read error corrected"
 					       " (%d sectors at %llu on %s)\n",
 					       mdname(mddev), s,
-					       (unsigned long long)sect+
-					            rdev->data_offset,
+					       (unsigned long long)(sect +
+					            rdev->data_offset),
 					       bdevname(rdev->bdev, b));
 
 				rdev_dec_pending(rdev, mddev);


---

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] raid: fix printk format warnings
  2006-10-21 18:34 [PATCH] raid: fix printk format warnings Randy Dunlap
@ 2006-10-22  4:06 ` Neil Brown
  2006-10-22  5:14   ` Randy.Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Brown @ 2006-10-22  4:06 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: lkml, akpm

On Saturday October 21, randy.dunlap@oracle.com wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> Fix printk format warnings, seen on powerpc64:
> drivers/md/raid1.c:1479: warning: long long unsigned int format, long unsigned int arg (arg 4)
> drivers/md/raid10.c:1475: warning: long long unsigned int format, long unsigned int arg (arg 4)
> 
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> ---
> 
>  drivers/md/raid1.c  |    4 ++--
>  drivers/md/raid10.c |    4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff -Naurp linux-2619-rc2g4/drivers/md/raid1.c~raid_printk linux-2619-rc2g4/drivers/md/raid1.c
> --- linux-2619-rc2g4/drivers/md/raid1.c~raid_printk	2006-10-21 11:16:30.066109000 -0700
> +++ linux-2619-rc2g4/drivers/md/raid1.c	2006-10-21 11:20:57.288004000 -0700
> @@ -1474,8 +1474,8 @@ static void fix_read_error(conf_t *conf,
>  					       "raid1:%s: read error corrected "
>  					       "(%d sectors at %llu on %s)\n",
>  					       mdname(mddev), s,
> -					       (unsigned long long)sect +
> -					           rdev->data_offset,
> +					       (unsigned long long)(sect +
> +					           rdev->data_offset),
>  					       bdevname(rdev->bdev,
> b));

So you're saying that if you add an 'unsigned long long int' to an
'unsigned long int', the result is an 'unsigned long int'???
That is not what I would have expected.
I'm happy with the patch, but I'm very surprised that it is needed.
Is this behaviour consistent across various versions of gcc (if it is
convenient to check)??

Thanks,
NeilBrown

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] raid: fix printk format warnings
  2006-10-22  4:06 ` Neil Brown
@ 2006-10-22  5:14   ` Randy.Dunlap
  2006-10-23  1:24     ` Neil Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Randy.Dunlap @ 2006-10-22  5:14 UTC (permalink / raw)
  To: Neil Brown; +Cc: lkml, akpm

Neil Brown wrote:
> On Saturday October 21, randy.dunlap@oracle.com wrote:
>> From: Randy Dunlap <randy.dunlap@oracle.com>
>>
>> Fix printk format warnings, seen on powerpc64:
>> drivers/md/raid1.c:1479: warning: long long unsigned int format, long unsigned int arg (arg 4)
>> drivers/md/raid10.c:1475: warning: long long unsigned int format, long unsigned int arg (arg 4)
>>
>> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
>> ---
>>
>>  drivers/md/raid1.c  |    4 ++--
>>  drivers/md/raid10.c |    4 ++--
>>  2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff -Naurp linux-2619-rc2g4/drivers/md/raid1.c~raid_printk linux-2619-rc2g4/drivers/md/raid1.c
>> --- linux-2619-rc2g4/drivers/md/raid1.c~raid_printk	2006-10-21 11:16:30.066109000 -0700
>> +++ linux-2619-rc2g4/drivers/md/raid1.c	2006-10-21 11:20:57.288004000 -0700
>> @@ -1474,8 +1474,8 @@ static void fix_read_error(conf_t *conf,
>>  					       "raid1:%s: read error corrected "
>>  					       "(%d sectors at %llu on %s)\n",
>>  					       mdname(mddev), s,
>> -					       (unsigned long long)sect +
>> -					           rdev->data_offset,
>> +					       (unsigned long long)(sect +
>> +					           rdev->data_offset),
>>  					       bdevname(rdev->bdev,
>> b));
> 
> So you're saying that if you add an 'unsigned long long int' to an
> 'unsigned long int', the result is an 'unsigned long int'???
> That is not what I would have expected.
> I'm happy with the patch, but I'm very surprised that it is needed.
> Is this behaviour consistent across various versions of gcc (if it is
> convenient to check)??

I've only seen it on powerpc64.  It could well be a gcc problem AFAICT.
Feel free to drop it.  Thanks for the discussion.

gfs2 and DLM also produce about 10-12 of these warnings IIRC (still on
powerpc64).

-- 
~Randy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] raid: fix printk format warnings
  2006-10-22  5:14   ` Randy.Dunlap
@ 2006-10-23  1:24     ` Neil Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Neil Brown @ 2006-10-23  1:24 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: lkml, akpm

On Saturday October 21, randy.dunlap@oracle.com wrote:
> 
> I've only seen it on powerpc64.  It could well be a gcc problem AFAICT.
> Feel free to drop it.  Thanks for the discussion.

I think it is a gcc problem, but it is harmless to work around it, so
I'll take the patch.  Reducing warnings is a good idea.

Thanks,
NeilBrown

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-10-23  1:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-21 18:34 [PATCH] raid: fix printk format warnings Randy Dunlap
2006-10-22  4:06 ` Neil Brown
2006-10-22  5:14   ` Randy.Dunlap
2006-10-23  1:24     ` Neil Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox