Skip to content

Commit bf6df5d

Browse files
riscv: mark some code and data as file-static
Several functions and arrays which are only used in the files in which they are declared are missing "static" qualifiers. Warnings for these symbols are reported by sparse: arch/riscv/kernel/vdso.c:28:18: warning: symbol 'vdso_data' was not declared. Should it be static? arch/riscv/mm/sifive_l2_cache.c:145:12: warning: symbol 'sifive_l2_init' was not declared. Should it be static? Resolve these warnings by marking them as static. This version incorporates feedback from Greentime Hu <[email protected]>. Signed-off-by: Paul Walmsley <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Cc: Greentime Hu <[email protected]>
1 parent 6a527b6 commit bf6df5d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/riscv/kernel/vdso.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static union {
2525
struct vdso_data data;
2626
u8 page[PAGE_SIZE];
2727
} vdso_data_store __page_aligned_data;
28-
struct vdso_data *vdso_data = &vdso_data_store.data;
28+
static struct vdso_data *vdso_data = &vdso_data_store.data;
2929

3030
static int __init vdso_init(void)
3131
{

arch/riscv/mm/sifive_l2_cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static irqreturn_t l2_int_handler(int irq, void *device)
142142
return IRQ_HANDLED;
143143
}
144144

145-
int __init sifive_l2_init(void)
145+
static int __init sifive_l2_init(void)
146146
{
147147
struct device_node *np;
148148
struct resource res;

0 commit comments

Comments
 (0)