Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1370433

Re: [PATCH 1/4] mm: add is_highmem_addr() helper

From Vignesh R <vigneshr@ti.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/4] mm: add is_highmem_addr() helper
Date 2016-04-04 10:20 +0200
Message-ID <rk7TQ-e4-17@gated-at.bofh.it> (permalink)
References <riK3g-531-23@gated-at.bofh.it> <riK3g-531-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

On 03/31/2016 05:59 PM, Boris Brezillon wrote:
> Add an helper to check if a virtual address is in the highmem region.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> ---
>  include/linux/highmem.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/include/linux/highmem.h b/include/linux/highmem.h
> index bb3f329..13dff37 100644
> --- a/include/linux/highmem.h
> +++ b/include/linux/highmem.h
> @@ -41,6 +41,14 @@ void kmap_flush_unused(void);
>  
>  struct page *kmap_to_page(void *addr);
>  
> +static inline bool is_highmem_addr(const void *x)
> +{
> +	unsigned long vaddr = (unsigned long)x;
> +
> +	return vaddr >=  PKMAP_BASE &&
> +	       vaddr < ((PKMAP_BASE + LAST_PKMAP) * PAGE_SIZE);


Shouldn't this be:
		vaddr < (PKMAP_BASE + (LAST_PKMAP * PAGE_SIZE)) ?

-- 
Regards
Vignesh

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/4] mm: add is_highmem_addr() helper Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-03-31 14:40 +0200
  Re: [PATCH 1/4] mm: add is_highmem_addr() helper Vignesh R <vigneshr@ti.com> - 2016-04-04 10:20 +0200
    Re: [PATCH 1/4] mm: add is_highmem_addr() helper Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-04-04 17:10 +0200

csiph-web