Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754024Ab0KYRLq (ORCPT ); Thu, 25 Nov 2010 12:11:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:11764 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753904Ab0KYRLp (ORCPT ); Thu, 25 Nov 2010 12:11:45 -0500 Date: Thu, 25 Nov 2010 18:10:30 +0100 From: Andrea Arcangeli To: Mel Gorman Cc: linux-mm@kvack.org, Linus Torvalds , Andrew Morton , linux-kernel@vger.kernel.org, Marcelo Tosatti , Adam Litke , Avi Kivity , Hugh Dickins , Rik van Riel , Dave Hansen , Benjamin Herrenschmidt , Ingo Molnar , Mike Travis , KAMEZAWA Hiroyuki , Christoph Lameter , Chris Wright , bpicco@redhat.com, KOSAKI Motohiro , Balbir Singh , "Michael S. Tsirkin" , Peter Zijlstra , Johannes Weiner , Daisuke Nishimura , Chris Mason , Borislav Petkov Subject: Re: [PATCH 16 of 66] special pmd_trans_* functions Message-ID: <20101125171030.GQ6118@random.random> References: <522a9ff792e43eb0ec6a.1288798071@v2.random> <20101118125112.GM8135@csn.ul.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101118125112.GM8135@csn.ul.ie> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1448 Lines: 49 On Thu, Nov 18, 2010 at 12:51:12PM +0000, Mel Gorman wrote: > Usually it is insisted upon that this looks like > > static inline int pmd_trans_huge(pmd) { > return 0; > } > > I understand it's to avoid any possibility of side-effets though to have type > checking and I am 99% certain the compiler still does the right thing. Still, > with no obvious side-effects here; > > Acked-by: Mel Gorman It doesn't seem to fail build on x86-64 and x86, so it should build for all other archs too. I'm keeping this incremental at the end just in case. diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -471,10 +471,20 @@ extern void untrack_pfn_vma(struct vm_ar #endif #ifndef CONFIG_TRANSPARENT_HUGEPAGE -#define pmd_trans_huge(pmd) 0 -#define pmd_trans_splitting(pmd) 0 +static inline int pmd_trans_huge(pmd_t pmd) +{ + return 0; +} +static inline int pmd_trans_splitting(pmd_t pmd) +{ + return 0; +} #ifndef __HAVE_ARCH_PMD_WRITE -#define pmd_write(pmd) ({ BUG(); 0; }) +static inline int pmd_write(pmd_t pmd) +{ + BUG(); + return 0; +} #endif /* __HAVE_ARCH_PMD_WRITE */ #endif -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/