diff mbox

arm/xen: Remove definiition of virt_to_pfn in asm/xen/page.h

Message ID 1397836474-10478-1-git-send-email-julien.grall@linaro.org
State Accepted
Commit 063aa8e68e53cc0d0961ea90c12cea40c6b94828
Headers show

Commit Message

Julien Grall April 18, 2014, 3:54 p.m. UTC
virt_to_pfn has been defined in asm/memory.h by the commit e26a9e0 "ARM: Better
virt_to_page() handling"

This will result of a compilation warning when CONFIG_XEN is enabled.

arch/arm/include/asm/xen/page.h:80:0: warning: "virt_to_pfn" redefined [enabled by default]
 #define virt_to_pfn(v)          (PFN_DOWN(__pa(v)))
 ^
In file included from arch/arm/include/asm/page.h:163:0,
                 from arch/arm/include/asm/xen/page.h:4,
                 from include/xen/page.h:4,
                 from arch/arm/xen/grant-table.c:33:

The definition in memory.h is nearly the same (it directly expand PFN_DOWN),
so we can safely drop virt_to_pfn in xen include.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 arch/arm/include/asm/xen/page.h |    1 -
 1 file changed, 1 deletion(-)

Comments

David Vrabel April 24, 2014, 12:22 p.m. UTC | #1
On 18/04/14 16:54, Julien Grall wrote:
> virt_to_pfn has been defined in asm/memory.h by the commit e26a9e0 "ARM: Better
> virt_to_page() handling"
> 
> This will result of a compilation warning when CONFIG_XEN is enabled.
> 
> arch/arm/include/asm/xen/page.h:80:0: warning: "virt_to_pfn" redefined [enabled by default]
>  #define virt_to_pfn(v)          (PFN_DOWN(__pa(v)))
>  ^
> In file included from arch/arm/include/asm/page.h:163:0,
>                  from arch/arm/include/asm/xen/page.h:4,
>                  from include/xen/page.h:4,
>                  from arch/arm/xen/grant-table.c:33:
> 
> The definition in memory.h is nearly the same (it directly expand PFN_DOWN),
> so we can safely drop virt_to_pfn in xen include.


This breaks the arm build for me.

/local/davidvr/work/k.org/tip/drivers/block/xen-blkfront.c: In function
‘setup_blkring’:
/local/davidvr/work/k.org/tip/drivers/block/xen-blkfront.c:1236:2:
error: implicit declaration of function ‘virt_to_pfn’
[-Werror=implicit-function-declaration]
  err = xenbus_grant_ring(dev, virt_to_mfn(info->ring.sring));
  ^

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Julien Grall April 24, 2014, 12:49 p.m. UTC | #2
Hi David,

On 04/24/2014 01:22 PM, David Vrabel wrote:
> On 18/04/14 16:54, Julien Grall wrote:
>> virt_to_pfn has been defined in asm/memory.h by the commit e26a9e0 "ARM: Better
>> virt_to_page() handling"
>>
>> This will result of a compilation warning when CONFIG_XEN is enabled.
>>
>> arch/arm/include/asm/xen/page.h:80:0: warning: "virt_to_pfn" redefined [enabled by default]
>>  #define virt_to_pfn(v)          (PFN_DOWN(__pa(v)))
>>  ^
>> In file included from arch/arm/include/asm/page.h:163:0,
>>                  from arch/arm/include/asm/xen/page.h:4,
>>                  from include/xen/page.h:4,
>>                  from arch/arm/xen/grant-table.c:33:
>>
>> The definition in memory.h is nearly the same (it directly expand PFN_DOWN),
>> so we can safely drop virt_to_pfn in xen include.
> 
> 
> This breaks the arm build for me.
> 
> /local/davidvr/work/k.org/tip/drivers/block/xen-blkfront.c: In function
> ‘setup_blkring’:
> /local/davidvr/work/k.org/tip/drivers/block/xen-blkfront.c:1236:2:
> error: implicit declaration of function ‘virt_to_pfn’
> [-Werror=implicit-function-declaration]
>   err = xenbus_grant_ring(dev, virt_to_mfn(info->ring.sring));
>   ^

I don't have any issue to build the following branch with this patch on:
	- v3.15-rc2
	- xentip master
	- xentip for-linus-3.16

