diff mbox series

[v2] PM/wakeup: Add print_wakeup_source_stats(m, &deleted_ws)

Message ID 20191209093523.15752-1-zhuguangqing83@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series [v2] PM/wakeup: Add print_wakeup_source_stats(m, &deleted_ws) | expand

Commit Message

guangqing zhu Dec. 9, 2019, 9:35 a.m. UTC
From: zhuguangqing <zhuguangqing@xiaomi.com>

After commit 00ee22c28915 (PM / wakeup: Use seq_open()
to show wakeup stats), print_wakeup_source_stats(m, &deleted_ws)
is deleted in function wakeup_sources_stats_seq_show().

Because deleted_ws is one of wakeup sources, so it should
also be showed. This patch add it to the end of all other
wakeup sources.

Signed-off-by: zhuguangqing <zhuguangqing@xiaomi.com>
---
v2: modify judegment condition according to the advice of Rafael J.

 drivers/base/power/wakeup.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Rafael J. Wysocki Dec. 20, 2019, 9:19 a.m. UTC | #1
On Monday, December 9, 2019 10:35:23 AM CET zhuguangqing83@gmail.com wrote:
> From: zhuguangqing <zhuguangqing@xiaomi.com>
> 
> After commit 00ee22c28915 (PM / wakeup: Use seq_open()
> to show wakeup stats), print_wakeup_source_stats(m, &deleted_ws)
> is deleted in function wakeup_sources_stats_seq_show().
> 
> Because deleted_ws is one of wakeup sources, so it should
> also be showed. This patch add it to the end of all other
> wakeup sources.
> 
> Signed-off-by: zhuguangqing <zhuguangqing@xiaomi.com>
> ---
> v2: modify judegment condition according to the advice of Rafael J.
> 
>  drivers/base/power/wakeup.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
> index 5817b51d2b15..53c0519da1e4 100644
> --- a/drivers/base/power/wakeup.c
> +++ b/drivers/base/power/wakeup.c
> @@ -1071,6 +1071,9 @@ static void *wakeup_sources_stats_seq_next(struct seq_file *m,
>  		break;
>  	}
>  
> +	if (!next_ws)
> +		print_wakeup_source_stats(m, &deleted_ws);
> +
>  	return next_ws;
>  }
>  
> 

Applied as 5.6 material with some subject and changelog modifications, thanks!
diff mbox series

Patch

diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index 5817b51d2b15..53c0519da1e4 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -1071,6 +1071,9 @@  static void *wakeup_sources_stats_seq_next(struct seq_file *m,
 		break;
 	}
 
+	if (!next_ws)
+		print_wakeup_source_stats(m, &deleted_ws);
+
 	return next_ws;
 }