* [PATCH] arm64: use is_vmalloc_addr
@ 2017-02-09 2:20 Miles Chen
2017-02-09 8:37 ` kbuild test robot
0 siblings, 1 reply; 3+ messages in thread
From: Miles Chen @ 2017-02-09 2:20 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon
Cc: linux-arm-kernel, linux-kernel, linux-mediatek, wsd_upstream, Miles Chen
To is_vmalloc_addr() to check if an address is a vmalloc address
instead of checking VMALLOC_START and VMALLOC_END manually.
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
arch/arm64/mm/ioremap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/mm/ioremap.c b/arch/arm64/mm/ioremap.c
index 01e88c8..71d6b04 100644
--- a/arch/arm64/mm/ioremap.c
+++ b/arch/arm64/mm/ioremap.c
@@ -88,7 +88,7 @@ void __iounmap(volatile void __iomem *io_addr)
* We could get an address outside vmalloc range in case
* of ioremap_cache() reusing a RAM mapping.
*/
- if (VMALLOC_START <= addr && addr < VMALLOC_END)
+ if (is_vmalloc_addr(addr))
vunmap((void *)addr);
}
EXPORT_SYMBOL(__iounmap);
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64: use is_vmalloc_addr
2017-02-09 2:20 [PATCH] arm64: use is_vmalloc_addr Miles Chen
@ 2017-02-09 8:37 ` kbuild test robot
2017-02-09 11:28 ` Miles Chen
0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2017-02-09 8:37 UTC (permalink / raw)
To: Miles Chen
Cc: kbuild-all, Catalin Marinas, Will Deacon, linux-arm-kernel,
linux-kernel, linux-mediatek, wsd_upstream, Miles Chen
[-- Attachment #1: Type: text/plain, Size: 2363 bytes --]
Hi Miles,
[auto build test WARNING on arm64/for-next/core]
[also build test WARNING on v4.10-rc7 next-20170208]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Miles-Chen/arm64-use-is_vmalloc_addr/20170209-103100
base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm64
All warnings (new ones prefixed by >>):
arch/arm64/mm/ioremap.c: In function '__iounmap':
>> arch/arm64/mm/ioremap.c:91:22: warning: passing argument 1 of 'is_vmalloc_addr' makes pointer from integer without a cast [-Wint-conversion]
if (is_vmalloc_addr(addr))
^~~~
In file included from arch/arm64/mm/ioremap.c:24:0:
include/linux/mm.h:472:20: note: expected 'const void *' but argument is of type 'long unsigned int'
static inline bool is_vmalloc_addr(const void *x)
^~~~~~~~~~~~~~~
vim +/is_vmalloc_addr +91 arch/arm64/mm/ioremap.c
75
76 void __iomem *__ioremap(phys_addr_t phys_addr, size_t size, pgprot_t prot)
77 {
78 return __ioremap_caller(phys_addr, size, prot,
79 __builtin_return_address(0));
80 }
81 EXPORT_SYMBOL(__ioremap);
82
83 void __iounmap(volatile void __iomem *io_addr)
84 {
85 unsigned long addr = (unsigned long)io_addr & PAGE_MASK;
86
87 /*
88 * We could get an address outside vmalloc range in case
89 * of ioremap_cache() reusing a RAM mapping.
90 */
> 91 if (is_vmalloc_addr(addr))
92 vunmap((void *)addr);
93 }
94 EXPORT_SYMBOL(__iounmap);
95
96 void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size)
97 {
98 /* For normal memory we already have a cacheable mapping. */
99 if (pfn_valid(__phys_to_pfn(phys_addr)))
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33971 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64: use is_vmalloc_addr
2017-02-09 8:37 ` kbuild test robot
@ 2017-02-09 11:28 ` Miles Chen
0 siblings, 0 replies; 3+ messages in thread
From: Miles Chen @ 2017-02-09 11:28 UTC (permalink / raw)
To: kbuild test robot
Cc: kbuild-all, Catalin Marinas, Will Deacon, linux-arm-kernel,
linux-kernel, linux-mediatek, wsd_upstream
On Thu, 2017-02-09 at 16:37 +0800, kbuild test robot wrote:
> Hi Miles,
>
> [auto build test WARNING on arm64/for-next/core]
> [also build test WARNING on v4.10-rc7 next-20170208]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url: https://github.com/0day-ci/linux/commits/Miles-Chen/arm64-use-is_vmalloc_addr/20170209-103100
> base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
> config: arm64-defconfig (attached as .config)
> compiler: aarch64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
> reproduce:
> wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=arm64
>
> All warnings (new ones prefixed by >>):
>
> arch/arm64/mm/ioremap.c: In function '__iounmap':
> >> arch/arm64/mm/ioremap.c:91:22: warning: passing argument 1 of 'is_vmalloc_addr' makes pointer from integer without a cast [-Wint-conversion]
> if (is_vmalloc_addr(addr))
> ^~~~
> In file included from arch/arm64/mm/ioremap.c:24:0:
> include/linux/mm.h:472:20: note: expected 'const void *' but argument is of type 'long unsigned int'
> static inline bool is_vmalloc_addr(const void *x)
> ^~~~~~~~~~~~~~~
>
Sorry for that. I'll send patch v2 without the build warning.
> vim +/is_vmalloc_addr +91 arch/arm64/mm/ioremap.c
>
> 75
> 76 void __iomem *__ioremap(phys_addr_t phys_addr, size_t size, pgprot_t prot)
> 77 {
> 78 return __ioremap_caller(phys_addr, size, prot,
> 79 __builtin_return_address(0));
> 80 }
> 81 EXPORT_SYMBOL(__ioremap);
> 82
> 83 void __iounmap(volatile void __iomem *io_addr)
> 84 {
> 85 unsigned long addr = (unsigned long)io_addr & PAGE_MASK;
> 86
> 87 /*
> 88 * We could get an address outside vmalloc range in case
> 89 * of ioremap_cache() reusing a RAM mapping.
> 90 */
> > 91 if (is_vmalloc_addr(addr))
> 92 vunmap((void *)addr);
> 93 }
> 94 EXPORT_SYMBOL(__iounmap);
> 95
> 96 void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size)
> 97 {
> 98 /* For normal memory we already have a cacheable mapping. */
> 99 if (pfn_valid(__phys_to_pfn(phys_addr)))
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-09 11:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-09 2:20 [PATCH] arm64: use is_vmalloc_addr Miles Chen
2017-02-09 8:37 ` kbuild test robot
2017-02-09 11:28 ` Miles Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).