Skip to content

Commit 4711b7b

Browse files
Thomas RichterAlexander Gordeev
authored andcommitted
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 <[email protected]> Acked-by: Sumanth Korikkar <[email protected]> Signed-off-by: Thomas Richter <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
1 parent 98b1cc8 commit 4711b7b

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

arch/s390/kernel/perf_pai_crypto.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,6 @@ static int paicrypt_event_init(struct perf_event *event)
279279
if (IS_ERR(cpump))
280280
return PTR_ERR(cpump);
281281

282-
/* Event initialization sets last_tag to 0. When later on the events
283-
* are deleted and re-added, do not reset the event count value to zero.
284-
* Events are added, deleted and re-added when 2 or more events
285-
* are active at the same time.
286-
*/
287-
event->hw.last_tag = 0;
288282
event->destroy = paicrypt_event_destroy;
289283

290284
if (a->sample_period) {
@@ -318,6 +312,11 @@ static void paicrypt_start(struct perf_event *event, int flags)
318312
{
319313
u64 sum;
320314

315+
/* Event initialization sets last_tag to 0. When later on the events
316+
* are deleted and re-added, do not reset the event count value to zero.
317+
* Events are added, deleted and re-added when 2 or more events
318+
* are active at the same time.
319+
*/
321320
if (!event->hw.last_tag) {
322321
event->hw.last_tag = 1;
323322
sum = paicrypt_getall(event); /* Get current value */

arch/s390/kernel/perf_pai_ext.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ static int paiext_event_init(struct perf_event *event)
260260
rc = paiext_alloc(a, event);
261261
if (rc)
262262
return rc;
263-
event->hw.last_tag = 0;
264263
event->destroy = paiext_event_destroy;
265264

266265
if (a->sample_period) {

0 commit comments

Comments
 (0)