Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6445336imu; Wed, 14 Nov 2018 01:23:18 -0800 (PST) X-Google-Smtp-Source: AJdET5cMRfOGrLF8DkBwiIEdG6EgV+uZkbprI1RTOISutN5s8pE/03Fv0SVkLbkfrP/gKreEQT1/ X-Received: by 2002:a62:cf02:: with SMTP id b2-v6mr1160200pfg.224.1542187398015; Wed, 14 Nov 2018 01:23:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542187397; cv=none; d=google.com; s=arc-20160816; b=hY1mSbVsh3Ldn+PZYTPRujtnHJ+X6U2+oF4BpgRq+UIzYcDxTfxs6mb0RZji+xfLR5 24LeJXzccuaM1H35RQDP2TvETl8LfbdGQBsrbdd//p5O9LDF/9GET+zjDEjQ3vehVZJj sELmZmckkSAGycsl1k2XCw1esbeuEDIWPDR3EHngfYuwrE7JwW56+rUYZrJiluVjGCs+ RhF2qXbfyTHi9ztUKJn4eGLD2R9ji0WTpaofcwQ0i8LOEi1F0jJRpgDZxWmjjO8V1+3h Tt6tHt73oblbhd3Mk2xfjmUbAyUXVvL1nWGqqC8JRfrXfg5r4Ijtj2BVNeRZw1tGVibz eA0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=vv+0xVbfA6BUwY7ApeOtYRBrE7875d+vSqfwy4mfJWw=; b=OFVupexqhfJ1PE+CEgdsXjN/niMvVO0ViaPefqBP5VwQZiK+mTmlLwStqojWduhVBm NCDOaK5QQsGuYkmZ61gNxFH/jRxB3T+UzlRiPPJQP0WWw7I55jyiT+HtRDtk9njW5Xlc p5Xheb7JYRFNFOajgrOVi6nBUqFPQosjFHAfNEVOrnmGWW9xxy9Bec8VyK4xEYTCCc5J SPsXJSoKuta062r68zOKG4ksjdGLrnq9QkBIaVjnoUjTwxNEmcXCcncdymFpHz7WbBYx ywkPIrjVOSwCxoLxZ9AcxEw2xVGFvQdYzOO14FzhSvSHonu4jsmA9B8Wss0pLxFDBgNK z5CA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f189-v6si26239162pfg.84.2018.11.14.01.23.02; Wed, 14 Nov 2018 01:23:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732278AbeKNTYd (ORCPT + 99 others); Wed, 14 Nov 2018 14:24:33 -0500 Received: from mx2.suse.de ([195.135.220.15]:34206 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727558AbeKNTYd (ORCPT ); Wed, 14 Nov 2018 14:24:33 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7DFE7ADEF; Wed, 14 Nov 2018 09:22:06 +0000 (UTC) Date: Wed, 14 Nov 2018 10:22:04 +0100 From: Michal Hocko To: Yi Wang Cc: riel@redhat.com, linux@rasmusvillemoes.dk, keescook@chromium.org, viro@ZenIV.linux.org.uk, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, rostedt@goodmis.org, tglx@linutronix.de, mingo@kernel.org, rppt@linux.vnet.ibm.com, linux@dominikbrodowski.net, pasha.tatashin@oracle.com, ard.biesheuvel@linaro.org, luto@amacapital.net, wad@chromium.org, riel@surriel.com, ebiederm@xmission.com, kirill.shutemov@linux.intel.com, guro@fb.com, marcos.souza.org@gmail.com, zhong.weidong@zte.com.cn Subject: Re: [PATCH v2] fork: Fix some -Wmissing-prototypes warnings Message-ID: <20181114092204.GH23419@dhcp22.suse.cz> References: <1542170087-23645-1-git-send-email-wang.yi59@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1542170087-23645-1-git-send-email-wang.yi59@zte.com.cn> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 14-11-18 12:34:47, Yi Wang wrote: > We get a warning when building kernel with W=1: > kernel/fork.c:167:13: warning: no previous prototype for ‘arch_release_thread_stack’ [-Wmissing-prototypes] > kernel/fork.c:779:13: warning: no previous prototype for ‘fork_init’ [-Wmissing-prototypes] > > Add the missing declaration in head file to fix this. > > Also, remove arch_release_thread_stack() completely because no > arch seems to implement it since bb9d81264 (arch: remove tile port). > > Signed-off-by: Yi Wang Looks good to me. Acked-by: Michal Hocko > --- > v2: remove arch_release_thread_stack(). Thanks to Rasmus. > --- > include/linux/sched/task.h | 2 ++ > init/main.c | 1 - > kernel/fork.c | 5 ----- > 3 files changed, 2 insertions(+), 6 deletions(-) > > diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h > index 108ede9..44c6f15 100644 > --- a/include/linux/sched/task.h > +++ b/include/linux/sched/task.h > @@ -39,6 +39,8 @@ > > extern void proc_caches_init(void); > > +extern void fork_init(void); > + > extern void release_task(struct task_struct * p); > > #ifdef CONFIG_HAVE_COPY_THREAD_TLS > diff --git a/init/main.c b/init/main.c > index ee14710..8feda42 100644 > --- a/init/main.c > +++ b/init/main.c > @@ -105,7 +105,6 @@ > static int kernel_init(void *); > > extern void init_IRQ(void); > -extern void fork_init(void); > extern void radix_tree_init(void); > > /* > diff --git a/kernel/fork.c b/kernel/fork.c > index 07cddff..c6d02be 100644 > --- a/kernel/fork.c > +++ b/kernel/fork.c > @@ -164,10 +164,6 @@ static inline void free_task_struct(struct task_struct *tsk) > } > #endif > > -void __weak arch_release_thread_stack(unsigned long *stack) > -{ > -} > - > #ifndef CONFIG_ARCH_THREAD_STACK_ALLOCATOR > > /* > @@ -417,7 +413,6 @@ static void release_task_stack(struct task_struct *tsk) > return; /* Better to leak the stack than to free prematurely */ > > account_kernel_stack(tsk, -1); > - arch_release_thread_stack(tsk->stack); > free_thread_stack(tsk); > tsk->stack = NULL; > #ifdef CONFIG_VMAP_STACK > -- > 1.8.3.1 -- Michal Hocko SUSE Labs