From 8ccb0afc826ef9ce3cbbb4f8924a2ec47467aca6 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Wed, 11 Nov 2015 18:38:46 +0100 Subject: [PATCH] Fix default value for number of subitems for A_PWR_WGHFREQ activity Default value should be -1 for nr2 field (number of different frequencies for A_PWR_WGHFREQ activity). A values of -1 means that the corresponding number has still not been calculated by the f_count2() function. This is consistent with default values used for nr field. Signed-off-by: Sebastien GODARD --- activity.c | 2 +- sa.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/activity.c b/activity.c index e7fc0e9..9123abd 100644 --- a/activity.c +++ b/activity.c @@ -1190,7 +1190,7 @@ struct activity pwr_wghfreq_act = { .name = "A_PWR_WGHFREQ", #endif .nr = -1, - .nr2 = 1, + .nr2 = -1, .nr_max = NR_CPUS + 1, .fsize = STATS_PWR_WGHFREQ_SIZE, .msize = STATS_PWR_WGHFREQ_SIZE, diff --git a/sa.h b/sa.h index c9576a9..1886513 100644 --- a/sa.h +++ b/sa.h @@ -446,6 +446,8 @@ struct activity { * Note: If @nr = 0, then @nr2 is undetermined (may be -1, 0 or >0). * 2) IF @nr > 0 THEN @nr2 > 0. * Note: If @nr2 > 0 then @nr is undetermined (may be -1, 0 or >0). + * 3) IF @nr <= 0 THEN @nr2 = -1 (this is the default value for @nr2, + * meaning that it has not been calculated). */ __nr_t nr2; /* -- 2.40.0