From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54F6BC43463 for ; Mon, 21 Sep 2020 06:28:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C5302084C for ; Mon, 21 Sep 2020 06:28:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="eHeD509S" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726412AbgIUG2Y (ORCPT ); Mon, 21 Sep 2020 02:28:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726384AbgIUG2Y (ORCPT ); Mon, 21 Sep 2020 02:28:24 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBA6BC061755; Sun, 20 Sep 2020 23:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Tci2tqg3leIbmrKKmdytiLIb3svt+yq3AUhipK0JnoY=; b=eHeD509SDxyAiHGiTwo9U9RK6O BdV0ol0+bUl0JcuR4cH5K4iJppCvrjMC+FXmd1lF9otzHdHbgaqWCPBbYEVccspM4hNb0ELFrDX41 s330N9PwkKFmY1+L4xtZqC6TuuZXPpHTsXwNy2mxRh6hHZxeOvX7QA3hIrIh11xqjXXtgY0KOrH1g TAa/FH4UUQzLwOqDXwmFk20iXdkTE1C5bNJ47X+kA8GBuFsMKdIwnr8VE2F05aYZUn3BWrCVUA/8S mbIk+BpzsIVAf7vJcwgjD0vdvWTXz3H9YwI8DG/vud/142FwM17JAPgxfqgTAucNSaDR8ooXWbNYe L6UrCpkA==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKFJD-0000eG-TH; Mon, 21 Sep 2020 06:28:19 +0000 Date: Mon, 21 Sep 2020 07:28:19 +0100 From: Christoph Hellwig To: Thomas Gleixner Cc: LKML , linux-arch@vger.kernel.org, Linus Torvalds , Paul McKenney , x86@kernel.org, Sebastian Andrzej Siewior , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Will Deacon , Andrew Morton , Linux-MM , Russell King , Linux ARM , Chris Zankel , Max Filippov , linux-xtensa@linux-xtensa.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , intel-gfx , dri-devel , Ard Biesheuvel , Herbert Xu , Vineet Gupta , linux-snps-arc@lists.infradead.org, Arnd Bergmann , Guo Ren , linux-csky@vger.kernel.org, Michal Simek , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Nick Hu , Greentime Hu , Vincent Chen , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, "David S. Miller" , sparclinux@vger.kernel.org Subject: Re: [patch RFC 02/15] highmem: Provide generic variant of kmap_atomic* Message-ID: <20200921062819.GB32081@infradead.org> References: <20200919091751.011116649@linutronix.de> <20200919092615.990731525@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200919092615.990731525@linutronix.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-csky@vger.kernel.org > +# ifndef ARCH_NEEDS_KMAP_HIGH_GET > +static inline void *arch_kmap_temporary_high_get(struct page *page) > +{ > + return NULL; > +} > +# endif Turn this into a macro and use #ifndef on the symbol name? > +static inline void __kunmap_atomic(void *addr) > +{ > + kumap_atomic_indexed(addr); > +} > + > + > +#endif /* CONFIG_KMAP_ATOMIC_GENERIC */ Stange double empty line above the endif. > -#define kunmap_atomic(addr) \ > -do { \ > - BUILD_BUG_ON(__same_type((addr), struct page *)); \ > - kunmap_atomic_high(addr); \ > - pagefault_enable(); \ > - preempt_enable(); \ > -} while (0) > - > +#define kunmap_atomic(addr) \ > + do { \ > + BUILD_BUG_ON(__same_type((addr), struct page *)); \ > + __kunmap_atomic(addr); \ > + preempt_enable(); \ > + } while (0) Why the strange re-indent to a form that is much less common and less readable? > +void *kmap_atomic_pfn_prot(unsigned long pfn, pgprot_t prot) > +{ > + pagefault_disable(); > + return __kmap_atomic_pfn_prot(pfn, prot); > +} > +EXPORT_SYMBOL(kmap_atomic_pfn_prot); The existing kmap_atomic_pfn & co implementation is EXPORT_SYMBOL_GPL, and this stuff should preferably stay that way.