Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1299114ybg; Fri, 18 Oct 2019 15:27:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxuZRXr8XfE6jRSSsbeo4s8iA4YnbbF58fbMebGAERVOVEjjJpnCoReLyP9L1GNcX3Wriws X-Received: by 2002:a17:906:6847:: with SMTP id a7mr11093691ejs.261.1571437640189; Fri, 18 Oct 2019 15:27:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571437640; cv=none; d=google.com; s=arc-20160816; b=S35pXui1NlAz5Zr4P/Ks0re/0g5PWZ4R46silJEsQjlG1tNU0EtIaUQTG3wVYup4TT qU2R1s2xhkGkhBmOcBCDG60ReFmlaV+qhiS1cO0hYcbH2ztFc2LK1LmH7xNcn8oDnjH5 P3JPLk71UnefAZKtEZ2LrqR59LtbiKi1c931DIV1abooTCiT/0ftN/e/PJY9Jn77mGnm VylhWSKT//+8kM3LC2ZJ1+GUVpuyW0yerzIhyvHnX5T73jQRmf2tTEYwAYLq6uQJ48ck xA/rzPeihckIsc/EOVeqn0jd+77trJxt55DiB9etv/vgDKi8dIHx8fjeDnk/vGf8Yv/a sSlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JYeo0xAdWe0VE7AGn4vUOp9/RKxdCHKwx1Hu2VD3ZFI=; b=AqiBKfPpSUGnhEyBCoqz+sC8me3BYNDb6e1h7M3qFgCRY/qdZi/vZvSMqqCnLiaNnI fVsVznlgzHXppgFu9Lw6l9A5dOEqxuHoCBdhAPQw1MtwUTqfwnDENvw7qHEgS5Y3fakN BonmY3Hx4HLcvjUnkZgUqo2XJTEVFt3awySWbpPzBymuZ7iR2yIXh7mPOMBU8t770jCD DqQQFKCbeRVhDHptCIk5e4jaDWXciG66xhgZRRvu+seaitJaLVpa6KLlAvktY6KSdPpL pmI+BwgheHIdZ7YEk3anIAXv09ppj9Sgwz3wKd9WL5+T0sV++gqUpPja6W1XmNXth/XH yVVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=e7FqzvY5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h91si5252848edd.270.2019.10.18.15.26.57; Fri, 18 Oct 2019 15:27:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=e7FqzvY5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408754AbfJRAt7 (ORCPT + 99 others); Thu, 17 Oct 2019 20:49:59 -0400 Received: from mail-il1-f193.google.com ([209.85.166.193]:35449 "EHLO mail-il1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407271AbfJRAt6 (ORCPT ); Thu, 17 Oct 2019 20:49:58 -0400 Received: by mail-il1-f193.google.com with SMTP id j9so3959652ilr.2 for ; Thu, 17 Oct 2019 17:49:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JYeo0xAdWe0VE7AGn4vUOp9/RKxdCHKwx1Hu2VD3ZFI=; b=e7FqzvY5kEG/Xv9dIUQ1oCTbqcLEHSai2TGkF9G5GOVHJOR/JRSwHHyKyxE9Y+S1Uq Hb8dlvw9i96xctpHBYqQBqf2k8TItk5GeFtah91bVmtekmsMQyuy9hvZ1tzGZWmJ7Q3R GEgHJm5NtXAKDGR/rADOJZgrY8yLRaSwrpHj7qmYP1C9npIOGGSsJ+sEx/8+SF3AxHF1 zj95h/38bh57/dIL1N0pBQ8+GEsb3385SjPqW4Z2u+/mmYHQM1sgPI/92NHMZR+yr4pf eRB3BIF3i8o0joYNAcCb+1rjlG2oHRXmv5wiiqOCHq94DPnpSd9btuAuXXXApfSK7fB1 Y/fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JYeo0xAdWe0VE7AGn4vUOp9/RKxdCHKwx1Hu2VD3ZFI=; b=uVMNU0Kc8HLyzsV+LVb71a3tYy72XkzlFA1KYcftWHaPPn53ydYP7n4L0zQPPDtTss ypeBIzU8nPJxxK+BoKy6sH4w9JxX5OUc41z45AL6rMg6irZT8tLiBJTb+LJ+eTunrEt7 IyPp5zlH7I84qSLV7SYjK0jyV72Dz9hzvRBbRlLhw3hnoBgJLMLAleF6pgOitgV+4y9a AKHHvesJ2FNto1UbPm76DdfSBNCoHeU2dLI59xlmhl0Zmf7FNQFJf0x1juIflRHmmu+9 COKLoYR5S3Nm7HLEWiC5drYBBGPXLAIvdoTyALANVUJQ35aYXe4gAZ26SfV86gAQLlh3 OnGw== X-Gm-Message-State: APjAAAWNT9EZ9qXydv4j2cm3pWukLZl38SaV/eZ0FzGeXeFlG3jFbOBu C8qaetuH+mmWqc2wQiO2Oz52VSf3hNo= X-Received: by 2002:a92:9f8c:: with SMTP id z12mr7348576ilk.111.1571359797398; Thu, 17 Oct 2019 17:49:57 -0700 (PDT) Received: from viisi.Home ([64.62.168.194]) by smtp.gmail.com with ESMTPSA id z20sm1493891iof.38.2019.10.17.17.49.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 17:49:57 -0700 (PDT) From: Paul Walmsley To: linux-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 6/8] riscv: mark some code and data as file-static Date: Thu, 17 Oct 2019 17:49:27 -0700 Message-Id: <20191018004929.3445-7-paul.walmsley@sifive.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191018004929.3445-1-paul.walmsley@sifive.com> References: <20191018004929.3445-1-paul.walmsley@sifive.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/stacktrace.c:22:14: warning: symbol 'walk_stackframe' was not declared. Should it be static? arch/riscv/kernel/vdso.c:28:18: warning: symbol 'vdso_data' was not declared. Should it be static? arch/riscv/mm/init.c:42:6: warning: symbol 'setup_zero_page' was not declared. Should it be static? arch/riscv/mm/init.c:152:7: warning: symbol 'fixmap_pte' was not declared. Should it be static? arch/riscv/mm/init.c:211:7: warning: symbol 'trampoline_pmd' was not declared. Should it be static? arch/riscv/mm/init.c:212:7: warning: symbol 'fixmap_pmd' was not declared. Should it be static? arch/riscv/mm/init.c:219:7: warning: symbol 'early_pmd' 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. Signed-off-by: Paul Walmsley --- arch/riscv/kernel/stacktrace.c | 6 ++++-- arch/riscv/kernel/vdso.c | 2 +- arch/riscv/mm/init.c | 12 +++++++----- arch/riscv/mm/sifive_l2_cache.c | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c index 0940681d2f68..fd908baed51c 100644 --- a/arch/riscv/kernel/stacktrace.c +++ b/arch/riscv/kernel/stacktrace.c @@ -19,8 +19,10 @@ struct stackframe { unsigned long ra; }; -void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, - bool (*fn)(unsigned long, void *), void *arg) +static void notrace walk_stackframe(struct task_struct *task, + struct pt_regs *regs, + bool (*fn)(unsigned long, void *), + void *arg) { unsigned long fp, sp, pc; diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c index c9c21e0d5641..e24fccab8185 100644 --- a/arch/riscv/kernel/vdso.c +++ b/arch/riscv/kernel/vdso.c @@ -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) { diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index fe68e94ea946..79cfb35f1e0e 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -40,7 +40,7 @@ static void __init zone_sizes_init(void) free_area_init_nodes(max_zone_pfns); } -void setup_zero_page(void) +static void setup_zero_page(void) { memset((void *)empty_zero_page, 0, PAGE_SIZE); } @@ -150,7 +150,7 @@ EXPORT_SYMBOL(pfn_base); void *dtb_early_va; pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned_bss; pgd_t trampoline_pg_dir[PTRS_PER_PGD] __page_aligned_bss; -pte_t fixmap_pte[PTRS_PER_PTE] __page_aligned_bss; +static pte_t fixmap_pte[PTRS_PER_PTE] __page_aligned_bss; static bool mmu_enabled; #define MAX_EARLY_MAPPING_SIZE SZ_128M @@ -209,15 +209,17 @@ static void __init create_pte_mapping(pte_t *ptep, #ifndef __PAGETABLE_PMD_FOLDED -pmd_t trampoline_pmd[PTRS_PER_PMD] __page_aligned_bss; -pmd_t fixmap_pmd[PTRS_PER_PMD] __page_aligned_bss; +static pmd_t trampoline_pmd[PTRS_PER_PMD] __page_aligned_bss; +static pmd_t fixmap_pmd[PTRS_PER_PMD] __page_aligned_bss; #if MAX_EARLY_MAPPING_SIZE < PGDIR_SIZE #define NUM_EARLY_PMDS 1UL #else #define NUM_EARLY_PMDS (1UL + MAX_EARLY_MAPPING_SIZE / PGDIR_SIZE) #endif -pmd_t early_pmd[PTRS_PER_PMD * NUM_EARLY_PMDS] __initdata __aligned(PAGE_SIZE); + +#define NUM_EARLY_PMDS_PTRS (PTRS_PER_PMD * NUM_EARLY_PMDS) +static pmd_t early_pmd[NUM_EARLY_PMDS_PTRS] __initdata __aligned(PAGE_SIZE); static pmd_t *__init get_pmd_virt(phys_addr_t pa) { diff --git a/arch/riscv/mm/sifive_l2_cache.c b/arch/riscv/mm/sifive_l2_cache.c index 2e637ad71c05..a9ffff3277c7 100644 --- a/arch/riscv/mm/sifive_l2_cache.c +++ b/arch/riscv/mm/sifive_l2_cache.c @@ -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; -- 2.23.0