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.5 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,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 9D5F3C2B9F4 for ; Thu, 17 Jun 2021 07:20:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6A89461241 for ; Thu, 17 Jun 2021 07:20:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229897AbhFQHW7 (ORCPT ); Thu, 17 Jun 2021 03:22:59 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:21007 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229580AbhFQHW6 (ORCPT ); Thu, 17 Jun 2021 03:22:58 -0400 Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4G5D4158LszB9Fk; Thu, 17 Jun 2021 09:20:49 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wCDKAHjRDKix; Thu, 17 Jun 2021 09:20:49 +0200 (CEST) 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 4G5D3z4bHQzB9Wp; Thu, 17 Jun 2021 09:20:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 82ED08B801; Thu, 17 Jun 2021 09:20:47 +0200 (CEST) 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 9faBJfkXW1W1; Thu, 17 Jun 2021 09:20:47 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 882DA8B770; Thu, 17 Jun 2021 09:20:46 +0200 (CEST) Subject: Re: [PATCH v3 13/23] 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: <20210611180242.711399-1-dima@arista.com> <20210611180242.711399-14-dima@arista.com> From: Christophe Leroy Message-ID: <901f4541-ee96-5d6b-5453-559731d65e82@csgroup.eu> Date: Thu, 17 Jun 2021 09:20:45 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210611180242.711399-14-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 11/06/2021 à 20:02, Dmitry Safonov a écrit : > Previously .mremap() callback had to return (int) to provide > a 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 | 4 ++-- > mm/mmap.c | 2 +- > 6 files changed, 7 insertions(+), 13 deletions(-) > Build failure: CC arch/powerpc/kernel/vdso.o arch/powerpc/kernel/vdso.c:93:19: error: initialization of 'void (*)(const struct vm_special_mapping *, struct vm_area_struct *)' from incompatible pointer type 'int (*)(const struct vm_special_mapping *, struct vm_area_struct *)' [-Werror=incompatible-pointer-types] 93 | .mremap = vdso32_mremap, | ^~~~~~~~~~~~~ arch/powerpc/kernel/vdso.c:93:19: note: (near initialization for 'vdso32_spec.mremap') arch/powerpc/kernel/vdso.c:98:19: error: initialization of 'void (*)(const struct vm_special_mapping *, struct vm_area_struct *)' from incompatible pointer type 'int (*)(const struct vm_special_mapping *, struct vm_area_struct *)' [-Werror=incompatible-pointer-types] 98 | .mremap = vdso64_mremap, | ^~~~~~~~~~~~~ arch/powerpc/kernel/vdso.c:98:19: note: (near initialization for 'vdso64_spec.mremap') cc1: all warnings being treated as errors make[3]: *** [arch/powerpc/kernel/vdso.o] Error 1 make[2]: *** [arch/powerpc/kernel] Error 2 make[1]: *** [arch/powerpc] Error 2 make: *** [__sub-make] Error 2