lkml.org 
[lkml]   [2015]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Xen-devel] [PATCH 3/3] xen: use correct type for physical addresses
>>> On 08.01.15 at 18:01, <JGross@suse.com> wrote:
> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -140,7 +140,7 @@ static void __init xen_del_extra_mem(u64 start, u64 size)
> unsigned long __ref xen_chk_extra_mem(unsigned long pfn)
> {
> int i;
> - unsigned long addr = PFN_PHYS(pfn);
> + u64 addr = PFN_PHYS(pfn);

Isn't phys_addr_t the type to use here?

> @@ -284,7 +286,7 @@ static void __init xen_update_mem_tables(unsigned long pfn, unsigned long mfn)
> }
>
> /* Update kernel mapping, but not for highmem. */
> - if ((pfn << PAGE_SHIFT) >= __pa(high_memory))
> + if (PFN_PHYS(pfn) >= (u64)(__pa(high_memory)))

I don't think you really need the cast on the right side - __pa()
should be returning a value of suitable type (and unsigned long
would be sufficient for anything up to and including high_memory).

Jan



\
 
 \ /
  Last update: 2015-01-09 11:21    [W:0.158 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site