[PATCH] s390: remove unused setup_profiling_timer function

Anthony Iliopoulos posted 1 patch 1 month, 1 week ago
arch/s390/kernel/entry.h |  1 -
arch/s390/kernel/irq.c   |  1 -
arch/s390/kernel/smp.c   | 11 -----------
arch/s390/kernel/time.c  |  1 -
4 files changed, 14 deletions(-)
[PATCH] s390: remove unused setup_profiling_timer function
Posted by Anthony Iliopoulos 1 month, 1 week ago
setup_profiling_timer() is not used by any code at this point. Since a
default weak implementation exists, there is no need to keep this
arch-specific definition around. Remove it along with the now-redundant
profile header includes.

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
---
 arch/s390/kernel/entry.h |  1 -
 arch/s390/kernel/irq.c   |  1 -
 arch/s390/kernel/smp.c   | 11 -----------
 arch/s390/kernel/time.c  |  1 -
 4 files changed, 14 deletions(-)

diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h
index dc84ab497251..144a72ad7dc6 100644
--- a/arch/s390/kernel/entry.h
+++ b/arch/s390/kernel/entry.h
@@ -45,7 +45,6 @@ void do_ext_irq(struct pt_regs *regs);
 void do_restart(void *arg);
 void __init startup_init(void);
 void die(struct pt_regs *regs, const char *str);
-int setup_profiling_timer(unsigned int multiplier);
 
 struct s390_mmap_arg_struct;
 struct fadvise64_64_args;
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c
index c923496aa7b4..319e4e5bc9fe 100644
--- a/arch/s390/kernel/irq.c
+++ b/arch/s390/kernel/irq.c
@@ -13,7 +13,6 @@
 #include <linux/interrupt.h>
 #include <linux/seq_file.h>
 #include <linux/proc_fs.h>
-#include <linux/profile.h>
 #include <linux/export.h>
 #include <linux/kernel.h>
 #include <linux/ftrace.h>
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 167c72803ccf..d5e58329a24b 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -980,17 +980,6 @@ void __init smp_setup_processor_id(void)
 	lc->spinlock_index = 0;
 }
 
-/*
- * the frequency of the profiling timer can be changed
- * by writing a multiplier value into /proc/profile.
- *
- * usually you want to run this on all CPUs ;)
- */
-int setup_profiling_timer(unsigned int multiplier)
-{
-	return 0;
-}
-
 static ssize_t cpu_configure_show(struct device *dev,
 				  struct device_attribute *attr, char *buf)
 {
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 2b989bebd220..66191fdef101 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -32,7 +32,6 @@
 #include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/types.h>
-#include <linux/profile.h>
 #include <linux/timex.h>
 #include <linux/notifier.h>
 #include <linux/clockchips.h>
-- 
2.55.0
Re: [PATCH] s390: remove unused setup_profiling_timer function
Posted by Geert Uytterhoeven 1 month, 1 week ago
Hi Anthony,

Thanks for your patch!

On Fri, 21 Aug 2026 at 08:05, Anthony Iliopoulos <ailiop@suse.com> wrote:
> setup_profiling_timer() is not used by any code at this point. Since a

It is used by write_profile()
https://elixir.bootlin.com/linux/v7.2/source/kernel/profile.c#L202

> default weak implementation exists, there is no need to keep this
> arch-specific definition around. Remove it along with the now-redundant
> profile header includes.
>
> Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>

> --- a/arch/s390/kernel/smp.c
> +++ b/arch/s390/kernel/smp.c
> @@ -980,17 +980,6 @@ void __init smp_setup_processor_id(void)
>         lc->spinlock_index = 0;
>  }
>
> -/*
> - * the frequency of the profiling timer can be changed
> - * by writing a multiplier value into /proc/profile.
> - *
> - * usually you want to run this on all CPUs ;)
> - */
> -int setup_profiling_timer(unsigned int multiplier)
> -{
> -       return 0;

Just like on SH, this returns zero (success), while the default weak
implementation returns -EINVAL, so your change breaks write_profile().
https://elixir.bootlin.com/linux/v7.2/source/kernel/profile.c#L181

> -}
> -
>  static ssize_t cpu_configure_show(struct device *dev,
>                                   struct device_attribute *attr, char *buf)
>  {

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds