s390/idle: Add missing EXPORT_SYMBOL()
Heiko Carstens
maintainerPATCH 1/1 s390/idle: Add missing EXPORT_SYMBOL()
Uwe Kleine-König reported this build breakage caused by a recent commit which provides arch specific kcpustat_field_idle()/kcpustat_field_iowait() functions:
ERROR: modpost: "arch_kcpustat_field_idle" [drivers/leds/trigger/ledtrig-activity.ko] undefined!
ERROR: modpost: "arch_kcpustat_field_iowait" [drivers/leds/trigger/ledtrig-activity.ko] undefined!
Fix this by adding the missing EXPORT_SYMBOL().
--- arch/s390/kernel/idle.c | 3 +++ 1 file changed, 3 insertions(+)
arch/s390/kernel/idle.c +3 -0
@@ -14,6 +14,7 @@#include <linux/init.h> #include <linux/cpu.h> #include <trace/events/power.h> +#include <linux/export.h> #include <asm/cpu_mf.h> #include <asm/cputime.h> #include <asm/idle.h>
@@ -83,11 +84,13 @@ u64 arch_kcpustat_field_idle(int cpu) {return arch_cpu_idle_time (cpu,CPUTIME_IDLE , !nr_iowait_cpu (cpu)); } +EXPORT_SYMBOL (arch_kcpustat_field_idle);u64 arch_kcpustat_field_iowait (int cpu) {return arch_cpu_idle_time (cpu,CPUTIME_IOWAIT ,nr_iowait_cpu (cpu)); } +EXPORT_SYMBOL (arch_kcpustat_field_iowait);void account_idle_time_irq (void ) {
Signature · 1 line
2.53.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Export License Discrepancy: arch_kcpustat_field_idle and arch_kcpustat_field_iowait are exported…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Export License Discrepancy: arch_kcpustat_field_idle and arch_kcpustat_field_iowait are exported via EXPORT_SYMBOL instead of EXPORT_SYMBOL_GPL. --
commit 53dd63a70164da468386d3191eb1e7e24af1b440
Author: Heiko Carstens <[email protected]>
s390/idle: Add missing EXPORT_SYMBOL()
This commit fixes a build breakage for the ledtrig-activity module by exporting the newly introduced arch_kcpustat_field_idle and arch_kcpustat_field_iowait functions.
Quoted 4 lines
arch/s390/kernel/idle.c +0
-0
[ ... ]
arch/s390/kernel/idle.c u64 arch_kcpustat_field_idle(int cpu) · line 87
Quoted 5 lines
arch/s390/kernel/idle.c +1
-0@@ -83,11 +84,13 @@ u64 arch_kcpustat_field_idle(int cpu) {return arch_cpu_idle_time (cpu,CPUTIME_IDLE , !nr_iowait_cpu (cpu)); } +EXPORT_SYMBOL (arch_kcpustat_field_idle);
[Severity: Low]
Should this use EXPORT_SYMBOL_GPL() instead? The generic implementations of kcpustat_field_idle() in kernel/sched/cputime.c are exported as GPL-only. Using a standard export here circumvents the GPL symbol restriction imposed by the core scheduler.
arch/s390/kernel/idle.c u64 arch_kcpustat_field_idle(int cpu) · line 93
Quoted 6 lines
arch/s390/kernel/idle.c +1
-0u64 arch_kcpustat_field_iowait (int cpu) {return arch_cpu_idle_time (cpu,CPUTIME_IOWAIT ,nr_iowait_cpu (cpu)); } +EXPORT_SYMBOL (arch_kcpustat_field_iowait);
[Severity: Low]
Similarly, does this need to be EXPORT_SYMBOL_GPL() to match the generic kcpustat_field_iowait() counterpart?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 8 lines · Heiko Carstens
Uwe Kleine-König reported this build breakage caused by a recent commit which provides arch specific kcpustat_field_idle()/kcpustat_field_iowait() functions:
ERROR: modpost: "
arch_kcpustat_field_idle" [drivers/leds/trigger/ledtrig-activity.ko] undefined!
ERROR: modpost: "arch_kcpustat_field_iowait" [drivers/leds/trigger/ledtrig-activity.ko] undefined!Fix this by adding the missing
EXPORT_SYMBOL().
Did you consider EXPORT_SYMBOL_GPL() which AFAIK is prefered over the non-GPL one?
Quoted 13 lines
Fixes 670e057744e0 ("s390/idle: Provide arch specific kcpustat_field_idle()/kcpustat_field_iowait()")Reported-by Uwe Kleine-König <[email protected]>Signed-off-by Heiko Carstens <[email protected]>--- arch/s390/kernel/idle.c | 3 +++ 1 file changed, 3 insertions(+)arch/s390/kernel/idle.c +0
-0
arch/s390/kernel/idle.c line 20
Quoted 7 lines
arch/s390/kernel/idle.c +1
-0@@ -14,6 +14,7 @@#include <linux/init.h> #include <linux/cpu.h> #include <trace/events/power.h> +#include <linux/export.h> #include <asm/cpu_mf.h> #include <asm/cputime.h> #include <asm/idle.h>
When I fixed up the reported issue in my local tree, I didn't add that include, so it seems to be included already implicitly. But I guess adding that explicitly is a good idea.
Quoted 4 lines
arch/s390/kernel/idle.c +0
-0@@ -83,11 +84,13 @@ u64 arch_kcpustat_field_idle(int cpu) {return arch_cpu_idle_time (cpu,CPUTIME_IDLE , !nr_iowait_cpu (cpu)); }
arch/s390/kernel/idle.c u64 arch_kcpustat_field_idle(int cpu) · line 96
Quoted 10 lines
arch/s390/kernel/idle.c +2
-0+EXPORT_SYMBOL (arch_kcpustat_field_idle);u64 arch_kcpustat_field_iowait (int cpu) {return arch_cpu_idle_time (cpu,CPUTIME_IOWAIT ,nr_iowait_cpu (cpu)); } +EXPORT_SYMBOL (arch_kcpustat_field_iowait);void account_idle_time_irq (void ) {
Best regards
Uwe
Heiko Carstens
maintainerQuoted 5 lines · Uwe Kleine-König
Quoted 4 lines · Heiko Carstens
Uwe Kleine-König reported this build breakage caused by a recent commit which provides arch specific kcpustat_field_idle()/kcpustat_field_iowait() functions:
Quoted 7 lines
Quoted 4 lines
ERROR: modpost: "
arch_kcpustat_field_idle" [drivers/leds/trigger/ledtrig-activity.ko] undefined!
ERROR: modpost: "arch_kcpustat_field_iowait" [drivers/leds/trigger/ledtrig-activity.ko] undefined!Fix this by adding the missing
EXPORT_SYMBOL().Did you consider
EXPORT_SYMBOL_GPL()which AFAIK is prefered over the non-GPL one?
My mistake. I really shouldn't write patches in a hurry a few minutes before I shutdown my system (what could go wrong?). Sashiko reported the same. Will also be fixed.
Quoted 1 line
Tested-by Uwe Kleine-König <[email protected]>
Thanks a lot!