From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751337AbdJBSih (ORCPT ); Mon, 2 Oct 2017 14:38:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50500 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751120AbdJBSig (ORCPT ); Mon, 2 Oct 2017 14:38:36 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 45990C058ECA Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jglisse@redhat.com From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= To: , linux-mm@kvack.org Cc: Ralph Campbell , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Andrew Morton Subject: [PATCH] mm/hmm: constify hmm_devmem_page_get_drvdata() parameter Date: Mon, 2 Oct 2017 15:32:54 -0400 Message-Id: <1506972774-10191-1-git-send-email-jglisse@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 02 Oct 2017 18:38:36 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ralph Campbell Constify pointer parameter to avoid issue when use from code that only has const struct page pointer to use in the first place. Signed-off-by: Ralph Campbell Signed-off-by: Jérôme Glisse Cc: Andrew Morton --- include/linux/hmm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/hmm.h b/include/linux/hmm.h index 96e6997..325017a 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]; } -- 2.4.11