Skip to content

Commit

Permalink
mm/hmm: constify hmm_devmem_page_get_drvdata() parameter
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Ralph Campbell <[email protected]>
Signed-off-by: Jérôme Glisse <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Ralph Campbell authored and torvalds committed Nov 16, 2017
1 parent 007ab7b commit 0bea803
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/hmm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down

0 comments on commit 0bea803

Please sign in to comment.