From: Jason Gunthorpe Date: Fri, 21 Jun 2019 14:41:31 +0000 Subject: Re: [PATCH 11/16] mm: consolidate the get_user_pages* implementations Message-Id: <20190621144131.GQ19891@ziepe.ca> List-Id: References: <20190611144102.8848-1-hch@lst.de> <20190611144102.8848-12-hch@lst.de> In-Reply-To: <20190611144102.8848-12-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Christoph Hellwig Cc: Linus Torvalds , Paul Burton , James Hogan , Yoshinori Sato , Rich Felker , "David S. Miller" , Nicholas Piggin , Khalid Aziz , Andrey Konovalov , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linux-mips@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-kernel@vger.kernel.org On Tue, Jun 11, 2019 at 04:40:57PM +0200, Christoph Hellwig wrote: > @@ -2168,7 +2221,7 @@ static void gup_pgd_range(unsigned long addr, unsigned long end, > */ > static bool gup_fast_permitted(unsigned long start, unsigned long end) > { > - return true; > + return IS_ENABLED(CONFIG_HAVE_FAST_GUP) ? true : false; The ?: is needed with IS_ENABLED? > } > #endif Oh, you fixed the util.c this way instead of the headerfile #ifdef.. I'd suggest to revise this block a tiny bit: -#ifndef gup_fast_permitted +#if !IS_ENABLED(CONFIG_HAVE_FAST_GUP) || !defined(gup_fast_permitted) /* * Check if it's allowed to use __get_user_pages_fast() for the range, or * we need to fall back to the slow version: */ -bool gup_fast_permitted(unsigned long start, int nr_pages) +static bool gup_fast_permitted(unsigned long start, int nr_pages) { Just in case some future arch code mismatches the header and kconfig.. Regards, Jason