From patchwork Tue Feb 18 12:56:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: WangYuli X-Patchwork-Id: 13979777 Received: from smtpbgjp3.qq.com (smtpbgjp3.qq.com [54.92.39.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59EC0264A64; Tue, 18 Feb 2025 12:57:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.92.39.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739883468; cv=none; b=TVC+C7085iVO0jNj/XeAXIuuhdtvoOl3x7RL/rfUcBsf7cHblOSxsmWdQ8uR2k8iLy8rSFpb+E0Y90MWmoIh1BrqeWguFAlOKqQsn8j6kMri0ysoMW4v363RGOC917oXD9JyASdpldPrV3+TolYhTFEeN4VxjAymT7EODBJ9/20= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739883468; c=relaxed/simple; bh=B0cw1V0WWbSv6W+IJDae4P27mQS5mJPijK/THLDv2XI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JfNiBOROoYBpoiBEFtUqmHf6WtNFHw5FLUZhpPXG71UiKjhu3icHnsdF1PjYcMhP3ADb9ypW5WbFBpXqQixrogOFSfzr+7TQHcBRQFYcxXF/tudcuomxtnalhUNTpTfQj7HsDPKv+1RMfZYVsd0EGd3H47KTqu5ZoTk3yONxuic= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com; spf=pass smtp.mailfrom=uniontech.com; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b=J9rhzdl2; arc=none smtp.client-ip=54.92.39.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=uniontech.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b="J9rhzdl2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com; s=onoh2408; t=1739883447; bh=VEbG+LuqDITNF5aS09ODkacNvzPLmBuo+Y5S4w8RYds=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=J9rhzdl2hgy9NYDyRE+u69RUsO0pl/iwpF48CRXXqguHKwZn6ImfQzvX5CHyqyH7B FU68NUDRKula/J3TIgQq0MiBGNyIKDGhVCKIxFbOR18FCQWcz0CLv+CY0dzqQPuhXx wpSl3+eZrB372RKHnpu41vzO4hBWk48hf7wC8YaA= X-QQ-mid: bizesmtpip4t1739883400tkf5uey X-QQ-Originating-IP: yFhL8vgklBZI5ayeD56aGt2cGV2R5s2iLXHzTKJTLJ0= Received: from localhost.localdomain ( [localhost]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 18 Feb 2025 20:56:38 +0800 (CST) X-QQ-SSF: 0002000000000000000000000000000 X-QQ-GoodBg: 1 X-BIZMAIL-ID: 11245035312823928988 From: WangYuli To: wangyuli@uniontech.com Cc: chenlinxuan@uniontech.com, guanwentao@uniontech.com, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, macro@orcam.me.uk, niecheng1@uniontech.com, tsbogend@alpha.franken.de, zhanjun@uniontech.com Subject: [PATCH 2/7] MIPS: dec: Create reset.h Date: Tue, 18 Feb 2025 20:56:33 +0800 Message-ID: <65F124DA37C9CC6A+20250218125633.666501-1-wangyuli@uniontech.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <487CE8AA937621E2+20250218125101.663980-1-wangyuli@uniontech.com> References: <487CE8AA937621E2+20250218125101.663980-1-wangyuli@uniontech.com> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscrib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z2S qL1laTpnGKWmS3W1antF3Q94v/q/zm3YGCFUXRp/daNqn5CQw6ahjUZZ1d3VWjHfthz06YI iVoyIAovAWucgN0H3EqT2/5A+YqKHJ+uitgcfC9g== X-QQ-XMRINFO: NI4Ajvh11aEj8Xl/2s1/T8w= X-QQ-RECHKSPAM: 0 Declare externally used functions in reset.c to resolve compilation warnings. Fix follow errors with gcc-14 when -Werror: arch/mips/dec/reset.c:22:17: error: no previous prototype for ‘dec_machine_restart’ [-Werror=missing-prototypes] 22 | void __noreturn dec_machine_restart(char *command) | ^~~~~~~~~~~~~~~~~~~ arch/mips/dec/reset.c:27:17: error: no previous prototype for ‘dec_machine_halt’ [-Werror=missing-prototypes] 27 | void __noreturn dec_machine_halt(void) | ^~~~~~~~~~~~~~~~ arch/mips/dec/reset.c:32:17: error: no previous prototype for ‘dec_machine_power_off’ [-Werror=missing-prototypes] 32 | void __noreturn dec_machine_power_off(void) | ^~~~~~~~~~~~~~~~~~~~~ arch/mips/dec/reset.c:38:13: error: no previous prototype for ‘dec_intr_halt’ [-Werror=missing-prototypes] 38 | irqreturn_t dec_intr_halt(int irq, void *dev_id) | ^~~~~~~~~~~~~ cc1: all warnings being treated as errors make[7]: *** [scripts/Makefile.build:207: arch/mips/dec/reset.o] Error 1 make[7]: *** Waiting for unfinished jobs.... In passing, also correct the include file ordering in setup.c as it doesn't merit a separate commit. Signed-off-by: WangYuli --- arch/mips/dec/prom/init.c | 3 +-- arch/mips/dec/reset.c | 2 ++ arch/mips/dec/setup.c | 9 ++------- arch/mips/include/asm/dec/reset.h | 17 +++++++++++++++++ 4 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 arch/mips/include/asm/dec/reset.h diff --git a/arch/mips/dec/prom/init.c b/arch/mips/dec/prom/init.c index 8d74d7d6c05b..a8393052a443 100644 --- a/arch/mips/dec/prom/init.c +++ b/arch/mips/dec/prom/init.c @@ -18,7 +18,7 @@ #include #include - +#include int (*__rex_bootinit)(void); int (*__rex_bootread)(void); @@ -88,7 +88,6 @@ static void __init which_prom(s32 magic, s32 *prom_vec) void __init prom_init(void) { - extern void dec_machine_halt(void); static const char cpu_msg[] __initconst = "Sorry, this kernel is compiled for a wrong CPU type!\n"; s32 argc = fw_arg0; diff --git a/arch/mips/dec/reset.c b/arch/mips/dec/reset.c index 3df01f1da347..ee1ad38f4a69 100644 --- a/arch/mips/dec/reset.c +++ b/arch/mips/dec/reset.c @@ -10,6 +10,8 @@ #include +#include + typedef void __noreturn (* noret_func_t)(void); static inline void __noreturn back_to_prom(void) diff --git a/arch/mips/dec/setup.c b/arch/mips/dec/setup.c index 87f0a1436bf9..56a7ecf06b7b 100644 --- a/arch/mips/dec/setup.c +++ b/arch/mips/dec/setup.c @@ -17,11 +17,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include @@ -48,14 +48,9 @@ #include #include #include +#include #include - -extern void dec_machine_restart(char *command); -extern void dec_machine_halt(void); -extern void dec_machine_power_off(void); -extern irqreturn_t dec_intr_halt(int irq, void *dev_id); - unsigned long dec_kn_slot_base, dec_kn_slot_size; EXPORT_SYMBOL(dec_kn_slot_base); diff --git a/arch/mips/include/asm/dec/reset.h b/arch/mips/include/asm/dec/reset.h new file mode 100644 index 000000000000..5e7b27561fbe --- /dev/null +++ b/arch/mips/include/asm/dec/reset.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Reset a DECstation machine. + * + * Copyright (C) 2025 WangYuli + */ + +#ifndef __ASM_DEC_RESET_H + +#include + +extern void __noreturn dec_machine_restart(char *command); +extern void __noreturn dec_machine_halt(void); +extern void __noreturn dec_machine_power_off(void); +extern irqreturn_t dec_intr_halt(int irq, void *dev_id); + +#endif /* __ASM_DEC_RESET_H */