* [Powertop] [PATCH v2 8/8] Adding a clean_shutdown function
@ 2014-10-14 18:09 Joe Konno
0 siblings, 0 replies; 3+ messages in thread
From: Joe Konno @ 2014-10-14 18:09 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 938 bytes --]
From: Dan Kalowsky <daniel.kalowsky(a)intel.com>
Function is designed to be a on stop place to clean up the entire
application at shutdown time.
v2: rebased atop 41c54e8
Signed-off-by: Joe Konno <joe.konno(a)intel.com>
---
src/main.cpp | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/main.cpp b/src/main.cpp
index d3963ed..b6ce090 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -368,6 +368,17 @@ static void powertop_init(void)
initialized = 1;
}
+void clean_shutdown()
+{
+ close_results();
+ close_display();
+ clean_open_devices();
+ clear_all_devices();
+ clear_all_cpus();
+
+ return;
+}
+
int main(int argc, char **argv)
{
@@ -498,9 +509,7 @@ int main(int argc, char **argv)
clear_tuning();
reset_display();
- clean_open_devices();
- clear_all_devices();
- clear_all_cpus();
+ clean_shutdown();
return 0;
}
--
2.1.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Powertop] [PATCH v2 8/8] Adding a clean_shutdown function
@ 2014-10-15 12:59 Sergey Senozhatsky
0 siblings, 0 replies; 3+ messages in thread
From: Sergey Senozhatsky @ 2014-10-15 12:59 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 1107 bytes --]
On (10/14/14 11:09), Joe Konno wrote:
> src/main.cpp | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/src/main.cpp b/src/main.cpp
> index d3963ed..b6ce090 100644
> --- a/src/main.cpp
> +++ b/src/main.cpp
> @@ -368,6 +368,17 @@ static void powertop_init(void)
> initialized = 1;
> }
>
> +void clean_shutdown()
> +{
> + close_results();
> + close_display();
> + clean_open_devices();
> + clear_all_devices();
> + clear_all_cpus();
> +
> + return;
> +}
> +
I would agree on that refactoring if we would call this function
from several places. otherwise, I see no actual reason.
-ss
> int main(int argc, char **argv)
> {
> @@ -498,9 +509,7 @@ int main(int argc, char **argv)
> clear_tuning();
> reset_display();
>
> - clean_open_devices();
> - clear_all_devices();
> - clear_all_cpus();
> + clean_shutdown();
>
> return 0;
> }
> --
> 2.1.2
>
> _______________________________________________
> PowerTop mailing list
> PowerTop(a)lists.01.org
> https://lists.01.org/mailman/listinfo/powertop
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Powertop] [PATCH v2 8/8] Adding a clean_shutdown function
@ 2014-10-17 17:34 Joe Konno
0 siblings, 0 replies; 3+ messages in thread
From: Joe Konno @ 2014-10-17 17:34 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 331 bytes --]
On 10/15/2014 05:59 AM, Sergey Senozhatsky wrote:
>
> I would agree on that refactoring if we would call this function
> from several places. otherwise, I see no actual reason.
>
> -ss
I'm sympathetic to that argument. I haven't a strong feeling one way or
the other in this instance, though.
Alex and maintainers?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-17 17:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-17 17:34 [Powertop] [PATCH v2 8/8] Adding a clean_shutdown function Joe Konno
-- strict thread matches above, loose matches on Subject: below --
2014-10-15 12:59 Sergey Senozhatsky
2014-10-14 18:09 Joe Konno
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.