From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) by kanga.kvack.org (Postfix) with ESMTP id D89546B0036 for ; Tue, 2 Sep 2014 12:33:32 -0400 (EDT) Received: by mail-ob0-f180.google.com with SMTP id m8so5079332obr.11 for ; Tue, 02 Sep 2014 09:33:32 -0700 (PDT) Received: from avon.wwwdotorg.org (avon.wwwdotorg.org. [70.85.31.133]) by mx.google.com with ESMTPS id gv9si4502092obc.38.2014.09.02.09.33.32 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 02 Sep 2014 09:33:32 -0700 (PDT) From: Stephen Warren Subject: [PATCH] mm: fix dump_vma() compilation Date: Tue, 2 Sep 2014 10:33:16 -0600 Message-Id: <1409675596-19860-1-git-send-email-swarren@wwwdotorg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Stephen Warren , Sasha Levin , Naoya Horiguchi , "Kirill A. Shutemov" , Konstantin Khlebnikov , Rik van Riel , Mel Gorman , Michal Hocko , Hugh Dickins , Vlastimil Babka , Michel Lespinasse , Minchan Kim From: Stephen Warren dump_vma() was written to access fields within vma->vm_page_prot. However, pgprot_t is sometimes a scalar and sometimes a struct (At least on ARM; see arch/arm/include/asm/pgtable-2level-types.h). use macro pgprot_val() to get the value, so the code is immune to these differences. This fixes: mm/page_alloc.c: In function a??dump_vmaa??: mm/page_alloc.c:6742:46: error: request for member a??pgprota?? in something not a structure or union The cast is required to avoid: mm/page_alloc.c: In function a??dump_vmaa??: mm/page_alloc.c:6745:3: warning: format a??%lxa?? expects argument of type a??long unsigned inta??, but argument 8 has type a??pgprot_ta?? [-Wformat] Cc: Sasha Levin Cc: Naoya Horiguchi Cc: Kirill A. Shutemov Cc: Konstantin Khlebnikov Cc: Rik van Riel Cc: Mel Gorman Cc: Michal Hocko Cc: Hugh Dickins Cc: Vlastimil Babka Cc: Michel Lespinasse Cc: Minchan Kim Cc: Andrew Morton Fixes: 658f7da49d34 ("mm: introduce dump_vma") Signed-off-by: Stephen Warren --- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index cb510c08073b..1578bc98eb29 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6739,7 +6739,8 @@ void dump_vma(const struct vm_area_struct *vma) "prot %lx anon_vma %p vm_ops %p\n" "pgoff %lx file %p private_data %p\n", vma, (void *)vma->vm_start, (void *)vma->vm_end, vma->vm_next, - vma->vm_prev, vma->vm_mm, vma->vm_page_prot.pgprot, + vma->vm_prev, vma->vm_mm, + (unsigned long)pgprot_val(vma->vm_page_prot), vma->anon_vma, vma->vm_ops, vma->vm_pgoff, vma->vm_file, vma->vm_private_data); dump_flags(vma->vm_flags, vmaflags_names, ARRAY_SIZE(vmaflags_names)); -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org