diff mbox series

[v2,net-next,1/4] mm: constify page_is_pfmemalloc() argument

Message ID 20210127201031.98544-2-alobakin@pm.me (mailing list archive)
State New
Headers show
Series net: consolidate page_is_pfmemalloc() usage | expand

Commit Message

Alexander Lobakin Jan. 27, 2021, 8:11 p.m. UTC
The function only tests for page->index, so its argument should be
const.

Signed-off-by: Alexander Lobakin <alobakin@pm.me>
---
 include/linux/mm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Rientjes Jan. 28, 2021, 10:44 p.m. UTC | #1
On Wed, 27 Jan 2021, Alexander Lobakin wrote:

> The function only tests for page->index, so its argument should be
> const.
> 
> Signed-off-by: Alexander Lobakin <alobakin@pm.me>

Acked-by: David Rientjes <rientjes@google.com>
Jakub Kicinski Jan. 30, 2021, 2:30 a.m. UTC | #2
On Wed, 27 Jan 2021 20:11:01 +0000 Alexander Lobakin wrote:
> The function only tests for page->index, so its argument should be
> const.
> 
> Signed-off-by: Alexander Lobakin <alobakin@pm.me>
> ---
>  include/linux/mm.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index ecdf8a8cd6ae..078633d43af9 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1584,7 +1584,7 @@ struct address_space *page_mapping_file(struct page *page);
>   * ALLOC_NO_WATERMARKS and the low watermark was not
>   * met implying that the system is under some pressure.
>   */
> -static inline bool page_is_pfmemalloc(struct page *page)
> +static inline bool page_is_pfmemalloc(const struct page *page)
>  {
>  	/*
>  	 * Page index cannot be this large so this must be

No objections for this going via net-next?
diff mbox series

Patch

diff --git a/include/linux/mm.h b/include/linux/mm.h
index ecdf8a8cd6ae..078633d43af9 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1584,7 +1584,7 @@  struct address_space *page_mapping_file(struct page *page);
  * ALLOC_NO_WATERMARKS and the low watermark was not
  * met implying that the system is under some pressure.
  */
-static inline bool page_is_pfmemalloc(struct page *page)
+static inline bool page_is_pfmemalloc(const struct page *page)
 {
 	/*
 	 * Page index cannot be this large so this must be