From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com ([134.134.136.31]:63955 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725320AbfFJE5c (ORCPT ); Mon, 10 Jun 2019 00:57:32 -0400 Subject: Re: [RFC V3] mm: Generalize and rename notify_page_fault() as kprobe_page_fault() References: <1559903655-5609-1-git-send-email-anshuman.khandual@arm.com> <20190607201202.GA32656@bombadil.infradead.org> From: Dave Hansen Message-ID: <33c6a1cd-5c07-e623-28e5-f31f6fe30394@intel.com> Date: Sun, 9 Jun 2019 21:57:29 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-s390-owner@vger.kernel.org List-ID: To: Anshuman Khandual , Matthew Wilcox Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org, Andrew Morton , Michal Hocko , Mark Rutland , Christophe Leroy , Stephen Rothwell , Andrey Konovalov , Michael Ellerman , Paul Mackerras , Russell King , Catalin Marinas , Will Deacon , Tony Luck , Fenghua Yu , Martin Schwidefsky , Heiko Carstens , Yoshinori Sato , "David S. Miller" , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Andy Lutomirski , Dave Hansen , Vineet Gupta , linux-snps-arc@lists.infradead.org, James Hogan , linux-mips@vger.kernel.org, Ralf Baechle , Paul Burton On 6/9/19 9:34 PM, Anshuman Khandual wrote: >> Do you really think this is easier to read? >> >> Why not just move the x86 version to include/linux/kprobes.h, and replace >> the int with bool? > Will just return bool directly without an additional variable here as suggested > before. But for the conditional statement, I guess the proposed one here is more > compact than the x86 one. FWIW, I don't think "compact" is generally a good goal for code. Being readable is 100x more important than being compact and being un-compact is only a problem when it hurts readability. For a function like the one in question, having the individual return conditions clearly commented is way more important than saving 10 lines of code.