Skip to content

Commit b331182

Browse files
Mr-Bossmanpalmer-dabbelt
authored andcommitted
RISC-V: pi: Add kernel/pi/pi.h
Add pi.h header for declarations of the kernel/pi prefixed functions and any other related declarations. Suggested-by: Charlie Jenkins <[email protected]> Signed-off-by: Jesse Taube <[email protected]> Reviewed-by: Alexandre Ghiti <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent d57e19f commit b331182

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

arch/riscv/kernel/pi/cmdline_early.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,9 @@
66
#include <asm/pgtable.h>
77
#include <asm/setup.h>
88

9-
static char early_cmdline[COMMAND_LINE_SIZE];
9+
#include "pi.h"
1010

11-
/*
12-
* Declare the functions that are exported (but prefixed) here so that LLVM
13-
* does not complain it lacks the 'static' keyword (which, if added, makes
14-
* LLVM complain because the function is actually unused in this file).
15-
*/
16-
u64 set_satp_mode_from_cmdline(uintptr_t dtb_pa);
17-
bool set_nokaslr_from_cmdline(uintptr_t dtb_pa);
11+
static char early_cmdline[COMMAND_LINE_SIZE];
1812

1913
static char *get_early_cmdline(uintptr_t dtb_pa)
2014
{

arch/riscv/kernel/pi/fdt_early.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@
33
#include <linux/init.h>
44
#include <linux/libfdt.h>
55

6-
/*
7-
* Declare the functions that are exported (but prefixed) here so that LLVM
8-
* does not complain it lacks the 'static' keyword (which, if added, makes
9-
* LLVM complain because the function is actually unused in this file).
10-
*/
11-
u64 get_kaslr_seed(uintptr_t dtb_pa);
6+
#include "pi.h"
127

138
u64 get_kaslr_seed(uintptr_t dtb_pa)
149
{

arch/riscv/kernel/pi/pi.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _RISCV_PI_H_
3+
#define _RISCV_PI_H_
4+
5+
#include <linux/types.h>
6+
7+
/*
8+
* The following functions are exported (but prefixed). Declare them here so
9+
* that LLVM does not complain it lacks the 'static' keyword (which, if
10+
* added, makes LLVM complain because the function is unused).
11+
*/
12+
13+
u64 get_kaslr_seed(uintptr_t dtb_pa);
14+
bool set_nokaslr_from_cmdline(uintptr_t dtb_pa);
15+
u64 set_satp_mode_from_cmdline(uintptr_t dtb_pa);
16+
17+
#endif /* _RISCV_PI_H_ */

0 commit comments

Comments
 (0)