[PATCH 5/8] Silence warning in arch/powerpc/mm/ppc_mmu_32.c

Milton Miller miltonm at bga.com
Thu Jul 31 16:54:13 EST 2008


On Thu Jul 31 at 15:21:25 EST in 2008, Stephen Rothwell wrote:
> On Thu, 31 Jul 2008 13:51:43 +1000 (EST) Tony Breeds <tony at 
> bakeyournoodle.com> wrote:
>>
>> total_memory is a 'phys_addr_t', cast to unsigned long to silence
>> warning.
>>
>> diff --git a/arch/powerpc/mm/ppc_mmu_32.c 
>> b/arch/powerpc/mm/ppc_mmu_32.c
>> index c53145f..9c19655 100644
>> --- a/arch/powerpc/mm/ppc_mmu_32.c
>> +++ b/arch/powerpc/mm/ppc_mmu_32.c
>> @@ -237,7 +237,7 @@ void __init MMU_init_hw(void)
>>       Hash_end = (struct hash_pte *) ((unsigned long)Hash + 
>> Hash_size);
>>
>>       printk("Total memory = %ldMB; using %ldkB for hash table (at 
>> %p)\n",
>> -            total_memory >> 20, Hash_size >> 10, Hash);
>> +            (unsigned long)total_memory >> 20, Hash_size >> 10, 
>> Hash);
>
> Will this ever be built with CONFIG_PHYS_64BIT?

I think that is how warning originates.

But please, cast the result of the shift.  Otherwise it will print 0MB 
instead of 4096MB.

The patches for 4G ram are in on one platform and in progress on a 
second.

milton




More information about the Linuxppc-dev mailing list