Re: [PATCH 2/3] m68k/page_no.h: force __va argument to be unsigned long

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue 03-07-18 18:47:51, Mike Rapoport wrote:
On Tue, Jul 03, 2018 at 05:14:01PM +0200, Michal Hocko wrote:
On Tue 03-07-18 08:05:35, Matthew Wilcox wrote:
On Tue, Jul 03, 2018 at 06:03:16PM +0300, Mike Rapoport wrote:
On Tue, Jul 03, 2018 at 04:20:54PM +0200, Michal Hocko wrote:
On Tue 03-07-18 13:29:54, Mike Rapoport wrote:
Add explicit casting to unsigned long to the __va() parameter

Why is this needed?

To make it consitent with other architecures and asm-generic :)

But more importantly, __memblock_free_late() passes u64 to page_to_pfn().

Why does memblock work in terms of u64 instead of phys_addr_t?

Yes, phys_addr_t was exactly that came to my mind as well. Casting
physical address to unsigned long just screams for potential problems.

Not sure if for m68k-nommu the physical address can really go beyond 32
bits, but in general this is something that should be taken care of.

I think adding the cast in m68k-nommu case is a viable band aid to allow
sorting out the bootmem vs nobootmem.

In any case care should be taken of all those

	#define __va(x)	((void *)((unsigned long)(x))) 

Yeah, sounds like a good idea to me.

all around.

Regardless, I can s/u64/phys_addr_t/ in memblock.c.

Yeah, sounds like a good thing to me.

-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux