* Re: [Powertop] [PATCH] Add support to store boardname in /data directory
@ 2012-07-18 22:06 Chris Ferron
0 siblings, 0 replies; 2+ messages in thread
From: Chris Ferron @ 2012-07-18 22:06 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 1326 bytes --]
On 07/18/2012 07:53 AM, Igor Zhbanov wrote:
> Add support to store boardname in /data directory.
> This patch is based on Linaro's changes.
> ---
> src/main.cpp | 15 +++++++++++----
> 1 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/src/main.cpp b/src/main.cpp
> index 7a1b976..8a68533 100644
> --- a/src/main.cpp
> +++ b/src/main.cpp
> @@ -240,12 +240,19 @@ static void load_board_params()
> string boardname;
> char filename[4096];
>
> - boardname = read_sysfs_string("/etc/boardname");
> + if (access("/etc/boardname", R_OK) == 0) {
> + boardname = read_sysfs_string("/etc/boardname");
>
> - if (boardname.length() < 2)
> - return;
> + if (boardname.length() < 2)
> + return;
>
> - sprintf(filename, "/var/cache/powertop/saved_parameters.powertop.%s", boardname.c_str());
> + sprintf(filename,
> + "/var/cache/powertop/saved_parameters.powertop.%s",
> + boardname.c_str());
> + } else if (access("/data", R_OK) == 0)
> + sprintf(filename,"saved_parameters.powertop");
> + else
> + return;
>
> if (access(filename, R_OK))
> return;
Thank you for this patch, but 'we' consider boardname now deprecated. As
such there is a future commit that will remove this code upcoming. As
such your patch will not be needed.
-Chris
^ permalink raw reply [flat|nested] 2+ messages in thread* [Powertop] [PATCH] Add support to store boardname in /data directory
@ 2012-07-18 14:53 Igor Zhbanov
0 siblings, 0 replies; 2+ messages in thread
From: Igor Zhbanov @ 2012-07-18 14:53 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]
Add support to store boardname in /data directory.
This patch is based on Linaro's changes.
---
src/main.cpp | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/main.cpp b/src/main.cpp
index 7a1b976..8a68533 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -240,12 +240,19 @@ static void load_board_params()
string boardname;
char filename[4096];
- boardname = read_sysfs_string("/etc/boardname");
+ if (access("/etc/boardname", R_OK) == 0) {
+ boardname = read_sysfs_string("/etc/boardname");
- if (boardname.length() < 2)
- return;
+ if (boardname.length() < 2)
+ return;
- sprintf(filename, "/var/cache/powertop/saved_parameters.powertop.%s", boardname.c_str());
+ sprintf(filename,
+ "/var/cache/powertop/saved_parameters.powertop.%s",
+ boardname.c_str());
+ } else if (access("/data", R_OK) == 0)
+ sprintf(filename,"saved_parameters.powertop");
+ else
+ return;
if (access(filename, R_OK))
return;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-18 22:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-18 22:06 [Powertop] [PATCH] Add support to store boardname in /data directory Chris Ferron
-- strict thread matches above, loose matches on Subject: below --
2012-07-18 14:53 Igor Zhbanov
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.