linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: zhuguangqing83@gmail.com
Cc: gregkh@linuxfoundation.org, pavel@ucw.cz, len.brown@intel.com,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	zhuguangqing <zhuguangqing@xiaomi.com>
Subject: Re: [PATCH] PM/wakeup: Add print_wakeup_sour_stats(m, &deleted_ws)
Date: Fri, 08 Nov 2019 12:34:23 +0100	[thread overview]
Message-ID: <2538968.KVf98yYfh7@kreacher> (raw)
In-Reply-To: <20191021085140.14030-1-zhuguangqing83@gmail.com>

On Monday, October 21, 2019 10:51:40 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>
> ---
>  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..29e9434ccaaa 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 (&ws->entry == &wakeup_sources)
> +		print_wakeup_source_stats(m, &deleted_ws);
> +

That would be when NULL is about to be returned, right?

Why not to check for !next_ws instead, then?

Moreover, why to call print_wakeup_source_stats() directly instead of returning
&deleted_ws?

Also it looks like you need a similar change in wakeup_sources_stats_seq_start(),
in case n is greater than the number of list entries, don't you?

>  	return next_ws;
>  }
>  
> 





  reply	other threads:[~2019-11-08 11:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21  8:51 [PATCH] PM/wakeup: Add print_wakeup_sour_stats(m, &deleted_ws) zhuguangqing83
2019-11-08 11:34 ` Rafael J. Wysocki [this message]
2019-11-09  6:37   ` guangqing zhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2538968.KVf98yYfh7@kreacher \
    --to=rjw@rjwysocki.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=zhuguangqing83@gmail.com \
    --cc=zhuguangqing@xiaomi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).