Skip to content

Commit

Permalink
riscv: mark some code and data as file-static
Browse files Browse the repository at this point in the history
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
<greentime.hu@sifive.com>.

Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Greentime Hu <greentime.hu@sifive.com>
  • Loading branch information
Paul Walmsley committed Oct 28, 2019
1 parent 6a527b6 commit bf6df5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/riscv/kernel/vdso.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static union {
struct vdso_data data;
u8 page[PAGE_SIZE];
} vdso_data_store __page_aligned_data;
struct vdso_data *vdso_data = &vdso_data_store.data;
static struct vdso_data *vdso_data = &vdso_data_store.data;

static int __init vdso_init(void)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/riscv/mm/sifive_l2_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static irqreturn_t l2_int_handler(int irq, void *device)
return IRQ_HANDLED;
}

int __init sifive_l2_init(void)
static int __init sifive_l2_init(void)
{
struct device_node *np;
struct resource res;
Expand Down

0 comments on commit bf6df5d

Please sign in to comment.