From: Ralph Campbell Date: Thu, 16 Nov 2017 01:34:00 +0000 (-0800) Subject: mm/hmm: constify hmm_devmem_page_get_drvdata() parameter X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0bea803e9e6bf3836d5368a6426c30a8c0e5eab5;p=linux.git mm/hmm: constify hmm_devmem_page_get_drvdata() parameter Constify pointer parameter to avoid issue when use from code that only has const struct page pointer to use in the first place. Link: http://lkml.kernel.org/r/1506972774-10191-1-git-send-email-jglisse@redhat.com Signed-off-by: Ralph Campbell Signed-off-by: Jérôme Glisse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/hmm.h b/include/linux/hmm.h index 96e69979f84d7..325017ad93117 100644 --- a/include/linux/hmm.h +++ b/include/linux/hmm.h @@ -471,9 +471,9 @@ static inline void hmm_devmem_page_set_drvdata(struct page *page, * @page: pointer to struct page * Return: driver data value */ -static inline unsigned long hmm_devmem_page_get_drvdata(struct page *page) +static inline unsigned long hmm_devmem_page_get_drvdata(const struct page *page) { - unsigned long *drvdata = (unsigned long *)&page->pgmap; + const unsigned long *drvdata = (const unsigned long *)&page->pgmap; return drvdata[1]; }