linux-mips
[Top] [All Lists]

[loongson-PATCH-v2 02/23] fix-warning: incompatible argument type of vir

To: linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>
Subject: [loongson-PATCH-v2 02/23] fix-warning: incompatible argument type of virt_to_phys
From: wuzhangjin@gmail.com
Date: Wed, 27 May 2009 03:02:23 +0800
Cc: Wu Zhangjin <wuzj@lemote.com>, Yan Hua <yanh@lemote.com>, Philippe Vachon <philippe@cowpig.ca>, Zhang Le <r0bertz@gentoo.org>, Zhang Fuxin <zhangfx@lemote.com>, loongson-dev <loongson-dev@googlegroups.com>, Nicholas Mc Guire <der.herr@hofr.at>, Liu Junliang <liujl@lemote.com>, Erwan Lerale <erwan@thiscow.com>, Wu Zhangjin <wuzhangjin@gmail.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references:mime-version :content-type:content-transfer-encoding; bh=230mElEDum++8i0fzb0dYnFrkeSdyNZuydbhkNKPEXY=; b=EHwTH3Wgeh04uJc5h6+5By0zpn8iulHEzXU9hDqNpA2tRfhocQjT2MgYRn7RSg4hYB OtddWRGuqSOfBSGNFOGvYIKKm5Y9Bafhy6AG1SGGjN8rCtzTpwE7zeSASn3S90P27AYF Wi1VG1KFOj3xNr2DL9pQaC8abywEmi01SHpbk=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:content-transfer-encoding; b=vaKVF8H751tkvHYbyTEW1w25qN4P4GvgyLjMiOLkOWbRnJf8yBOqBy/Lhtm1eI05my dDemO5zfq6SzPmR9z12aRtz7BczgUEQMVFykeegGjeckXZw2FoThDzj1Xl0JQqc45x8D LKXQCn5KzNXyfVqIH0XimfL+zt2bhV8LiDX0c=
In-reply-to: <cover.1243362545.git.wuzj@lemote.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <cover.1243362545.git.wuzj@lemote.com>
Sender: linux-mips-bounce@linux-mips.org
From: Wu Zhangjin <wuzj@lemote.com>

mm/page_alloc.c:1760: warning: passing argument 1 of ‘virt_to_phys’
makes pointer from integer without a cast

mm/page_alloc.c:1760
        ...
        unsigned long addr;
        ...
        split_page(virt_to_page(addr), order);

arch/mips/include/asm/page.h

        #define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr)))
        #define virt_addr_valid(kaddr)  pfn_valid(PFN_DOWN(virt_to_phys(kaddr)))

arch/mips/include/asm/io.h
        static inline unsigned long virt_to_phys(volatile const void *address)

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
---
 arch/mips/include/asm/page.h |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 9f946e4..d148e87 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -179,8 +179,9 @@ typedef struct { unsigned long pgprot; } pgprot_t;
 
 #endif
 
-#define virt_to_page(kaddr)    pfn_to_page(PFN_DOWN(virt_to_phys(kaddr)))
-#define virt_addr_valid(kaddr) pfn_valid(PFN_DOWN(virt_to_phys(kaddr)))
+#define virt_to_page(kaddr) \
+       pfn_to_page(PFN_DOWN(virt_to_phys((void *)kaddr)))
+#define virt_addr_valid(kaddr) pfn_valid(PFN_DOWN(virt_to_phys((void *)kaddr)))
 
 #define VM_DATA_DEFAULT_FLAGS  (VM_READ | VM_WRITE | VM_EXEC | \
                                 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
-- 
1.6.0.4


<Prev in Thread] Current Thread [Next in Thread>