Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1034675rwe; Thu, 25 Aug 2022 14:07:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR4R/z/BmpF1iVGWKGwxfj2VtWVimtarGvWyj2mvZKSrMm1MzoDbTujg6qXOy0D2TtHy39SW X-Received: by 2002:a17:907:971d:b0:73d:78c8:77b5 with SMTP id jg29-20020a170907971d00b0073d78c877b5mr3593177ejc.631.1661461627813; Thu, 25 Aug 2022 14:07:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661461627; cv=none; d=google.com; s=arc-20160816; b=TI3eqNG468q+97pzkiPqtfY2l6/P+qqiBga8Xx+QHmjBomtCUsMD8TphDrBVHruiF2 9xoPhi/X7Re86JcwuTNVZH7K/s+PwP92KOPnzNnqDECqgNeY9HKxox8pUF2tiBdIFpOm srr6IcU95q63v6HGI7Y0kZAuHibGdgdmZz2hNgYe2f20mP0OgCPJjDvLiQt7s9WFYODH 2yJ8wfb0L5sQqngX56fMxtyPDL/8/KZXeK3npaaSXxHFY+iSn+ToPNod60z8dkK7SQBA 9vJrorC+BQjes5JMs5+7P+AKGS0OKV3VK5rGYOCuBnqsVZhK4RMQE6EdQXFVWaXwi43/ s67Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Z63zwi7cGAuKiNoBIs10Ekj9CC9KQ4p8G+KukTWva3I=; b=WWvTJO3nfB8tZlfjsRFCTGGE0n3jPMAFhOAQx6KWsVdCKomTXdvU8Wr5DPTcot1raI oIVUU7CEAyPPcPTNhBgckNVOowD3M+hZTKSXNZoL6ofpHhvjYHZQEOGZ0Yk9ZY8T0NI1 7ZpZwwk7k78R7QmJ4tfHWvjouOWczWnlrxp97miUvVIGQGexNQM6Sto3iM2e06lHKGuz ylL3mxVN4zHtdV2poXthXDwY+Obwoa/4UMGJ8G+863eqyERZslH/RkX1Aj9SxAoNyL/Z td8kfZHffTr6H0EJ4SkVfZ7N2cbCn1Xu4N60s5HOzDk5JvBAgyNOQHyTeiXg3YqCTqaK Nwzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@conchuod.ie header.s=google header.b=SJaPKdEK; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=conchuod.ie Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y15-20020a056402358f00b0043dc410c5ddsi340180edc.484.2022.08.25.14.06.42; Thu, 25 Aug 2022 14:07:07 -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=@conchuod.ie header.s=google header.b=SJaPKdEK; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=conchuod.ie Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242180AbiHYVBj (ORCPT + 99 others); Thu, 25 Aug 2022 17:01:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243177AbiHYVBe (ORCPT ); Thu, 25 Aug 2022 17:01:34 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ACFAA405C for ; Thu, 25 Aug 2022 14:01:27 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id b5so21787790wrr.5 for ; Thu, 25 Aug 2022 14:01:27 -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=Y9j3jWJVMXkhaDWrmHezeeXzHkDh/Bl+Jb0iVl/9/HpMoNHfpVDh7RReVdVyHe64N7 TsM2vN5WkXsviNQ6gyOGFBRPHXUNTu3KfnMMFAXR+ImhT/IkTVD6d93iAfgLTBmjX8AA 9G3uloyXOYx6ezaRoph5TrngxzHqmz1k9We4j+KMy9RFxw3D9Ba42NPGjcSyT05Ha/84 Hsx3/a/gS6S+DO2XjD1tKqzw+8tMBWZdnf9b2tLgT/Sc4gn2eyr5pnvuvfy8mEqG/sEz VgwFxEMs3ZGfOuZXtM52kGUtfGZsRw0ZKlilvpOQdb5WOe9qgY3JiGp5fMHLVyZJYROV eUvw== X-Gm-Message-State: ACgBeo0OSUyviUueETGVcxa4WToVdbSsc1yKMKjCawUIx8aQo5U2x8v9 X4dA3nOOkdY354+udYWhAj+rSQ== 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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 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 */ -- 2.37.1