]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/cpum_sf: Remove unused defines REG_NONE and REG_OVERFLOW
authorThomas Richter <tmricht@linux.ibm.com>
Thu, 27 Jun 2024 07:02:06 +0000 (09:02 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 7 Aug 2024 18:52:52 +0000 (20:52 +0200)
Member hw_perf_event::reg.reg is set but never used, so remove it.
Defines REG_NONE and REG_OVERFLOW are not referenced anymore.
The initialization to zero takes place in function
perf_event_alloc() where
  ...
  event = kmem_cache_alloc_node(perf_event_cache,
                GFP_KERNEL | __GFP_ZERO, node);
  ...

makes sure memory allocated for the event is zero'ed.
This is done in the kernel's common code in kernel/events/core.c
The struct perf_event contains member hw_perf_event as in

  struct perf_event {
   ....
   struct hw_perf_event hw;
   ....
  };

This contained sub-structure is also initialized to zero.
No functional change.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/perf_event.h
arch/s390/kernel/perf_cpum_sf.c

index 4879f3a5c474e4cca2297ecea63b3b9e58dcc3b7..05be93b5905d13755e7c0ac16a3413789e6d7ffc 100644 (file)
@@ -60,8 +60,6 @@ struct perf_sf_sde_regs {
 #define PERF_CPUM_SF_DIAG_MODE         0x0002    /* Diagnostic-sampling flag */
 #define PERF_CPUM_SF_FREQ_MODE         0x0008    /* Sampling with frequency */
 
-#define REG_NONE               0
-#define REG_OVERFLOW           1
 #define OVERFLOW_REG(hwc)      ((hwc)->extra_reg.config)
 #define SFB_ALLOC_REG(hwc)     ((hwc)->extra_reg.alloc)
 #define TEAR_REG(hwc)          ((hwc)->last_tag)
index 041e22bee839c0db2769adfd858891b1d0abb029..1019fee3e734aa28891099e52a0c034af84b7bbd 100644 (file)
@@ -876,10 +876,6 @@ static int __hw_perf_event_init(struct perf_event *event)
        if (err)
                goto out;
 
-       /* Initialize sample data overflow accounting */
-       hwc->extra_reg.reg = REG_OVERFLOW;
-       OVERFLOW_REG(hwc) = 0;
-
        /* Use AUX buffer. No need to allocate it by ourself */
        if (attr->config == PERF_EVENT_CPUM_SF_DIAG)
                return 0;