From patchwork Thu Aug 25 20:59:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12955226 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7B2BECAAA6 for ; Thu, 25 Aug 2022 21:01:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243746AbiHYVB5 (ORCPT ); Thu, 25 Aug 2022 17:01:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236264AbiHYVBh (ORCPT ); Thu, 25 Aug 2022 17:01:37 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11E793FA26 for ; Thu, 25 Aug 2022 14:01:27 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id n17so1464822wrm.4 for ; Thu, 25 Aug 2022 14:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conchuod.ie; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=Z63zwi7cGAuKiNoBIs10Ekj9CC9KQ4p8G+KukTWva3I=; b=SJaPKdEKD3cZ4U2ILmGJ7YYl8jrjkW+umstaVhULXfth/8eB87EBEKn/1mLbA1W76X PzwduEhBRnRX4YqA+aiPXjDTcwdjcfx/3gAU9DBS4WBTJpRmqny0NPSmw9G9ochTOInu 2WeWfYenhoC74R53yv/Z0OwTJEtmrKUx6FM/amJ0sZsda7+BI8NV+YKEpXHvhWWUIQjL jIvX/rug3aVUgMdrWNpc6nGPjyF4/U1BUWb17IFkiyO/CnXUmbpjEQXfrqIv9bH9Ityb Jo9HX3MLhnjEaryWcsPgu/zFHTD87Za/Foj2KTeWLFsfxj4oLiPHVvekJWAPqw55D4IJ wP5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=Z63zwi7cGAuKiNoBIs10Ekj9CC9KQ4p8G+KukTWva3I=; b=CEOHKp3P1PeEE5X423a7wNy3vX/Fv10arQpMc9mGnxkPzQtwKKkPiNB7ClRd55GlVM hT1PCD06hu80h0SfwEYEif4Lp2iP6BplizDi2aTK+4zhC9RYIuEFyP23u9Jypy6K+Yui 4b7VCbe2/11vLmBRGiecCWSHtgemKoRZ2VeDPWSRU4fgrFFHk94JQuLzd0Ep5j7kwAxV nGVs2oE9kNPnlkd9/dZ6GlCVghgX/QPANx9iAgvMO+sg0M24qoKHsiRn0iYfcw5v4Or/ rEnY4igVsGZcPqCdT8/3HYvkSQ1XiYF6IzB3E2zVpTJNekZL6l4iSJcOfdbauKvrFl6y kjmA== X-Gm-Message-State: ACgBeo3n36iR9V4I9F5Coi3S3DNeshl3qYTFZ9XS9IO3jRV4CAT6Z8MR ijQvYumCjQKnhm+GwZGfJD/PNw== X-Google-Smtp-Source: AA6agR6CHzaozIjR/7Q20mq4qiXqh3OzKi41CUQLkIeloF4Lpy2xCkUYlbFCvfPNRwRzxYHUk2X5VA== X-Received: by 2002:a5d:5b19:0:b0:225:3ed4:ff64 with SMTP id bx25-20020a5d5b19000000b002253ed4ff64mr3336331wrb.537.1661461285500; Thu, 25 Aug 2022 14:01:25 -0700 (PDT) Received: from henark71.. ([51.37.149.245]) by smtp.gmail.com with ESMTPSA id i14-20020adffdce000000b00225213fd4a9sm220877wrs.33.2022.08.25.14.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 14:01:24 -0700 (PDT) From: Conor Dooley To: arnd@arndb.de, linux-arch@vger.kernel.org Cc: richard.henderson@linaro.org, mattst88@gmail.com, vgupta@kernel.org, linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org, guoren@kernel.org, bcain@quicinc.com, chenhuacai@kernel.org, geert@linux-m68k.org, gerg@linux-m68k.org, monstr@monstr.eu, tsbogend@alpha.franken.de, dinguyen@kernel.org, shorne@gmail.com, deller@gmx.de, mpe@ellerman.id.au, palmer@dabbelt.com, hca@linux.ibm.com, ysato@users.sourceforge.jp, dalias@libc.org, davem@davemloft.net, richard@nod.at, x86@kernel.org, jcmvbkbc@gmail.com, linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, openrisc@lists.librecores.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, linux-fsdevel@vger.kernel.org, Conor Dooley Subject: [PATCH v2] include/linux: declare cpuinfo_op in processor.h Date: Thu, 25 Aug 2022 21:59:43 +0100 Message-Id: <20220825205942.1713914-1-mail@conchuod.ie> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org From: Conor Dooley RISC-V is missing a prototype for cpuinfo_op, triggering complaints from sparse. Rather than adding yet another `extern const struct seq_operations cpuinfo_op;` to an arch specific header file, create a generic variant and include it across the board. Several archs already have a declaration in asm/processor.h - migrate these to include linux/processor.h instead. Most archs do not declare cpuinfo_op so one sparse complaint off their books. Signed-off-by: Conor Dooley --- Changes since v1: - Per Geert, use linux/processor.h & include it on all archs & - Squash to a single patch I pushed it out for LKP to take a look at, and was all good there. Only added one person per arch & the mailing lists to stay within a 1024 character CC list. Please scream if I picked the wrong person. --- arch/alpha/kernel/setup.c | 1 + arch/arc/kernel/setup.c | 1 + arch/arm/kernel/setup.c | 1 + arch/arm64/kernel/cpuinfo.c | 1 + arch/csky/kernel/cpu-probe.c | 1 + arch/hexagon/kernel/setup.c | 1 + arch/ia64/kernel/setup.c | 1 + arch/loongarch/kernel/proc.c | 1 + arch/m68k/kernel/setup_mm.c | 1 + arch/m68k/kernel/setup_no.c | 1 + arch/microblaze/include/asm/processor.h | 2 -- arch/microblaze/kernel/cpu/mb.c | 1 + arch/mips/kernel/proc.c | 1 + arch/nios2/kernel/cpuinfo.c | 1 + arch/openrisc/kernel/setup.c | 1 + arch/parisc/kernel/setup.c | 1 + arch/powerpc/kernel/setup-common.c | 1 + arch/riscv/kernel/cpu.c | 3 ++- arch/s390/include/asm/processor.h | 2 +- arch/s390/kernel/processor.c | 1 + arch/sh/include/asm/processor.h | 1 - arch/sh/kernel/cpu/proc.c | 1 + arch/sparc/include/asm/cpudata.h | 2 -- arch/sparc/kernel/cpu.c | 1 + arch/um/kernel/um_arch.c | 1 + arch/x86/include/asm/processor.h | 2 -- arch/x86/kernel/cpu/proc.c | 1 + arch/xtensa/kernel/setup.c | 1 + fs/proc/cpuinfo.c | 3 +-- include/linux/processor.h | 2 ++ 30 files changed, 28 insertions(+), 11 deletions(-) diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index b4fbbba30aa2..d2c2546e9b1a 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c @@ -46,6 +46,7 @@ #include #include #include +#include static int alpha_panic_event(struct notifier_block *, unsigned long, void *); static struct notifier_block alpha_panic_block = { diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index 41f07b3e594e..b681bdd21a0c 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 1e8a50a97edf..83240c3c0463 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index d7702f39b4d3..4c1b12918aed 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/csky/kernel/cpu-probe.c b/arch/csky/kernel/cpu-probe.c index 5f15ca31d3e8..62580f5d0d74 100644 --- a/arch/csky/kernel/cpu-probe.c +++ b/arch/csky/kernel/cpu-probe.c @@ -5,6 +5,7 @@ #include #include #include +#include #include diff --git a/arch/hexagon/kernel/setup.c b/arch/hexagon/kernel/setup.c index 1880d9beaf2b..395d2930dbd1 100644 --- a/arch/hexagon/kernel/setup.c +++ b/arch/hexagon/kernel/setup.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index fd6301eafa9d..973725c4ce1e 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #include diff --git a/arch/loongarch/kernel/proc.c b/arch/loongarch/kernel/proc.c index 5c67cc4fd56d..a8cbebe839e2 100644 --- a/arch/loongarch/kernel/proc.c +++ b/arch/loongarch/kernel/proc.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c index e62fa8f2149b..45d82a4839fc 100644 --- a/arch/m68k/kernel/setup_mm.c +++ b/arch/m68k/kernel/setup_mm.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include diff --git a/arch/m68k/kernel/setup_no.c b/arch/m68k/kernel/setup_no.c index cb6def585851..86dd4b47ff43 100644 --- a/arch/m68k/kernel/setup_no.c +++ b/arch/m68k/kernel/setup_no.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h index 7e9e92670df3..c5877c91116a 100644 --- a/arch/microblaze/include/asm/processor.h +++ b/arch/microblaze/include/asm/processor.h @@ -15,8 +15,6 @@ #include # ifndef __ASSEMBLY__ -/* from kernel/cpu/mb.c */ -extern const struct seq_operations cpuinfo_op; # define cpu_relax() barrier() diff --git a/arch/microblaze/kernel/cpu/mb.c b/arch/microblaze/kernel/cpu/mb.c index 9581d194d9e4..33f5be916121 100644 --- a/arch/microblaze/kernel/cpu/mb.c +++ b/arch/microblaze/kernel/cpu/mb.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c index 8eba5a1ed664..54a4226cff84 100644 --- a/arch/mips/kernel/proc.c +++ b/arch/mips/kernel/proc.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/nios2/kernel/cpuinfo.c b/arch/nios2/kernel/cpuinfo.c index 203870c4b86d..9641ca55377e 100644 --- a/arch/nios2/kernel/cpuinfo.c +++ b/arch/nios2/kernel/cpuinfo.c @@ -12,6 +12,7 @@ #include #include #include +#include #include struct cpuinfo cpuinfo; diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c index 0cd04d936a7a..a628c928941b 100644 --- a/arch/openrisc/kernel/setup.c +++ b/arch/openrisc/kernel/setup.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c index f005ddedb50e..d00488507f49 100644 --- a/arch/parisc/kernel/setup.c +++ b/arch/parisc/kernel/setup.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index dd98f43bd685..12ddcb1401be 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 0be8a2403212..f28ec528d54a 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -4,8 +4,9 @@ */ #include -#include #include +#include +#include #include #include #include diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h index bd66f8e34949..55fbb4f7f7f6 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -80,7 +81,6 @@ void s390_adjust_jiffies(void); void s390_update_cpu_mhz(void); void cpu_detect_mhz_feature(void); -extern const struct seq_operations cpuinfo_op; extern void execve_tail(void); extern void __bpon(void); unsigned long vdso_size(void); diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c index a194611ba88c..267886605902 100644 --- a/arch/s390/kernel/processor.c +++ b/arch/s390/kernel/processor.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/arch/sh/include/asm/processor.h b/arch/sh/include/asm/processor.h index 85a6c1c3c16e..10c4b4b9af46 100644 --- a/arch/sh/include/asm/processor.h +++ b/arch/sh/include/asm/processor.h @@ -123,7 +123,6 @@ extern unsigned int mem_init_done; /* arch/sh/kernel/setup.c */ const char *get_cpu_subtype(struct sh_cpuinfo *c); -extern const struct seq_operations cpuinfo_op; /* thread_struct flags */ #define SH_THREAD_UAC_NOPRINT (1 << 0) diff --git a/arch/sh/kernel/cpu/proc.c b/arch/sh/kernel/cpu/proc.c index a306bcd6b341..f373a21c6705 100644 --- a/arch/sh/kernel/cpu/proc.c +++ b/arch/sh/kernel/cpu/proc.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include diff --git a/arch/sparc/include/asm/cpudata.h b/arch/sparc/include/asm/cpudata.h index d213165ee713..f7e690a7860b 100644 --- a/arch/sparc/include/asm/cpudata.h +++ b/arch/sparc/include/asm/cpudata.h @@ -7,8 +7,6 @@ #include #include -extern const struct seq_operations cpuinfo_op; - #endif /* !(__ASSEMBLY__) */ #if defined(__sparc__) && defined(__arch64__) diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c index 79cd6ccfeac0..ffdc7a825b80 100644 --- a/arch/sparc/kernel/cpu.c +++ b/arch/sparc/kernel/cpu.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index e0de60e503b9..4034f5b959f7 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 356308c73951..08ccd453ec4f 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -188,8 +188,6 @@ DECLARE_PER_CPU_READ_MOSTLY(struct cpuinfo_x86, cpu_info); #define cpu_data(cpu) boot_cpu_data #endif -extern const struct seq_operations cpuinfo_op; - #define cache_line_size() (boot_cpu_data.x86_cache_alignment) extern void cpu_detect(struct cpuinfo_x86 *c); diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c index 099b6f0d96bd..5a0699d9ff7d 100644 --- a/arch/x86/kernel/cpu/proc.c +++ b/arch/x86/kernel/cpu/proc.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "cpu.h" diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index 9191738f9941..d4417a174887 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c @@ -25,6 +25,7 @@ #include #include #include +#include #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) # include diff --git a/fs/proc/cpuinfo.c b/fs/proc/cpuinfo.c index f38bda5b83ec..ca3065dfecd9 100644 --- a/fs/proc/cpuinfo.c +++ b/fs/proc/cpuinfo.c @@ -3,10 +3,9 @@ #include #include #include +#include #include -extern const struct seq_operations cpuinfo_op; - static int cpuinfo_open(struct inode *inode, struct file *file) { return seq_open(file, &cpuinfo_op); diff --git a/include/linux/processor.h b/include/linux/processor.h index dc78bdc7079a..71bdf8626874 100644 --- a/include/linux/processor.h +++ b/include/linux/processor.h @@ -59,4 +59,6 @@ do { \ #endif +extern const struct seq_operations cpuinfo_op; + #endif /* _LINUX_PROCESSOR_H */