All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Ferron <chris.e.ferron at linux.intel.com>
To: powertop@lists.01.org
Subject: Re: [Powertop] [PATCH v2 1/2] Updates to support Android platform
Date: Mon, 24 Sep 2012 08:57:34 -0700	[thread overview]
Message-ID: <506082EE.5080602@linux.intel.com> (raw)
In-Reply-To: 1348493284-9375-1-git-send-email-rajagopal.venkat@linaro.org

[-- Attachment #1: Type: text/plain, Size: 3339 bytes --]

On 09/24/2012 06:28 AM, Rajagopal Venkat wrote:
> This patch adds following minor changes to prepare powertop
> to support Android platform.
>
> - Add missing HAVE_CONFIG_H conditional check.
> - remove un-used ethtool_cmd_speed_set and ethtool_cmd_speed
> functions.
> - Minimize dependency on exception handling in catch blocks.
>
> These changes will not affect powertop functionality.
>
> Signed-off-by: Rajagopal Venkat <rajagopal.venkat(a)linaro.org>
> ---
>   src/devices/ahci.cpp    |  4 ++--
>   src/devices/alsa.cpp    |  4 ++--
>   src/devices/network.cpp | 16 ----------------
>   src/main.cpp            |  2 ++
>   4 files changed, 6 insertions(+), 20 deletions(-)
>
> diff --git a/src/devices/ahci.cpp b/src/devices/ahci.cpp
> index 1fe39c7..67ce06e 100644
> --- a/src/devices/ahci.cpp
> +++ b/src/devices/ahci.cpp
> @@ -170,7 +170,7 @@ void ahci::start_measurement(void)
>   		file.close();
>   	}
>   	catch (std::ios_base::failure &c) {
> -		fprintf(stderr, "%s\n", c.what());
> +		fprintf(stderr, "Failed to start measurement for ahci device\n");
adding addition message here is acceptable, but eliminating the 
information from the catches error is not.

>   	}
>   
>   }
> @@ -203,7 +203,7 @@ void ahci::end_measurement(void)
>   		file.close();
>   	}
>   	catch (std::ios_base::failure &c) {
> -		fprintf(stderr, "%s\n", c.what());
> +		fprintf(stderr, "Failed to end measurement for ahci device\n");
>   	}
>   	if (end_active < start_active)
>   		end_active = start_active;
> diff --git a/src/devices/alsa.cpp b/src/devices/alsa.cpp
> index 4f5d3f9..a67780c 100644
> --- a/src/devices/alsa.cpp
> +++ b/src/devices/alsa.cpp
> @@ -104,7 +104,7 @@ void alsa::start_measurement(void)
>   		file.close();
>   	}
>   	catch (std::ios_base::failure &c) {
> -		fprintf(stderr, "%s\n", c.what());
> +		fprintf(stderr, "Failed to start measurement for alsa device\n");
>   	}
>   }
>   
> @@ -130,7 +130,7 @@ void alsa::end_measurement(void)
>   		file.close();
>   	}
>   	catch (std::ios_base::failure &c) {
> -		fprintf(stderr, "%s\n", c.what());
> +		fprintf(stderr, "Failed to end measurement for alsa device\n");
>   	}
>   
>   	p = (end_active - start_active) / (0.001 + end_active + end_inactive - start_active - start_inactive) * 100.0;
> diff --git a/src/devices/network.cpp b/src/devices/network.cpp
> index b8a5c9c..ed9d7aa 100644
> --- a/src/devices/network.cpp
> +++ b/src/devices/network.cpp
> @@ -55,22 +55,6 @@ extern "C" {
>   
>   static map<string, class network *> nics;
>   
> -#ifdef DISABLE_TRYCATCH
> -
> -static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
> -						__u32 speed)
> -{
> -
> -	ep->speed = (__u16)speed;
> -	ep->speed_hi = (__u16)(speed >> 16);
> -}
> -
> -static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep)
> -{
> -	return (ep->speed_hi << 16) | ep->speed;
> -}
> -
> -#endif
>   
>   static void do_proc_net_dev(void)
>   {
> diff --git a/src/main.cpp b/src/main.cpp
> index 1815075..dc49dba 100644
> --- a/src/main.cpp
> +++ b/src/main.cpp
> @@ -42,7 +42,9 @@
>   #include "perf/perf.h"
>   #include "perf/perf_bundle.h"
>   #include "lib.h"
> +#ifdef HAVE_CONFIG_H
>   #include "../config.h"
> +#endif
>   
>   
>   #include "devices/device.h"


             reply	other threads:[~2012-09-24 15:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24 15:57 Chris Ferron [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-09-25 15:25 [Powertop] [PATCH v2 1/2] Updates to support Android platform Chris Ferron
2012-09-25  6:11 Arjan van de Ven
2012-09-25  5:45 Arjan van de Ven
2012-09-25  5:34 Rajagopal Venkat
2012-09-24 13:28 Rajagopal Venkat

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=506082EE.5080602@linux.intel.com \
    --to=powertop@lists.01.org \
    /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 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.