Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4630843rwb; Tue, 8 Aug 2023 11:12:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEfmYsita8RMRQjX6oIzaWkTr/njmU01Oq8ySZa09HhxVKovTkT3VbtkjNuRQxvFzJ+tpng X-Received: by 2002:a17:907:7709:b0:99b:bca6:cf94 with SMTP id kw9-20020a170907770900b0099bbca6cf94mr280015ejc.14.1691518333185; Tue, 08 Aug 2023 11:12:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691518333; cv=none; d=google.com; s=arc-20160816; b=JoqXyVXHG9WEPdp8eolRxy/ZUOalbET7f0Br8cIHLJJ2/WuXjwAWqB6mktQPXAr1X3 l6jU517eRpJxHztTf9RXvUYlUhxG9Ex65LiisER0hfrzM57HTbelztSgRiP4AdSg2qUb e5piAgon0SYP8CDv/yd4vbmJ5wvRojim4BcrXEQxGpry5Cv4fbqnXEmp7Z+zeGczTl4w /YsHbZySDnqmxwn3bJuh7F0/3+rav2agcn5YknIf+w6bzavFsnjmOYd/1R6iCHVf4eGf ipJwNeRUGRYmDQDXGJHJeNh1YjbdLyP056XiCxtADyWQA24rjQ7s2/a71CZcoik7xwjk geBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=TnSrdQhDNrVuprB4dmCAsDjMsMYddVJX219Lp3rcDA4=; fh=VsDLjjkuzpZOQwbRvR5Wse5zWRKbAOHEzjoyoCUUYlc=; b=pLx1MImwV8WiOoDNkDkB5zNKxXXV5LKtEya2p5K40YYsR8s1Oi47kZxhrqXiyyhPm9 nsKKIGcPYIJ8RDHk2S5wusc4e4HJplgs12/YX6F2LA1WiLhiDwZwFsOqTLR9LzAfaHki CsZlANYDz7idnSDNeb8Ka0DeSHKGWj5QAWDNbttDkPPax1P4wnCYWXInN5X7pfL8FqpY MnT0U0A6waRpMQU9UeMlKX+it2iwNDQzDLZa0GixykNvm6e7sw8BRVnDWo4yT4DVLd3f 3hqTkSf34kRB+n+p3Ek/BhJYu1GZS+drxlHfqINVLHjk0bMFG7E2jyyDqBVmhbsknRHg N7+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="lGb2f/YO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ec10-20020a170906b6ca00b0098d2261cddfsi8533971ejb.1049.2023.08.08.11.11.47; Tue, 08 Aug 2023 11:12:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="lGb2f/YO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234826AbjHHRiK (ORCPT + 99 others); Tue, 8 Aug 2023 13:38:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234830AbjHHRhq (ORCPT ); Tue, 8 Aug 2023 13:37:46 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E83846CFD for ; Tue, 8 Aug 2023 09:16:27 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-d4db57d2982so3347518276.3 for ; Tue, 08 Aug 2023 09:16:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691511346; x=1692116146; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=TnSrdQhDNrVuprB4dmCAsDjMsMYddVJX219Lp3rcDA4=; b=lGb2f/YOrRiylaHa5jpIHSBS+5gA5f9jpHu3Fs4EZiccyfbMg/CaCeE8DhUynu/rGT VmYeHn49llYsaiyBEQqQe1dUMWxGuFckQm3kWv4vkbsrJGQsMz3Ckdy2t8B0Dh/pRS43 fgbcCCuWrmqm9uSfgb1zVZnFO7ngzgx5nghrRNrw/wDWXnwzuX/V11XAG0oL81XBChlS G544+98xi7aoiiJ9ERzUMnbOLMoKHWJxE6Wkp9O9EvLLGzNPrSAOCAef1/OkHzzokV3m JEmo3u28Mb16KgtXBmMVtSfYOj0kq5TWmKNz3I0fGc6qdVkeueXO1Dg9P+ZoF0WTHQQp aWYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691511346; x=1692116146; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=TnSrdQhDNrVuprB4dmCAsDjMsMYddVJX219Lp3rcDA4=; b=DpuNlfeWnwow54S8DXf5DB59I6wmgLo/mrYetQJpme+bNMQRRPOkiIWXzfD2FXp8DO 9WGfipY5RURatrkeMp09hfXVK4BY697prq8/tghUcLhk2BwTXWXv+7eKNtl6l7ntEq+o QE9xav8DGwrLtw2mcrl2pmPhVAQuR5T8kS/6vKCT/oYjj0f4qH8zMdjVtJFv55IXZvSz GNHdBA5D2Tnd16mGVPyQdfViix/dR8DZEP0mETQZaA5vuZrEK3suRlXJIivduHSFAhNs 95wtUsOL1+/IM+wrz9i5ICV+MK//EdtHc5xENzgwGMmaSjb1+igRSiidJcFPWvqNnhJq SVRw== X-Gm-Message-State: AOJu0YwLbIm8sh5h6c2SpZFiMRf3IqoYezmDhj9pzQ/0uv4Ci8jd1laS CHqWSbt6VgVicI7AP1EToIYCCyHdFNC5igapFEM= X-Received: from ndesaulniers-desktop.svl.corp.google.com ([2620:15c:2d1:203:cc03:38d0:9718:e90b]) (user=ndesaulniers job=sendgmr) by 2002:a25:ad22:0:b0:d47:5cc3:9917 with SMTP id y34-20020a25ad22000000b00d475cc39917mr583ybi.9.1691511346524; Tue, 08 Aug 2023 09:15:46 -0700 (PDT) Date: Tue, 08 Aug 2023 09:15:41 -0700 Mime-Version: 1.0 X-B4-Tracking: v=1; b=H4sIACxq0mQC/x3MQQqAIBBA0avIrBMso6SrRIToVLOxcEQC8e5Jy 7f4vwBjJGRYRIGImZju0NB3Atxlw4mSfDMMatDKKCMjscs7J5vIST0apSf0zuIMLXkiHvT+u3W r9QNYoC3/XgAAAA== X-Developer-Key: i=ndesaulniers@google.com; a=ed25519; pk=UIrHvErwpgNbhCkRZAYSX0CFd/XFEwqX3D0xqtqjNug= X-Developer-Signature: v=1; a=ed25519-sha256; t=1691511345; l=2795; i=ndesaulniers@google.com; s=20220923; h=from:subject:message-id; bh=OcqNn5LCQ+EeTr3I1uAMbj9TNMj6ZOz+MyHLIDJSuyg=; b=2dRkXEmD8MwFmG9EeCYKF4DvAZZlYRfD+3DQ4f7W/a7WckgZ1aqSRxlVlqw5pfqOnsKxPKS2t TioJDco+hDfD3CACC3aD1jROlwVSW5FX65NkMx9sSTL+J3KoJQpam3O X-Mailer: b4 0.12.3 Message-ID: <20230808-riscv_static-v1-1-9f3dc99dafe8@google.com> Subject: [PATCH] riscv: mm: fix 2 instances of -Wmissing-variable-declarations From: Nick Desaulniers To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Nathan Chancellor , Tom Rix Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, kernel test robot , Nick Desaulniers Content-Type: text/plain; charset="utf-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'm looking to enable -Wmissing-variable-declarations behind W=1. 0day bot spotted the following instance in ARCH=riscv builds: arch/riscv/mm/init.c:276:7: warning: no previous extern declaration for non-static variable 'trampoline_pg_dir' [-Wmissing-variable-declarations] 276 | pgd_t trampoline_pg_dir[PTRS_PER_PGD] __page_aligned_bss; | ^ arch/riscv/mm/init.c:276:1: note: declare 'static' if the variable is not intended to be used outside of this translation unit 276 | pgd_t trampoline_pg_dir[PTRS_PER_PGD] __page_aligned_bss; | ^ arch/riscv/mm/init.c:279:7: warning: no previous extern declaration for non-static variable 'early_pg_dir' [-Wmissing-variable-declarations] 279 | pgd_t early_pg_dir[PTRS_PER_PGD] __initdata __aligned(PAGE_SIZE); | ^ arch/riscv/mm/init.c:279:1: note: declare 'static' if the variable is not intended to be used outside of this translation unit 279 | pgd_t early_pg_dir[PTRS_PER_PGD] __initdata __aligned(PAGE_SIZE); | ^ These symbols are referenced by more than one translation unit, so make sure they're both declared and include the correct header for their declarations. Finally, sort the list of includes to help keep them tidy. Reported-by: kernel test robot Closes: https://lore.kernel.org/llvm/202308081000.tTL1ElTr-lkp@intel.com/ Signed-off-by: Nick Desaulniers --- arch/riscv/include/asm/pgtable.h | 1 + arch/riscv/mm/init.c | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 75970ee2bda2..4c8c0f83a974 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -188,6 +188,7 @@ extern struct pt_alloc_ops pt_ops __initdata; #define PAGE_KERNEL_IO __pgprot(_PAGE_IOREMAP) extern pgd_t swapper_pg_dir[]; +extern pgd_t trampoline_pg_dir[]; #ifdef CONFIG_TRANSPARENT_HUGEPAGE static inline int pmd_present(pmd_t pmd) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 9ce504737d18..cc0e06b4f223 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -26,12 +26,13 @@ #include #include -#include -#include -#include #include -#include #include +#include +#include +#include +#include +#include #include "../kernel/head.h" --- base-commit: 14f9643dc90adea074a0ffb7a17d337eafc6a5cc change-id: 20230808-riscv_static-348036edcae7 Best regards, -- Nick Desaulniers