Commit 4711b7b8 authored by Thomas Richter's avatar Thomas Richter Committed by Alexander Gordeev
Browse files

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: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
Acked-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
parent 98b1cc82
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -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 */
+0 −1
Original line number Diff line number Diff line
@@ -260,7 +260,6 @@ static int paiext_event_init(struct perf_event *event)
	rc = paiext_alloc(a, event);
	if (rc)
		return rc;
	event->hw.last_tag = 0;
	event->destroy = paiext_event_destroy;

	if (a->sample_period) {