summaryrefslogtreecommitdiff
path: root/arch/s390/kernel/perf_pai_crypto.c
diff options
context:
space:
mode:
authorThomas Richter <tmricht@linux.ibm.com>2023-10-30 13:41:33 +0300
committerAlexander Gordeev <agordeev@linux.ibm.com>2023-11-22 15:54:57 +0300
commit4711b7b8f99583f6105a33e91f106125134beacb (patch)
tree3bcecbf161869eef1392b3614086579044df0d07 /arch/s390/kernel/perf_pai_crypto.c
parent98b1cc82c4affc16f5598d4fa14b1858671b2263 (diff)
downloadlinux-4711b7b8f99583f6105a33e91f106125134beacb.tar.xz
s390/pai: cleanup event initialization
Setting event::hw.last_tag to zero is not necessary. The memory for each event is dynamically allocated by the kernel common code and initialized to zero already. Remove this unnecessary assignment. Move the comment to function paicrypt_start() for clarification. Suggested-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/perf_pai_crypto.c')
-rw-r--r--arch/s390/kernel/perf_pai_crypto.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/s390/kernel/perf_pai_crypto.c b/arch/s390/kernel/perf_pai_crypto.c
index 77fd24e6cbb6..39a91b00438a 100644
--- a/arch/s390/kernel/perf_pai_crypto.c
+++ b/arch/s390/kernel/perf_pai_crypto.c
@@ -279,12 +279,6 @@ static int paicrypt_event_init(struct perf_event *event)
if (IS_ERR(cpump))
return PTR_ERR(cpump);
- /* Event initialization sets last_tag to 0. When later on the events
- * are deleted and re-added, do not reset the event count value to zero.
- * Events are added, deleted and re-added when 2 or more events
- * are active at the same time.
- */
- event->hw.last_tag = 0;
event->destroy = paicrypt_event_destroy;
if (a->sample_period) {
@@ -318,6 +312,11 @@ static void paicrypt_start(struct perf_event *event, int flags)
{
u64 sum;
+ /* Event initialization sets last_tag to 0. When later on the events
+ * are deleted and re-added, do not reset the event count value to zero.
+ * Events are added, deleted and re-added when 2 or more events
+ * are active at the same time.
+ */
if (!event->hw.last_tag) {
event->hw.last_tag = 1;
sum = paicrypt_getall(event); /* Get current value */