From: Pavel Machek <pavel@ucw.cz>
To: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <len.brown@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 06/27] power: wakeup: Remove use of seq_printf return value
Date: Sun, 22 Feb 2015 22:38:35 +0100 [thread overview]
Message-ID: <20150222213835.GA7817@amd> (raw)
In-Reply-To: <1b5eb664ab9313f1c5b9868819e1960d5dc597ac.1424573328.git.joe@perches.com>
On Sat 2015-02-21 18:53:33, Joe Perches wrote:
> The seq_printf return value, because it's frequently misused,
> will eventually be converted to void.
>
> See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
> seq_has_overflowed() and make public")
You've just removed overflow handling from
print_wakeup_source_stats. Can you explain why that is good idea?
Pavel
> --- a/drivers/base/power/wakeup.c
> +++ b/drivers/base/power/wakeup.c
> @@ -842,7 +842,6 @@ static int print_wakeup_source_stats(struct seq_file *m,
> unsigned long active_count;
> ktime_t active_time;
> ktime_t prevent_sleep_time;
> - int ret;
>
> spin_lock_irqsave(&ws->lock, flags);
>
> @@ -865,17 +864,16 @@ static int print_wakeup_source_stats(struct seq_file *m,
> active_time = ktime_set(0, 0);
> }
>
> - ret = seq_printf(m, "%-12s\t%lu\t\t%lu\t\t%lu\t\t%lu\t\t"
> - "%lld\t\t%lld\t\t%lld\t\t%lld\t\t%lld\n",
> - ws->name, active_count, ws->event_count,
> - ws->wakeup_count, ws->expire_count,
> - ktime_to_ms(active_time), ktime_to_ms(total_time),
> - ktime_to_ms(max_time), ktime_to_ms(ws->last_time),
> - ktime_to_ms(prevent_sleep_time));
> + seq_printf(m, "%-12s\t%lu\t\t%lu\t\t%lu\t\t%lu\t\t%lld\t\t%lld\t\t%lld\t\t%lld\t\t%lld\n",
> + ws->name, active_count, ws->event_count,
> + ws->wakeup_count, ws->expire_count,
> + ktime_to_ms(active_time), ktime_to_ms(total_time),
> + ktime_to_ms(max_time), ktime_to_ms(ws->last_time),
> + ktime_to_ms(prevent_sleep_time));
>
> spin_unlock_irqrestore(&ws->lock, flags);
>
> - return ret;
> + return 0;
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2015-02-22 21:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-22 2:53 [PATCH 00/27] Convert seq_<foo> output calls to return void Joe Perches
2015-02-22 2:53 ` [PATCH 06/27] power: wakeup: Remove use of seq_printf return value Joe Perches
2015-02-22 21:38 ` Pavel Machek [this message]
2015-02-22 21:52 ` Joe Perches
2015-02-23 11:54 ` Pavel Machek
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=20150222213835.GA7817@amd \
--to=pavel@ucw.cz \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/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).