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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 A65DCC2D0E4 for ; Tue, 24 Nov 2020 06:25:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4EF952076C for ; Tue, 24 Nov 2020 06:25:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729682AbgKXGZ1 (ORCPT ); Tue, 24 Nov 2020 01:25:27 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:25590 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728206AbgKXGZ0 (ORCPT ); Tue, 24 Nov 2020 01:25:26 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4CgDXf6Njsz9tySl; Tue, 24 Nov 2020 07:25:22 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id AyR_J6UbZGd2; Tue, 24 Nov 2020 07:25:22 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4CgDXf4sRqz9tySj; Tue, 24 Nov 2020 07:25:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 578B18B7A3; Tue, 24 Nov 2020 07:25:23 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id FPOuEZrcpiaZ; Tue, 24 Nov 2020 07:25:23 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4D86E8B79F; Tue, 24 Nov 2020 07:25:22 +0100 (CET) Subject: Re: [PATCH v2 11/19] mm/mmap: Make vm_special_mapping::mremap return void To: Dmitry Safonov , linux-kernel@vger.kernel.org Cc: Dmitry Safonov <0x7f454c46@gmail.com>, Alexander Viro , Andrew Morton , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Guo Ren , "H. Peter Anvin" , Ingo Molnar , Oleg Nesterov , Russell King , Thomas Bogendoerfer , Thomas Gleixner , Vincenzo Frascino , Will Deacon , x86@kernel.org References: <20201124002932.1220517-1-dima@arista.com> <20201124002932.1220517-12-dima@arista.com> From: Christophe Leroy Message-ID: Date: Tue, 24 Nov 2020 07:25:22 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20201124002932.1220517-12-dima@arista.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 24/11/2020 à 01:29, Dmitry Safonov a écrit : > Previously .mremap() callback needed (int) return to provide way to > restrict resizing of a special mapping. Now it's restricted by > providing .may_split = special_mapping_split. > > Removing (int) return simplifies further changes to > special_mapping_mremap() as it won't need save ret code from the > callback. Also, it removes needless `return 0` from callbacks. > > Signed-off-by: Dmitry Safonov > --- > arch/arm/kernel/process.c | 3 +-- > arch/arm64/kernel/vdso.c | 4 +--- > arch/mips/vdso/genvdso.c | 3 +-- > arch/x86/entry/vdso/vma.c | 4 +--- > include/linux/mm_types.h | 2 +- > mm/mmap.c | 2 +- > 6 files changed, 6 insertions(+), 12 deletions(-) > > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 65df8abd90bd..95a257927dae 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -780,7 +780,7 @@ struct vm_special_mapping { > struct vm_area_struct *vma, > struct vm_fault *vmf); > > - int (*mremap)(const struct vm_special_mapping *sm, > + void (*mremap)(const struct vm_special_mapping *sm, > struct vm_area_struct *new_vma); Second line should be aligned to first line's parenthesis I think. > }; > > diff --git a/mm/mmap.c b/mm/mmap.c > index d0d458632c1b..17fe59a9780b 100644 > --- a/mm/mmap.c > +++ b/mm/mmap.c > @@ -3433,7 +3433,7 @@ static int special_mapping_mremap(struct vm_area_struct *new_vma, > return -EFAULT; > > if (sm->mremap) > - return sm->mremap(sm, new_vma); > + sm->mremap(sm, new_vma); > > return 0; > } >