Skip to content

Commit ffaee27

Browse files
riscv: add prototypes for assembly language functions from head.S
Add prototypes for assembly language functions defined in head.S, and include these prototypes into C source files that call those functions. This patch resolves the following warnings from sparse: arch/riscv/kernel/setup.c:39:10: warning: symbol 'hart_lottery' was not declared. Should it be static? arch/riscv/kernel/setup.c:42:13: warning: symbol 'parse_dtb' was not declared. Should it be static? arch/riscv/kernel/smpboot.c:33:6: warning: symbol '__cpu_up_stack_pointer' was not declared. Should it be static? arch/riscv/kernel/smpboot.c:34:6: warning: symbol '__cpu_up_task_pointer' was not declared. Should it be static? arch/riscv/mm/fault.c:25:17: warning: symbol 'do_page_fault' was not declared. Should it be static? This change should have no functional impact. Signed-off-by: Paul Walmsley <[email protected]>
1 parent d6d5df1 commit ffaee27

File tree

5 files changed

+29
-0
lines changed

5 files changed

+29
-0
lines changed

arch/riscv/kernel/head.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/*
3+
* Copyright (C) 2019 SiFive, Inc.
4+
*/
5+
#ifndef __ASM_HEAD_H
6+
#define __ASM_HEAD_H
7+
8+
#include <linux/linkage.h>
9+
#include <linux/init.h>
10+
11+
extern atomic_t hart_lottery;
12+
13+
asmlinkage void do_page_fault(struct pt_regs *regs);
14+
asmlinkage void __init setup_vm(uintptr_t dtb_pa);
15+
16+
extern void *__cpu_up_stack_pointer[];
17+
extern void *__cpu_up_task_pointer[];
18+
19+
void __init parse_dtb(void);
20+
21+
#endif /* __ASM_HEAD_H */

arch/riscv/kernel/setup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include <asm/tlbflush.h>
2525
#include <asm/thread_info.h>
2626

27+
#include "head.h"
28+
2729
#ifdef CONFIG_DUMMY_CONSOLE
2830
struct screen_info screen_info = {
2931
.orig_video_lines = 30,

arch/riscv/kernel/smpboot.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#include <asm/sections.h>
3131
#include <asm/sbi.h>
3232

33+
#include "head.h"
34+
3335
void *__cpu_up_stack_pointer[NR_CPUS];
3436
void *__cpu_up_task_pointer[NR_CPUS];
3537
static DECLARE_COMPLETION(cpu_running);

arch/riscv/mm/fault.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include <asm/ptrace.h>
1919
#include <asm/tlbflush.h>
2020

21+
#include "../kernel/head.h"
22+
2123
/*
2224
* This routine handles page faults. It determines the address and the
2325
* problem, and then passes it off to one of the appropriate routines.

arch/riscv/mm/init.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include <asm/pgtable.h>
2020
#include <asm/io.h>
2121

22+
#include "../kernel/head.h"
23+
2224
unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]
2325
__page_aligned_bss;
2426
EXPORT_SYMBOL(empty_zero_page);

0 commit comments

Comments
 (0)