Regards,
David Vrabel April 24, 2014, 2:11 p.m. UTC | #3
On 24/04/14 13:49, Julien Grall wrote:
> Hi David,
> 
> On 04/24/2014 01:22 PM, David Vrabel wrote:
>> On 18/04/14 16:54, Julien Grall wrote:
>>> virt_to_pfn has been defined in asm/memory.h by the commit e26a9e0 "ARM: Better
>>> virt_to_page() handling"
>>>
>>> This will result of a compilation warning when CONFIG_XEN is enabled.
>>>
>>> arch/arm/include/asm/xen/page.h:80:0: warning: "virt_to_pfn" redefined [enabled by default]
>>>  #define virt_to_pfn(v)          (PFN_DOWN(__pa(v)))
>>>  ^
>>> In file included from arch/arm/include/asm/page.h:163:0,
>>>                  from arch/arm/include/asm/xen/page.h:4,
>>>                  from include/xen/page.h:4,
>>>                  from arch/arm/xen/grant-table.c:33:
>>>
>>> The definition in memory.h is nearly the same (it directly expand PFN_DOWN),
>>> so we can safely drop virt_to_pfn in xen include.
>>
>>
>> This breaks the arm build for me.
>>
>> /local/davidvr/work/k.org/tip/drivers/block/xen-blkfront.c: In function
>> ‘setup_blkring’:
>> /local/davidvr/work/k.org/tip/drivers/block/xen-blkfront.c:1236:2:
>> error: implicit declaration of function ‘virt_to_pfn’
>> [-Werror=implicit-function-declaration]
>>   err = xenbus_grant_ring(dev, virt_to_mfn(info->ring.sring));
>>   ^
> 
> I don't have any issue to build the following branch with this patch on:
> 	- v3.15-rc2
> 	- xentip master
> 	- xentip for-linus-3.16

Applied to devel/for-linus-3.16.

If something else turns up for 3.15 (and I remember) I'll take it for
3.15 instead.

Thanks.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Stefano Stabellini April 25, 2014, 5:05 p.m. UTC | #4
On Thu, 24 Apr 2014, David Vrabel wrote:
> On 24/04/14 13:49, Julien Grall wrote:
> > Hi David,
> > 
> > On 04/24/2014 01:22 PM, David Vrabel wrote:
> >> On 18/04/14 16:54, Julien Grall wrote:
> >>> virt_to_pfn has been defined in asm/memory.h by the commit e26a9e0 "ARM: Better
> >>> virt_to_page() handling"
> >>>
> >>> This will result of a compilation warning when CONFIG_XEN is enabled.
> >>>
> >>> arch/arm/include/asm/xen/page.h:80:0: warning: "virt_to_pfn" redefined [enabled by default]
> >>>  #define virt_to_pfn(v)          (PFN_DOWN(__pa(v)))
> >>>  ^
> >>> In file included from arch/arm/include/asm/page.h:163:0,
> >>>                  from arch/arm/include/asm/xen/page.h:4,
> >>>                  from include/xen/page.h:4,
> >>>                  from arch/arm/xen/grant-table.c:33:
> >>>
> >>> The definition in memory.h is nearly the same (it directly expand PFN_DOWN),
> >>> so we can safely drop virt_to_pfn in xen include.
> >>
> >>
> >> This breaks the arm build for me.
> >>
> >> /local/davidvr/work/k.org/tip/drivers/block/xen-blkfront.c: In function
> >> ‘setup_blkring’:
> >> /local/davidvr/work/k.org/tip/drivers/block/xen-blkfront.c:1236:2:
> >> error: implicit declaration of function ‘virt_to_pfn’
> >> [-Werror=implicit-function-declaration]
> >>   err = xenbus_grant_ring(dev, virt_to_mfn(info->ring.sring));
> >>   ^
> > 
> > I don't have any issue to build the following branch with this patch on:
> > 	- v3.15-rc2
> > 	- xentip master
> > 	- xentip for-linus-3.16
> 
> Applied to devel/for-linus-3.16.
> 
> If something else turns up for 3.15 (and I remember) I'll take it for
> 3.15 instead.

David,
thank you very much for taking the patch in my absence.

Considering that the problem is affecting everybody enabling CONFIG_XEN
on ARM on v3.15, I don't think we can wait for the next merge window to
send this fix upstream.
Too many warnings for too many people.

Cheers,

Stefano
diff mbox

Patch

diff --git a/arch/arm/include/asm/xen/page.h b/arch/arm/include/asm/xen/page.h
index cf4f3e8..ded062f 100644
--- a/arch/arm/include/asm/xen/page.h
+++ b/arch/arm/include/asm/xen/page.h
@@ -77,7 +77,6 @@  static inline xpaddr_t machine_to_phys(xmaddr_t machine)
 }
 /* VIRT <-> MACHINE conversion */
 #define virt_to_machine(v)	(phys_to_machine(XPADDR(__pa(v))))
-#define virt_to_pfn(v)          (PFN_DOWN(__pa(v)))
 #define virt_to_mfn(v)		(pfn_to_mfn(virt_to_pfn(v)))
 #define mfn_to_virt(m)		(__va(mfn_to_pfn(m) << PAGE_SHIFT))