Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6232452imu; Tue, 13 Nov 2018 20:35:51 -0800 (PST) X-Google-Smtp-Source: AJdET5dTxUpIaHEw3UCgZImdSU+fyCKQIP5qvRs1+nn0s+UD9YROkCCdLnUkMugMbFrAJ3DT5yAC X-Received: by 2002:a62:8c93:: with SMTP id m141-v6mr371709pfd.239.1542170150947; Tue, 13 Nov 2018 20:35:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542170150; cv=none; d=google.com; s=arc-20160816; b=BNcUZdmZW71dzkcFAzZJl1OviHzA+UGlmNsTC+rRWLrhVQacWPaocnmehP9oNSNSI9 Q/Elh55VrorzOwZ8q1TJGx6Wq4orYzy1AZDOnkiTT2GBYIlLGWZzaMfKsGDsruQbac/3 22RLec6Jg6JdtkPMgJXbds6ur2bcC3j32j3SLZpDJXzAlCVQAOX359ZTlgw6iYM7jg+Y oI94P5jNo4E5CqEZ07Nz/jkWFGNhPS8xqBcE4MeK3sof9iXAy5uvJxAibM97WHuvu37d wNA1klFpgVwgW4IaJnvdXlBllhs6yvMF7CO/NbhNpjMn7NzZN1h78zkQvZCpypr+B7Qz AG3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=JCZRCJCOBNhnk645EETQeDHeko/gWzCtkfLDLhfms58=; b=yyY8xIKuYViL5hcqRged4CB3d+bjFy1CgmNViRIHRFybQ0RGH3zpCZFxj6Jrac0L7M 8XH5ZtBJP4u9c4JZwqUVXHBQYzzV6KJNQ0bxtT/jeLdgJBIX7d5MMGTDdX7FN0YxziYi LqNtz97nEpFNQfUJWKQEDM3mpZ1GwwUDiM2OkcKJgna4Gw/bBc2BKovsmdzIJ4s0teAn FEwyUMz21j42MLa2lte88EBmDrDn/8xtdM2AG7s1IkMmqmLez6XXlS0uvfD42AGERqbc Rhva+ob3J1qk2gYb/uMP4S1jFjcgXt9k4UgkSiMLj5OvmvNc1GuO2Z0bqnxtux2jmJ3s V5oA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si8178538pls.170.2018.11.13.20.35.35; Tue, 13 Nov 2018 20:35:50 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731416AbeKNOeq convert rfc822-to-8bit (ORCPT + 99 others); Wed, 14 Nov 2018 09:34:46 -0500 Received: from out1.zte.com.cn ([202.103.147.172]:34098 "EHLO mxct.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726813AbeKNOeq (ORCPT ); Wed, 14 Nov 2018 09:34:46 -0500 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id C24258C3F9D250C45F4A; Wed, 14 Nov 2018 12:33:09 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id wAE4X5v9095459; Wed, 14 Nov 2018 12:33:05 +0800 (GMT-8) (envelope-from wang.yi59@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2018111412332545-10576762 ; Wed, 14 Nov 2018 12:33:25 +0800 From: Yi Wang To: riel@redhat.com, linux@rasmusvillemoes.dk Cc: wang.yi59@zte.com.cn, 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, mhocko@kernel.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: [PATCH v2] fork: Fix some -Wmissing-prototypes warnings Date: Wed, 14 Nov 2018 12:34:47 +0800 Message-Id: <1542170087-23645-1-git-send-email-wang.yi59@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2018-11-14 12:33:25, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2018-11-14 12:32:57 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-MAIL: mse01.zte.com.cn wAE4X5v9095459 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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